studentviewframe.java
来自「简单的JAVA程序,给大家稍微看看 还没有连数据库」· Java 代码 · 共 62 行
JAVA
62 行
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 + =
减小字号Ctrl + -
显示快捷键?