Package javax.swing

Examples of javax.swing.JScrollBar


     *
     * @return javax.swing.JScrollBar
     */
    protected JScrollBar getDigitCountScroller() {
        if (digitCountScroller == null) {
            digitCountScroller = new JScrollBar();
            digitCountScroller.setBlockIncrement(1);
            digitCountScroller.setMinimumSize(new java.awt.Dimension(17, 0));
            digitCountScroller.setPreferredSize(new java.awt.Dimension(17, 5));
            digitCountScroller
                    .addAdjustmentListener(new java.awt.event.AdjustmentListener() {
View Full Code Here


  globalview = new GlobalView();


  // scrollbars, mostly used by maps
  globalXscrollbar = new JScrollBar(JScrollBar.HORIZONTAL, 0,1,0,1);
  globalYscrollbar = new JScrollBar(JScrollBar.VERTICAL,0,1,0,1);
  zoomXscrollbar = new JScrollBar(JScrollBar.HORIZONTAL, 0,1,0,1);
  zoomYscrollbar = new JScrollBar(JScrollBar.VERTICAL,0,1,0,1);



     zoomXmap = new MapContainer();
     zoomXmap.setDefaultScale(12.0);
View Full Code Here

    globalview = new GlobalView();
   
   
    // scrollbars, mostly used by maps
    globalXscrollbar = new JScrollBar(JScrollBar.HORIZONTAL, 0,1,0,1);
    globalYscrollbar = new JScrollBar(JScrollBar.VERTICAL,0,1,0,1);
    zoomXscrollbar = new JScrollBar(JScrollBar.HORIZONTAL, 0,1,0,1);
    zoomYscrollbar = new JScrollBar(JScrollBar.VERTICAL,0,1,0,1);



     zoomXmap = new MapContainer();
     zoomXmap.setDefaultScale(12.0);
View Full Code Here

        .append("The <b>red items</b> represent gaps in the timeline and the <b>green items</b> represent points in the timeline where more than one record show activity.<br/><br/>");
    chartDescription
        .append("You can <b>zoom in</b> by clicking and dragging the area that you want to examine in further detail.");

    if (groupNames.size() > GROUPS_VISIBLE) {
      final JScrollBar scroll = new JScrollBar(JScrollBar.VERTICAL);
      scroll.setMinimum(0);
      scroll.setMaximum(groupNames.size());
      scroll.addAdjustmentListener(new AdjustmentListener() {

        @Override
        public void adjustmentValueChanged(AdjustmentEvent e) {
          int value = e.getAdjustable().getValue();
          slidingDataset.setFirstCategoryIndex(value);
        }
      });

      chartPanel.addMouseWheelListener(new MouseWheelListener() {

        @Override
        public void mouseWheelMoved(MouseWheelEvent e) {
          int scrollType = e.getScrollType();
          if (scrollType == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
            int wheelRotation = e.getWheelRotation();
            scroll.setValue(scroll.getValue() + wheelRotation);
          }
        }
      });

      final DCPanel outerPanel = new DCPanel();
View Full Code Here

    d.height = headerSize.height + (_table.getRowHeight() * _table.getRowCount());

    Insets insets = getInsets();
    d.height = d.height + insets.top + insets.bottom;

    JScrollBar scrollBar = _scrollPane.getHorizontalScrollBar();
    int scrollbarHeight = scrollBar.getHeight();
   
    d.height = d.height + scrollbarHeight;

    return d;
  }
View Full Code Here

      @Override
      public void run() {
        _textArea.append(message);

        // moves the vertical scroll to the bottom
        JScrollBar verticalScrollBar = _textAreaScroll.getVerticalScrollBar();
        verticalScrollBar.setValue(verticalScrollBar.getMaximum());
      }
    });
  }
View Full Code Here

            }
            text.setText(text.getText().substring(index));
          }
        }

        JScrollBar bar = scroll.getVerticalScrollBar();
        if(bar != null) {
          int v = bar.getMaximum();
          bar.setValue(v*2);
        }
      }
    });
  }
View Full Code Here

      /*
       * Try to keep in the same position as before updating. This needs
       * to be pushed to the even queue, because otherwise the scroll
       * event triggered by changing the text would run after this.
       */
      final JScrollBar bar = indexScrollPane.getVerticalScrollBar();
      final int position = bar.getValue();
      indexArea.setText(text.toString());
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          int newValue = Math.min(position, bar.getMaximum());
          indexScrollPane.getVerticalScrollBar().setValue(newValue);
        }
      });
    }
View Full Code Here

    setLayout(new BorderLayout());
   
    scrollPane = new JScrollPane(textPane);
    scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
      public void adjustmentValueChanged(final AdjustmentEvent ev) {
        JScrollBar bar = (JScrollBar) ev.getAdjustable();
        // Try to avoid turning the new message indicator off
        // while the player keeps adjusting the scroll bar to
        // avoid missleading results
        if (!bar.getValueIsAdjusting() && (bar.getValue() + bar.getVisibleAmount() == bar.getMaximum())) {
            setUnreadLinesWarning(false);
            setAutoScrollEnabled(true);
        }
      }
    });
View Full Code Here

  /**
   * Scroll to the last line.
   */
  private void scrollToBottom() { 
    final JScrollBar vbar = scrollPane.getVerticalScrollBar();
    vbar.setValue(vbar.getMaximum());
  }
View Full Code Here

TOP

Related Classes of javax.swing.JScrollBar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.