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
viet 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);
}
}
[img]http://www.**********************/attachments/9930-png.3154/[/img]
hình 1: minh họa pop-up screen
View more random threads:
Thông qua phân tách dữ liệu Google từ 86 nhà nước, mới đây, một công ty tại Anh đã ban bố bảng xếp hạng kích tấc "cậu nhỏ" của các nước trên thế giới. Kết quả, hầu hết các nước xếp ở nhóm đầu của...
Dương vật của bạn trai Việt thuộc nhóm nhỏ nhất hành tinh?