📄 radiobuttonexample.java
字号:
package org.j4me.examples.ui.components;
import org.j4me.logging.*;
import org.j4me.ui.*;
import org.j4me.ui.components.*;
/**
* Example of a <code>RadioButton</code> component.
*/
public class RadioButtonExample
extends Dialog
{
/**
* The previous screen.
*/
private DeviceScreen previous;
/**
* The radio button.
*/
private RadioButton button;
/**
* Constructs a screen that shows a <code>RadioButton</code> component in action.
*
* @param previous is the screen to return to once this done.
*/
public RadioButtonExample (DeviceScreen previous)
{
this.previous = previous;
// Set the title and menu.
setTitle( "RadioButton Example" );
setMenuText( "Back", null );
// Add the phone number box.
button = new RadioButton();
button.setLabel( "Log Levels" );
button.append( Level.DEBUG.toString() );
button.append( Level.INFO.toString() );
button.append( Level.WARN.toString() );
button.append( Level.ERROR.toString() );
button.append( Level.OFF.toString() );
button.setSelectedIndex( 1 ); // INFO
append( button );
}
/**
* Takes the user to the previous screen.
*/
protected void declineNotify ()
{
previous.show();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -