?? studentviewframe.java
字號:
package com.studentmanage;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class StudentViewFrame
{
protected Shell shell;
/**
* Launch the application
* @param args
*/
public static void main(String[] args)
{
try
{
//new MessageBox(new Shell(),"對話框標題","對話框顯示內容!").open();
LoginDialog login=new LoginDialog(new Shell());
login.open();
if(login.getIsLogin())
{
//根據登陸類型,打開不同窗口
StudentViewFrame window = new StudentViewFrame();
window.open();
}
} catch (Exception e)
{
e.printStackTrace();
}
}
/**
* Open the window
*/
public void open()
{
final Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
}
/**
* Create contents of the window
*/
protected void createContents()
{
shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");
//
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -