?? optionpanel.java
字號(hào):
package Darts;
import com.nttdocomo.ui.*;
/* Darts Option. */
/* 偙偺傾僾儕偺愝掕僷僱儖 */
public class OptionPanel extends Panel
implements SoftKeyListener {
private Darts parent = null;
private static final String selectPlayer[] = { "1", "2", "3", "4" };
private static final String selectZeroOne[] = { "301", "501", "701",
"901", "1301", "1501" };
private static final int zeroOneRound[] = { 10, 15, 20, 20, 20, 20 };
private Label title = new Label( "- Option -" );
private Label playerTitle = new Label( "Player Select" );
private Label zeroOneTitle = new Label( "01 Select" );
private ListBox playerCnt = new ListBox( ListBox.CHOICE );
private ListBox zeroOneNum = new ListBox( ListBox.CHOICE );
public OptionPanel(Darts _parent) {
this.parent = _parent;
setSoftLabel( Frame.SOFT_KEY_2, "Exit" );
/* 儗僀傾僂僩儅僱乕僕儍偺愝掕 */
HTMLLayout lm = new HTMLLayout();
setLayoutManager(lm);
/* 僷僱儖偺攚宨怓傪愝掕 */
setBackground(Color.BLACK);
/* 儔儀儖偺愝掕 */
title.setForeground ( Color.RED );
title.setBackground ( Color.BLACK );
playerTitle.setForeground ( Color.RED );
playerTitle.setBackground ( Color.BLACK );
zeroOneTitle.setForeground( Color.RED );
zeroOneTitle.setBackground( Color.BLACK );
/* 儕僗僩偺愝掕 */
playerCnt.setItems ( selectPlayer );
zeroOneNum.setItems( selectZeroOne );
playerCnt.select ( 1 );
zeroOneNum.select ( 1 );
/* 奺儃僞儞偺愝掕 */
playerCnt.setSize ( getWidth() / 5, getHeight() / 10 );
zeroOneNum.setSize( getWidth() / 5, getHeight() / 10 );
playerCnt.setBackground ( Color.SILVER );
zeroOneNum.setBackground( Color.SILVER );
playerCnt.setForeground ( Color.BLACK );
zeroOneNum.setForeground( Color.BLACK );
/* 奺儃僞儞偺攝抲 */
lm.begin( HTMLLayout.CENTER );
add( title );
lm.br();
lm.br();
add( playerTitle );
lm.br();
add( playerCnt );
lm.br();
lm.br();
add( zeroOneTitle );
lm.br();
add( zeroOneNum );
lm.end();
/* 僜僼僩僉乕儕僗僫乕偲偟偰搊榐 */
setSoftKeyListener( this );
}
public int getPlayerCnt() {
return Integer.parseInt( selectPlayer[playerCnt.getSelectedIndex()] );
}
public int getZeroOneNum() {
return Integer.parseInt( selectZeroOne[zeroOneNum.getSelectedIndex()] );
}
public int getZeroOneRound() {
return zeroOneRound[zeroOneNum.getSelectedIndex()];
}
public void softKeyPressed (int _key) {
if ( _key == Frame.SOFT_KEY_2 ) {
parent.showTitlePanel();
}
}
/* not used */
public void softKeyReleased (int _key) {}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -