SWT Tips and Samples 基礎編 > Button |
|
ButtonSWTのボタンは、コンストラクタにスタイル情報を与えることで、通常ボタン、ラジオボタン、トグルボタンを作ることができます。 スクリーンショットソースコード (ButtonTest.java)import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class ButtonTest { public static void main(String[] args) { new ButtonTest(); } public ButtonTest() { Display display = new Display(); Shell shell = new Shell(display); shell.setText("ShellTest"); shell.setSize(300, 50); shell.setLayout(new FillLayout()); Button b1 = new Button(shell, SWT.PUSH); b1.setText("Button PUSH"); Button b2 = new Button(shell, SWT.RADIO); b2.setText("Button RADIO"); Button b3 = new Button(shell, SWT.TOGGLE); b3.setText("Button TOGGLE"); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } } 参考コンストラクタ引数としてスタイルを組み合わせることでいろいろな形状のボタンを生成することが可能です。最新更新日: 2004年10月20日 |
- PR -
【Sony】大手他社よりも安い!ビジネス向け光・100Mしかも固定IP付!今なら更に初期費用最大15,000円OFF!
オフィス用品・オフィス家具 価 格 交 渉 可!
|
||||
|
|||||
Copyright(C) 2003,2004 Jasmin Project. All Right Reserved. |
SEO | [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送 | ||