This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mutiple frames + one class = annoying listener problem

 
Ann Jemmens
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an intro pane that pops up - user clicks one of two buttons; either one pops up 2nd GUI. 2nd GUI has text fields, combobox, etc. Code must be in one class, one file. I initially did this by creating two seperate classes to initialize two separate GUI statments in one file and implementing polling in main for first window for button click, listeners associated with 2nd window items. Reset 'switch' statement in listener so I can implement 2nd window (ie very manually). Have been instructed this is very poor design - even just a word or two of where to look would be appreciated. Trying cardLayout tomorrow to see if this is the cure but - is there a better way?
Thanks
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aggabagga,

Welcome to Javaranch! We don't have too many rules around here but we do have a Naming Policy. Please read and adjust your display name to comform. You can change your display name here.

Thanks.
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by aggabagga:
I have an intro pane that pops up - user clicks one of two buttons; either one pops up 2nd GUI. 2nd GUI has text fields, combobox, etc. Code must be in one class, one file. I initially did this by creating two seperate classes to initialize two separate GUI statments in one file and implementing polling in main for first window for button click, listeners associated with 2nd window items. Reset 'switch' statement in listener so I can implement 2nd window (ie very manually).


I'm afraid I don't undestand that. Some questions :

Why must your code be in one class, one file ?
How do you implement polling ? That doesn't sound right.

D.
 
Ann Jemmens
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright - I have my name displayed correctly now - my apologies...
Guess I don't have to do it this way anyway. The instructor made a TYPO and left out a class on the assignment. Awesome.

Thanks for the halp.
Ann formerly known as aggabagga
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic