30 creates a default vertical scroll bar creates a

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: he unitincrement (decrement) area of the scroll bar, as shown in Figure 13.30. Creates a default vertical scroll bar. Creates a scroll bar with the specified orientation. The get and set methods for these data fields are provided in the class, but omitted in the UML diagram for brevity. -minimum: int -visibleAmount: int -value: int -blockIncrement: int -unitIncrement: int +JScrollBar() +JScrollBar(orientation: int) +JScrollBar(orientation: int, value: Creates a scrollbar with the specified orientation, value, extent, int, extent: int, min: int, max: int) minimum, and maximum. EE3206/EE5805 Java Programming & Applications 34 Scroll Bar Properties Minimal value Block decrement Maximal value Block increment Bubble Unit decrement Unit increment EE3206/EE5805 Java Programming & Applications 35 Example: Using Scrollbars This example uses horizontal and vertical scrollbars to control a message displayed on a panel. The horizontal scrollbar is used to move the message to the left or the right, and the vertical scrollbar to move it up and down. ScrollBarDemo Run EE3206/EE5805 Java Programming & Applications 36 JSlider JSlider is similar to JScrollBar, but JSlider has more properties and can appear in many forms. javax.swing.JComponent javax.swing.JSlider -maximum: int -minimum: int -value: int -orientation: int -paintLabels: boolean -paintTicks: boolean -paintTrack: boolean -majorTickSpacing: int -minorTickSpacing: int -inverted: boolean +JSlider() +JSlider(min: int, max: int) +JSlider(min: int, max: int, value: int) +JSlider(orientation: int) +JSlider(orientation: int, min: int, max: int, value: int) The maximum value represented by the slider (default: 100). The minimum value represented by the slider (default: 0). The current value represented by the slider. The orientation of the slider (default: JSlider.HORIZONTAL). True if the labels are painted at tick marks (default: false). True if the ticks are painted on the slider (default: false). True if the track is painted on the slider (default: true). The number of units between major ticks (default: 0). The number of units between minor ticks (default: 0). True to reverse the value-range, and false to put the value range in the normal order (default: false). Creates a default horizontal slider. Creates a horizontal slider using the specified min and max. Creates a horizontal slider using the specified min, max, and value. Creates a slider with the specified orientation. Creates a slider with the specified orientation, min, max, and value. The get and set methods for these data fields...
View Full Document

This note was uploaded on 01/11/2011 for the course EE 3206 taught by Professor Cwting during the Spring '07 term at City University of Hong Kong.

Ask a homework question - tutors are online