This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Action Listeners in Card Layout.

 
Nathaniel Waggoner
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Can you please UseCodeTags? You can edit your post to add them.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic