Changing the displayed tabbed pane using a JButton

From: But I Haven't Eaten Any Sweetcorn! (paul.x.lee_at_baesystems.com)
Date: 02/23/04

  • Next message: Laird Nelson: "Re: Swing newbie, layout problems"
    Date: Mon, 23 Feb 2004 13:25:18 -0000
    
    

      Hi all,
      I'm trying to include a button on a tabbed page that will enable you to
    switch to
      another page.

      I'm using the following code:

      FlyProGen.addActionListener( new ActionListener()
      {
      public void actionPerformed( ActionEvent e )
      {

      tabbedpane.setSelectedComponent( container ); // container is the page I
    want to
      // display rather than the top level page.

      }
      } );

      However, I get the following error: "Cannot refer to a non-final variable
    tabbed pane inside
      an inner class defined in a different method".

      Help!

      best wishes

      Paul
      --
      http://www.paullee.com


  • Next message: Laird Nelson: "Re: Swing newbie, layout problems"