代码优化

This commit is contained in:
newpanjing
2017-03-15 09:56:24 +08:00
committed by panjing
parent cb45fe9548
commit 284ac1f5e9
3 changed files with 282 additions and 262 deletions
@@ -7,23 +7,28 @@ import java.awt.event.WindowEvent;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
/**
* 父类
*/
public class BaseForm extends JFrame {
private static final long serialVersionUID = -8446051052250946428L;
private static final long serialVersionUID = -8446051052250946428L;
public BaseForm() {
getContentPane().setLayout(null);
getContentPane().setBackground(new Color(248, 251, 253));
this.addWindowListener(new WindowAdapter() {
public BaseForm() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
super.windowClosing(e);
}
});
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/logo.png"));
getContentPane().setLayout(null);
getContentPane().setBackground(new Color(248, 251, 253));
this.addWindowListener(new WindowAdapter() {
this.setIconImage(imageIcon.getImage());
}
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
super.windowClosing(e);
}
});
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/logo.png"));
this.setIconImage(imageIcon.getImage());
}
}