Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting two GUI windows

 
Preeti Yarla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How should I connect two GUI windows?

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!


Thanks!

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 ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did she tell you what the right way is?
 
Preeti Yarla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.

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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Preeti Yarla:
Yes.

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?
 
Preeti Yarla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic