• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Mutiple frames + one class = annoying listener problem

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
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
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.
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic