Created
August 11, 2018 13:32
-
-
Save andreybutov/f04100aa512991d16ab7b6d8ff338a45 to your computer and use it in GitHub Desktop.
A custom bordered edit field for BlackBerry apps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Andrey Butov ( andreybutov.com ) | |
// | |
import net.rim.device.api.ui.component.EditField; | |
import net.rim.device.api.ui.Graphics; | |
class BorderedEditField extends EditField { | |
BorderedEditField() { | |
super(BorderedEditField.NO_NEWLINE); | |
} | |
BorderedEditField(long style) { | |
super(style|BorderedEditField.NO_NEWLINE); | |
} | |
BorderedEditField(String label, String initialValue) { | |
super(label, initialValue); | |
} | |
BorderedEditField(String label, String initialValue, int maxNumChars, long style) { | |
super(label, initialValue, maxNumChars, style|BorderedEditField.NO_NEWLINE); | |
} | |
public void paint(Graphics g) { | |
int oldColor = g.getColor(); | |
g.setColor(0×00000000); | |
g.drawRect(0, 0, getWidth() + 1, getHeight() + 1); | |
g.setColor(oldColor); | |
super.paint(g); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment