Results 1 to 2 of 2
- 12-13-2011, 01:04 AM #1Member
- Join Date
- Dec 2011
- Rep Power
Using an ActionListener To move from One JPanel in a JtabbedPane to another JPanel...
in the same JTabbedPane.
Okay so i'm fairly new to java programming and i can't quite figure out how to use an actionlistener on a JButton in one JPanel to move to another JPanel, both in the same JTabbedPane. I can't quite figure it out sadly. I have tried
public void actionPerformed(ActionEvent e)
if(e.getSource() == Button1)
but that doesn't quite work (and by quite i mean it doesn't). I have already created the panel as a global variable. So please if anyone has any suggestions, please do help.
Re: Using an ActionListener To move from One JPanel in a JtabbedPane to another JPane
If you want to change tabbed views, you'll need to call either setSelectedIndex(...) or setSelectedComponent(...) on the JTabbedPane. The API can help you here.
- By kpwane in forum AWT / SwingReplies: 4Last Post: 04-19-2011, 06:09 AM
- By Skye in forum AWT / SwingReplies: 2Last Post: 12-19-2010, 03:24 PM
- By Lazairus in forum New To JavaReplies: 0Last Post: 12-06-2010, 03:46 PM
- By tpyq in forum NetBeansReplies: 1Last Post: 12-15-2008, 11:11 AM
- By adlb1300 in forum New To JavaReplies: 2Last Post: 12-01-2007, 08:48 AM