本文整理汇总了Java中javax.microedition.lcdui.Display.getDisplay方法的典型用法代码示例。如果您正苦于以下问题:Java Display.getDisplay方法的具体用法?Java Display.getDisplay怎么用?Java Display.getDisplay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.microedition.lcdui.Display
的用法示例。
在下文中一共展示了Display.getDisplay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDisplayEventHandler
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
/**
* Return a reference to the singleton display manager object.
*
* @param token security token with the MIDP permission "allowed"
*
* @return display manager reference.
*/
public static DisplayEventHandler
getDisplayEventHandler(SecurityToken token) {
token.checkIfPermissionAllowed(Permissions.MIDP);
if (managerImpl != null) {
return managerImpl;
}
/**
* The display manager implementation is a private class of Display
* and is create in the class init of Display, we need to call a
* static method of display to get the class init to run, because
* some classes need to get the display manager to create a display
*/
try {
// this will yield a null pointer exception on purpose
Display.getDisplay(null);
} catch (NullPointerException npe) {
// this is normal for this case, do nothing
}
return managerImpl;
}
示例2: runBenchmark
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
void runBenchmark() {
Display display = Display.getDisplay(this);
BouncyColors bouncyColors = new BouncyColors();
display.setCurrent(bouncyColors);
for (int i = 0; i < 16; i++) {
Thread thread = new Thread(new Worker(), "T" + i);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}
Thread current = Thread.currentThread();
current.setPriority(Thread.MAX_PRIORITY);
while (true) {
bouncyColors.repaint();
try {
Thread.sleep(16);
} catch (InterruptedException e) {}
}
}
示例3: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
public void startApp() {
Display display = Display.getDisplay(this);
BouncyColors bouncyColors = new BouncyColors();
display.setCurrent(bouncyColors);
for (int i = 0; i < 16; i++) {
Thread thread = new Thread(new Worker(), "T" + i);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}
Thread current = Thread.currentThread();
current.setPriority(Thread.MAX_PRIORITY);
while (true) {
bouncyColors.repaint();
try {
Thread.sleep(16);
} catch (InterruptedException e) {}
}
}
示例4: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
protected void startApp() throws MIDletStateChangeException
{
DeviceControl.setLights( 0, 100 );
Display disp = Display.getDisplay( this );
try
{
iCanvas = new PanoramaCanvas( Image.createImage(PHOTO_NAME), this );
disp.setCurrent( iCanvas );
iConnection = openAccelerationSensor();
if (iConnection != null)
iConnection.setDataListener( this, BUFFER_SIZE );
}
catch (IOException e)
{
e.printStackTrace();
}
}
示例5: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
display=Display.getDisplay(this);
list.append("����Ϸ", null);
list.append("�������", null);
list.append("��Ϸ˵��", null);
list.addCommand(cmd_ok);
list.addCommand(cmd_back);
list.setCommandListener(this);
display.setCurrent(list);
predisplay=display.getCurrent(); //��ʼ��ǰһ����ʾ
form=new Form("");
form.addCommand(cmd_back);
form.addCommand(cmd_ok);
}
示例6: BlogWriter
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
public BlogWriter() {
this.display = Display.getDisplay(this);
// Crate login screen
this.loginScreen = new LoginScreen(this.display);
this.loginScreen.setParent(this);
// Activate login screen
this.display.setCurrent(this.loginScreen);
}
示例7: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
public void startApp() {
if (display != null) {
return;
}
self = this;
display = Display.getDisplay(this);
showLinksView(session.getCategory());
}
示例8: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
this.recordButton = new StringItem(null, "Start", Item.BUTTON);
Command toggleRecordingCMD = new Command("Click", Command.ITEM, 1);
this.recordButton.addCommand(toggleRecordingCMD);
this.recordButton.setDefaultCommand(toggleRecordingCMD);
this.recordButton.setItemCommandListener(this);
this.form = new Form(null, new Item[] {
new StringItem(null, "Audio Recorder"), this.recordButton });
this.display = Display.getDisplay(this);
this.display.setCurrent(this.form);
}
示例9: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
/**
* Mirror MIDlet.startApp(), should be called by your MIDlet startApp().
*/
public void startApp() {
display = Display.getDisplay(host);
remotedeviceui = new RemoteDeviceUI();
remotedeviceui.showui();
}
示例10: MainMidlet
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
public MainMidlet() {
display = Display.getDisplay(this);
notesList = new NotesList(this);
}
示例11: Midlet
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
public Midlet(){
display = Display.getDisplay(this);
midlet = this;
}
示例12: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
protected final void startApp() {
midlet = this;
display = Display.getDisplay(this);
display.setCurrent(new PaintCanvas(listener, isLandscape));
}
示例13: startApp
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
protected final void startApp() {
display = Display.getDisplay(this);
display.setCurrent(form);
listener.onStartApp(this);
}
示例14: initialize
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
/** Separate initialization function for convenience. */
public void initialize() {
display = Display.getDisplay(mainApp);
myCanvas = new GAFAView(this, display);
display.setCurrent(myCanvas);
}
示例15: GAFAMidlet
import javax.microedition.lcdui.Display; //导入方法依赖的package包/类
/** Creates the midlet and initiates the display. */
public GAFAMidlet() {
display = Display.getDisplay(this);
}