📄 propertytest.java
字号:
//PropertyTest.java
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class PropertyTest extends MIDlet implements CommandListener
{
private Command exitCommand;
private Display display;
public PropertyTest()
{
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.SCREEN, 2);
}
public void startApp()
{
TextBox t = new TextBox("Properties", "", 256, 0);
t.addCommand(exitCommand);
t.setCommandListener(this);
t.setString( getSomeProperties() );
display.setCurrent(t);
}
public void pauseApp()
{ }
public void destroyApp(boolean unconditional)
{ }
public void commandAction(Command c, Displayable s)
{
if (c == exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
public String getSomeProperties()
{
String [] names = {
"MIDlet-Vendor",
"MIDlet-Name",
"MIDlet-Version",
"MicroEdition-Profile",
"MicroEdition-Configuration",
};
String s = "";
for( int i=0; i<names.length; i++ )
s += names[i] + " = \n " + getAppProperty( names[i] )+"\n";
names = new String[]{
//"microedition.profile",
//"microedition.configuration",
//"microedition.platform",
"microedition.locale",
"microedition.encoding",
};
for( int i=0; i<names.length; i++ )
s += names[i] + " = \n " + System.getProperty( names[i] )+"\n";
return s;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -