|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JSlider | +--com.sssw.rt.jform.AgcJSlider
A lightweight component that lets the user graphically select a value by sliding a knob within a bounded interval. The slider can show major tick marks, minor tick marks, and tick labels.
AgcJSlider uses the model DefaultBoundedRangeModel, which holds the
minimum, maximum, and current values.
However, you don't have to interact directly with the model; methods
inherited from
the JSlider
class let you
set values in the
model.
There are also inherited methods for specifying:
This code changes the minimum value of the slider.
slider.setMinimum( -100 );
This code creates a new model, sets values, and assigns it to a slider control.
DefaultBoundedRangeModel m = new DefaultBoundedRangeModel(); m.setMinimum( fldMin.getValue() ); m.setMaximum( fldMax.getValue() ); slider.setModel( m );
This code changes tick marks and labels.
// Calculate increment for 10 labels int increment = ( slider.getMaximum() - slider.getMinimum() ) / 10 ; // Display 10 tick marks and label the marks slider.setMajorTickSpacing(increment); Hashtable hshLabels = slider.createStandardLabels(increment); slider.setLabelTable(hshLabels);
Inner classes inherited from class javax.swing.JSlider |
JSlider.AccessibleJSlider |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Fields inherited from class javax.swing.JSlider |
changeEvent,
changeListener,
majorTickSpacing,
minorTickSpacing,
orientation,
sliderModel,
snapToTicks |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
AgcJSlider()
Creates a horizontal slider with the range 0 to 100 and an initial value of 50. |
|
AgcJSlider(BoundedRangeModel brm)
Creates a horizontal slider using the specified BoundedRangeModel. |
|
AgcJSlider(int orientation)
Creates a slider using the specified orientation with the range 0 to 100 and an initial value of 50. |
|
AgcJSlider(int min,
int max)
Creates a horizontal slider with the specified range. |
|
AgcJSlider(int min,
int max,
int value)
Creates a horizontal slider with the specified range and initial value. |
|
AgcJSlider(int orientation,
int min,
int max,
int value)
Creates a slider with the specified orientation, range, and initial value. |
Method Summary | |
Integer |
getIntegerValue()
Gets the slider value as an Integer object. |
void |
setIntegerValue(Integer value)
Sets the slider value with an Integer object. |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Methods implemented from interface com.sssw.rt.form.AgiHelpInfo |
getHelpInfo,
setHelpInfo |
Methods implemented from interface javax.swing.event.ChangeListener |
stateChanged |
Constructor Detail |
public AgcJSlider()
public AgcJSlider(BoundedRangeModel brm)
public AgcJSlider(int orientation)
orientation
- specifies the slider's orientation;
that is, whether the slider knob moves side to side or up and down.
Use the constants VERTICAL or HORIZONTAL, which are defined
in SwingConstants
.SwingConstants
public AgcJSlider(int min, int max)
min
- the value at the low end of the slider.max
- the value at the high end of the slider.public AgcJSlider(int min, int max, int value)
min
- the value at the low end of the slider.max
- the value at the high end of the slider.value
- the initial value of the slider knob.public AgcJSlider(int orientation, int min, int max, int value)
orientation
- specifies the slider's orientation;
that is, whether the slider knob moves side to side or up and down.
Use the constants VERTICAL or HORIZONTAL, which are defined
in SwingConstants
.min
- the value at the low end of the slider.max
- the value at the high end of the slider.value
- the initial value of the slider knob.Method Detail |
public Integer getIntegerValue()
public void setIntegerValue(Integer value)
value
- an Integer object whose value you want to assign to the slider.
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |