Bordered Edit Field for RIM BlackBerry UI

Someone asked for this via e-mail earlier this week. I thought I’d post it so other BlackBerry developers can use it.

Here’s a stripped-down version of a custom bordered edit field that we use in several of our BlackBerry products.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
    }
}

Cheers!

MacDowell

Listened to Mike Daisey and Tara Geer describe the MacDowell Colony this morning on Studio 360

What a delightful experience it must be — to be able to work in complete silence and solitude during the day, surrounded by nothing but the sounds and sights of a forest, and then to be able to spend your evenings with other artists.

Keep wondering the whole day why there isn’t a small tech business community off in a secluded place somewhere — away from everything — just to work in complete tranquility for a month.

Maybe there is and I just don’t know about it.

I hear Bill Gates goes off on solitary reading/thinking retreats twice a year.

And no, those cesspool community startup hubs are not the same thing.