/**
* 居中Frame
* @param frame
*/
public static void centerFrame(JFrame frame) {
int width = 800;
int height = 600;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
frame.setBounds(x, y, width, height);
}
/**
* 获取当前屏幕
* @return Dimension
*/
public static Dimension getCurrentScreen(){
return Toolkit.getDefaultToolkit().getScreenSize();
}
/**
* 处理老程序中不符合页面缩放的组件
* @param component 要处理的组件
*/
public static void dealUncomfortPanel(JComponent component) {
Dimension dim = SIUIUtil.getCurrentScreen();
component.setPreferredSize(new Dimension(dim.width,dim.height - 150));
}
* 居中Frame
* @param frame
*/
public static void centerFrame(JFrame frame) {
int width = 800;
int height = 600;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
frame.setBounds(x, y, width, height);
}
/**
* 获取当前屏幕
* @return Dimension
*/
public static Dimension getCurrentScreen(){
return Toolkit.getDefaultToolkit().getScreenSize();
}
/**
* 处理老程序中不符合页面缩放的组件
* @param component 要处理的组件
*/
public static void dealUncomfortPanel(JComponent component) {
Dimension dim = SIUIUtil.getCurrentScreen();
component.setPreferredSize(new Dimension(dim.width,dim.height - 150));
}