CancelButton.java

/**
* Copyright (c) 2012-2013 Nokia Corporation. All rights reserved.
* Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation. 
* Oracle and Java are trademarks or registered trademarks of Oracle and/or its
* affiliates. Other product and company names mentioned herein may be trademarks
* or trade names of their respective owners. 
* See LICENSE.TXT for license information.
*/

package com.nokia.example.paint.views.components;

import javax.microedition.lcdui.Graphics;

/*
 * Return from file save dialog without saving.
 */
public class CancelButton
        extends Button {

    public CancelButton() {
        super("/dialog_btn_pressed.png", "/dialog_btn.png");
    }

    public void onSelected() {
    }

    public void render(Graphics g) {
        super.render(g);
        g.setColor(0x000000);
        g.drawString("Cancel", this.x + (width / 2), this.y + (height / 2) + 5, Graphics.BASELINE | Graphics.HCENTER);
    }
}