• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Connecting two GUI windows

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic