I want when pressed a Button on my Jframe to setVisible false the existing Frame and create two other Frames.The theme is I want these two Frames to be popped side by side not the one on top of the other, any clue how I can make this happen.
Asked
Active
Viewed 873 times
0
-
3First I would check it [multiple frames, good/bad practice](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice) – MadProgrammer Aug 26 '13 at 08:26
-
Good to know, it made me rethink my project, but also for the means of curiosity is there any way of doing that – Phil_Charly Aug 26 '13 at 08:32
-
Which part are you having trouble with? Buttons, Atkins or frames? – MadProgrammer Aug 26 '13 at 08:35
-
Thx for your interest I am ok I figured it out all – Phil_Charly Aug 26 '13 at 08:44
1 Answers
3
jframe1.setBounds(x, y, width, height);
jframe2.setBounds(x+jframe1.getWidth(), y, width2, height2);
width and width2 can be the same if you want, so can height an height2

Ron
- 1,450
- 15
- 27
-
Set location maybe, but setting the size is [*not* good practice](http://stackoverflow.com/questions/7229226/should-i-avoid-the-use-of-setpreferredmaximumminimumsize-methods-in-java-swi). Instead pack the respective top level components and then get the width/height to decide where to locate each window. – Andrew Thompson Aug 26 '13 at 09:16
-
Thanks, I incorporated what I could from your answer without going off topic. – Ron Sep 30 '13 at 07:44