显示窗体:
JFrame.setVisible(true);
退出系统:
System.exit(0);
全屏显示:
this.setExtendedState(JFrame.MAXIMIZED_BOTH); //最大化
this.setAlwaysOnTop(true); //总在最前面
this.setResizable(false); //不能改变大小
this.setUndecorated(true); //不要边框
GraphicsDevice myDevice = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice(); //不显示任务栏
myDevice.setFullScreenWindow(this);
全屏显示(更好的方法)
CashierFrame cf = new CashierFrame(true);
cf.dispose();
cf.setUndecorated(true);
cf.setVisible(true);
//使table在添加完记录后,滚动天保持在底部
//得到行数
int rowCount = tab_1.getRowCount();
tab_1.getSelectionModel().setSelectionInterval(rowCount-1, rowCount-1);
Rectangle rect = tab_1.getCellRect(rowCount-1, 0, true);
tab_1.scrollRectToVisible(rect);