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