Results 1 to 2 of 2
  1. #1
    Ermm is offline Member
    Join Date
    Dec 2011
    Rep Power

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default 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.

Similar Threads

  1. Replies: 4
    Last Post: 04-19-2011, 05:09 AM
  2. Replies: 2
    Last Post: 12-19-2010, 02:24 PM
  3. Using Jscrollpane to move images on jpanel
    By Lazairus in forum New To Java
    Replies: 0
    Last Post: 12-06-2010, 02:46 PM
  4. Move Jpanel to center
    By tpyq in forum NetBeans
    Replies: 1
    Last Post: 12-15-2008, 10:11 AM
  5. Replies: 2
    Last Post: 12-01-2007, 07:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts