File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Doubt using JButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Doubt using JButton" Watch "Doubt using JButton" New topic

Doubt using JButton

Harini Kaushik

Joined: Aug 08, 2008
Posts: 15
I have 3 buttons Each of which on clicking would give the label of corresponding button name and a Back Button which on clicking would go through all the label names of the buttons which are clicked previously each time it is clicked.
How to give the functionality for Back Button listener?

Appreciate any help!!
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
How about pushing the names onto a stack when the buttons are clicked, then popping them when the other button is pressed?
Harini Kaushik

Joined: Aug 08, 2008
Posts: 15
Actually I tried using ArrayList and it dint work out properly.
I could do that now with Stack.Thanks a lot Campbell.
I agree. Here's the link:
subject: Doubt using JButton
It's not a secret anymore!