转自: http://doll.iteye.com/blog/588502
- import net.rim.device.api.ui.Color;
- import net.rim.device.api.ui.Graphics;
- import net.rim.device.api.ui.Manager;
- import net.rim.device.api.ui.container.FlowFieldManager;
- import net.rim.device.api.ui.container.PopupScreen;
- public class PopupView extends PopupScreen {
- public PopupView() {
- super(new FlowFieldManager(Manager.FIELD_HCENTER));
- }
- protected void paint(Graphics g) {
- g.setColor(Color.RED);
- g.drawText("Just do it", 0, 0);
- }
- public void _drawAlpha(int _x, int _y, int _width, int _height, int _color,
- Graphics g) {
- int _array[] = new int[_width * _height];
- for (int i = 0; i < _array.length; i++) {
- _array[i] = _color;
- }
- g.drawARGB(_array, 0, _width, _x, _y, _width, _height);
- }
- protected void paintBackground(Graphics graphics) {
- // super.paintBackground(graphics);
- _drawAlpha(0, 0, this.getWidth(), this.getHeight(), 0X66223311,
- graphics);
- }
- protected void sublayout(int width, int height) {
- // super.sublayout(width, height);
- this.setPosition(0, 12);
- this.setExtent(130, 30);
- }
- }