0

I have 2 frames and in the first one, I press a button to go to the other and then I hide the frame with:

frame1.this.hide();    

How can I set that frame visible without creating a new one?

I know that I can make an instance to open a new frame1 from the frame2 but I want to "unhide" the first one when I press a button in the second JFrame.

Hope anybody know how to do this?

Mike Laren
  • 8,028
  • 17
  • 51
  • 70
  • 1
    1. `i want to "unhide" the first one when i press a button in the second JFrame.` - by creating Jframes Object as variable, 2. `I know that i can make an instance to open a new frame1 from the frame2 but` - you want to read Oracle tutorial - How to use CardLayout – mKorbel Jun 17 '15 at 13:27
  • 1
    See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) – Andrew Thompson Jun 17 '15 at 13:28
  • Thanks, that was very helpfull! – Cheko Perro Jun 18 '15 at 02:41

1 Answers1

0

what you have to do is when creating Frame 2 . you have to pass same reference of Frame 1 then inside frame 2 you can change the viability of Frame 1