I have 3 frames: jframe1, jframe2 and jframe3. JFrame1 and jframe2 both are linked to jframe3 through a NEXT button.When I click NEXT jframe3 becomes visible and When I click BACK button in jframe3 it should return back to the previous frame which called it. So, How can i go back to the correct jframe(1 or 2) depending on which called jframe3?
Asked
Active
Viewed 35 times
0
-
2Store informations about the previous frame inside `jframe3` – BackSlash Feb 19 '18 at 13:56
-
Or use JInternalFrames – Marcos Vasconcelos Feb 19 '18 at 17:40
-
You should not be using multiple JFrames in an application. Typically you have a single JFrame and then you use a JDialog for addition windows. Without understanding the context of what you are doing we can't suggest the best solution. – camickr Feb 19 '18 at 19:05
-
1) See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) 2) Use a [`CardLayout`](http://download.oracle.com/javase/8/docs/api/java/awt/CardLayout.html) as shown in [this answer](http://stackoverflow.com/a/5786005/418556). – Andrew Thompson Feb 20 '18 at 02:08