Pop-up Screen cho phép pop up 1 cửa sổ thông tin đơn giản ngắn gọn như About, Info... Mã: /* * AboutScreen.java * * © Viet Hop Software, 2012 * Confidential and proprietary. * * Developer: Aric * Email: sd@viethop.net */ import net.rim.device.api.system.Characters; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.component.SeparatorField; import net.rim.device.api.ui.container.PopupScreen; import net.rim.device.api.ui.container.VerticalFieldManager; import net.rim.device.api.system.ApplicationDescriptor; /** * PopupScreen that displays information about the application */ final class AboutScreen extends PopupScreen { /** * Constructor. */ AboutScreen() { super(new VerticalFieldManager()); super(new HorizontalFieldManager(NO_VERTICAL_SCROLL)); ApplicationDescriptor appDesc = ApplicationDescriptor.currentApplicationDescriptor(); BitmapField bitmap = new BitmapField(appDesc.getIcon(), FIELD_VCENTER); bitmap.setMargin(5, 5, 5, 5); add(bitmap); VerticalFieldManager vfm = new VerticalFieldManager(); vfm.add(new LabelField(appDesc.getName() + " - Ver. " + appDesc.getVersion())); vfm.add(new SeparatorField()); vfm.add(new LabelField("sd@viethop.net\nViet Hop Software © 2012")); } /** * Overrides the default. Closes the popup screen when the Escape key is pressed. * * @see net.rim.device.api.ui.Screen#keyChar(char,int,int) */ public boolean keyChar(char c, int status, int time) { if (c == Characters.ESCAPE) // Đóng cửa sổ khi người dùng nhấn Escape. { close(); return true; } return super.keyChar(c, status, time); } } Hình 1: Minh họa Pop-up Screen