• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Action Listeners in Card Layout.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

Im working with a multi page GUI. Each page has numerous text entry fields (3-5) for specific pieces of data. Each page also has a number of buttons (confirm, reset, go back etc...).

The program is structured so that the button you click directs you to a specific and unique page. This goes for up to four pages before returning to the title page.

I am using the card layout currently, though I am not tied to it. My question is this:

What is the best way to detect actions within the currently viewed page so that i can direct people to the correct next page? I have the cardLayout aspect working just fine - ie all pages are in the card layout, and viewable if hardCoded to do so, but I'm not sure how to track events in this circumstance. I have seen this code on other forums (Credited to Fubarable on Java Forums):


Code:


The last line is the lline I am interested in, and I am going to play with that a bit and see if I cant apply it to what I am doing. My main problem is that it is "new FirsPanel(firstPanelActionListener)" - does this add both a new instance of FirstPanel and its assoiciate action listener? Curious if anyone else has suggestions?

Thanks,

Nathan.


 
Nathaniel Waggoner
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok sorry for the double post: here is my cardLayout code;::



You may notice that two of the pages follow a different naming convention. I had partners in this project - basically they turned into flakes. In a mighty fit of lazieness im trying to not redo those two pages, because i dont wanna.

How best to handle this??

Thanks guys.

Nathan
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Can you please UseCodeTags? You can edit your post to add them.
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote: . . . Can you please UseCodeTags? . . .

I added the tags to the second post, and we can see how much better it looked, but I left the first post because it lacked indentation.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I earlier wrote: . . . I left the first post because it lacked indentation.

The first post seems to be indented now, so I added code tags.
 
reply
    Bookmark Topic Watch Topic
  • New Topic