0

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.

Phil_Charly
  • 137
  • 13

1 Answers1

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