Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SamplePopupScreen extends PopupScreen
- {
- BitmapField bitmapField[];
- Bitmap bitmap=Bitmap.getBitmapResource("box-s6A.png");
- public SamplePopupScreen()
- {
- super(new VerticalFieldManager(),PopupScreen.DEFAULT_CLOSE);
- createGUI();
- }
- private void createGUI()
- {
- bitmapField=new BitmapField[3];
- add(new LabelField("Popup Screen",Field.FIELD_HCENTER));
- for(int i=0;i<3;i++)
- {
- VerticalFieldManager vr=new VerticalFieldManager(Field.FIELD_HCENTER|VERTICAL_SCROLL|VERTICAL_SCROLLBAR);
- bitmapField[i]=new BitmapField(null,Field.FOCUSABLE|Field.FIELD_HCENTER)
- {
- protected void paint(Graphics g)
- {
- g.clear();
- g.drawText("LabelNunber", 0, 0);
- if(isFocus())
- {
- g.drawBitmap(0, 0, bitmap.getWidth(), bitmap.getHeight(), bitmap, 0, 0);
- g.drawText("LabelNunber",0,0);
- }
- }
- protected void layout(int width, int height)
- {
- super.layout(250, 50);
- setExtent(250, 50);
- }
- };
- bitmapField[i].setBackground(BackgroundFactory.createSolidBackground(Color.RED));
- vr.add(bitmapField[i]);
- add(vr);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement