Ex: I have window1 (components added to panel1 and panel1 added to frame1) with fields for login id and pwd and a login-button. After I enter data and click the button I want to see window2 (components added to panel2 and panel2 added to frame2) which shows some other information. To get this behavior, till now I used to create a new window2() in action handling part of code for login-button. So I am creating a new frame for every window in the application. A friend said that for security reasons its not the proper way to do. And that you usually should only have one frame for the entire app. And only change the panel you add to the frame depending on what you want to display. Is that true? I believe her but want to hear more from ranchers!
I added this post to Java in General (beginner) but somewhow it showed up in Swing forum also !! [ June 09, 2008: Message edited by: Preeti Yarla ]
That you usually should only have one frame for the entire app and only change the panels you add to the frame depending on what you want to display
Well, I asked the wrong question. Sorry. What I meant was, why is that the right way? Did she actually tell you the security implications of your initial approach? Because I don't see any issues. Now, what I might do is open a JFrame and initially prompt the user for a login using a modal JDialog. That differs slightly than your original design but not much. What are the security issues exactly?
Joined: Sep 08, 2007
I am waiting to hear the 'why' part of that from her and posted this in the mean time.
Say I want to go to window3 from window2. What is the right way to do that. Put that window3 in a new frame?
[ June 09, 2008: Message edited by: Preeti Yarla ] [ December 19, 2008: Message edited by: Preeti Yarla ]