1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
private MaFrame(){
super("Prpg");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(800,600);
}
public void init(){
[...]
addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
resizeFrame();
}
});
int width = getSize().width;
int height = getSize().height;
[...]
TonPanel1.setSize(width,height);
}
public void resizeFrame() {
int _newWidth = getSize().width;
int _newHeight = getSize().height;
TonPanel1.setSize(_newWidth,_newHeight);
} |