Ejemplo n.º 1
0
  //
  //  Implement the ChangeListener
  //
  public void stateChanged(ChangeEvent e) {
    //  Keep the scrolling of the row table in sync with main table

    JViewport viewport = (JViewport) e.getSource();
    JScrollPane scrollPane = (JScrollPane) viewport.getParent();
    scrollPane.getVerticalScrollBar().setValue(viewport.getViewPosition().y);
  }
Ejemplo n.º 2
0
  public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider) e.getSource();

    if (source == unitXSlider) {
      ux = source.getValue();
      graph.setUnityX(ux);
    } else {
      uy = source.getValue();
      graph.setUnityY(uy);
    }
  }