Link to home
Start Free TrialLog in
Avatar of chenwei
chenwei

asked on

question about JSplitPane event

my program looks as follow. if i move the divider, how can i catch the event?

public class MyTest extends JFrame {

  private javax.swing.JPanel jContentPane = null;

  private javax.swing.JSplitPane jSplitPane = null;
  public static void main(String[] args) {
      new MyTest().show();
  }

  public MyTest() {
    super();
    initialize();
  }

  private void initialize() {
    this.setContentPane(getJContentPane());
    this.setSize(500, 399);
    this.setContentPane(getJContentPane());
    this.setTitle("Test");
}

  private javax.swing.JPanel getJContentPane() {
    if (jContentPane == null) {
      jContentPane = new javax.swing.JPanel();
      jContentPane.setLayout(null);
      jContentPane.add(getJSplitPane(),null);
    }
    return jContentPane;
  }

  private javax.swing.JSplitPane getJSplitPane() {
    if(jSplitPane == null) {
    jSplitPane = new javax.swing.JSplitPane();
    jSplitPane.setBounds(6, 26, 410, 182);
    }
    return jSplitPane;
  }
}
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
What about the other Q?