0

I have a jtabbedpane and i'm trying to record when the tab is changed. i've tried using a change listener but it doesn't appear to be firing

        import javax.swing.event.ChangeListener;
        import javax.swing.event.ChangeEvent;

        tabbedPane.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                JTabbedPane sourceTabbedPane = (JTabbedPane) e.getSource();
                int index = sourceTabbedPane.getSelectedIndex();
                System.out.println("Tab changed to: " + index);
            }
        });

The code doesn't appear to be being called as the print isn't appearing

Ceri Turner
  • 830
  • 2
  • 12
  • 36

1 Answers1

0

Found the issue. There was a piece of code that was saving error messages to a file but it was also doing the same for normal output. Once that was changed the issue was resolved

Ceri Turner
  • 830
  • 2
  • 12
  • 36