?? aboutdlg.java
字號:
package net.csksoft.TigerBox;import org.eclipse.swt.events.SelectionEvent;import org.eclipse.swt.events.SelectionListener;import org.eclipse.swt.widgets.Button;import org.eclipse.swt.widgets.Canvas;import org.eclipse.swt.widgets.Display;import org.eclipse.swt.widgets.Label;import org.eclipse.swt.widgets.Shell;import org.eclipse.swt.SWT;import com.cloudgarden.resource.SWTResourceManager;/*** This code was edited or generated using CloudGarden's Jigloo* SWT/Swing GUI Builder, which is free for non-commercial* use. If Jigloo is being used commercially (ie, by a corporation,* company or business for any purpose whatever) then you* should purchase a license for each developer using Jigloo.* Please visit www.cloudgarden.com for details.* Use of Jigloo implies acceptance of these licensing terms.* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.*/public class AboutDlg extends org.eclipse.swt.widgets.Dialog { private Shell dialogShell; private Button ok; private Label Version; private Label copyright; private Canvas BkImg; /** * Auto-generated main method to display this * org.eclipse.swt.widgets.Dialog inside a new Shell. */ public static void main(String[] args) { try { Display display = Display.getDefault(); Shell shell = new Shell(display); AboutDlg inst = new AboutDlg(shell, SWT.NULL); inst.open(); } catch (Exception e) { e.printStackTrace(); } } public AboutDlg(Shell parent, int style) { super(parent, style); } public void open() { try { Shell parent = getParent(); dialogShell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); { //Register as a resource user - SWTResourceManager will //handle the obtaining and disposing of resources // SWTResourceManager.registerResourceUser(dialogShell); } dialogShell.setLayout(null); dialogShell.layout(); dialogShell.pack(); dialogShell.setSize(337, 314); dialogShell.setLocation((Display.getCurrent().getBounds().width - dialogShell.getSize().x)/2,(Display.getCurrent().getBounds().height - dialogShell.getSize().y)/2); dialogShell.setText("About Tiger Box"); { ok = new Button(dialogShell, SWT.PUSH | SWT.CENTER); ok.setText("OK"); ok.setBounds(259, 245, 63, 28); ok.addSelectionListener(new SelectionListener( ) { public void widgetSelected(SelectionEvent event) { dialogShell.dispose(); } public void widgetDefaultSelected(SelectionEvent event) { } } ); } { BkImg = new Canvas(dialogShell, SWT.NONE); BkImg.setBounds(0, 0, 329, 238); BkImg.setBackgroundImage(SWTResourceManager.getImage("res/img/logo.jpg")); } { copyright = new Label(dialogShell, SWT.NONE); copyright.setText("Copyright 2004-2007 CSKSOFT"); copyright.setBounds(7, 259, 203, 14); } { Version = new Label(dialogShell, SWT.NONE); Version.setText("Version : 0.2"); Version.setBounds(7, 245, 119, 14); } dialogShell.open(); Display display = dialogShell.getDisplay(); while (!dialogShell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } catch (Exception e) { e.printStackTrace(); } } }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -