Java Reference
In-Depth Information
JScrollPane
Package: javax.swing
Ancestor classes:
Object
|
+--Component
|
+--Container
|
+--JComponent
|
+--JScrollPane
public JScrollPane(Component objectToBeScrolled)
Creates a new JScrollPane for the objectToBeScrolled . Note that the
objectToBeScrolled need not be a JTextArea , although that is the only type of argument
considered in this topic.
public void setHorizontalScrollBarPolicy( int policy)
Sets the policy for showing the horizontal scroll bar. The policy should be one of
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
The phrase AS_NEEDED means the scroll bar is shown only when it is needed. This is
explained more fully in Chapter 17. The meanings of the other policy constants are obvious from
their names.
(As indicated, these constants are defi ned in the class JScrollPane . You should not need
to even be aware of the fact that they have int values. Think of them as policies, not as
int values.)
public void setVerticalScrollBarPolicy( int policy)
Sets the policy for showing the vertical scroll bar. The policy should be one of
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS
JScrollPane.VERTICAL_SCROLLBAR_NEVER
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
The phrase AS_NEEDED means the scroll bar is shown only when it is needed. This is
explained more fully in Chapter 18. The meanings of the other policy constants are obvious from
their names.
(As indicated, these constants are defi ned in the class JScrollPane. You should not need
to even be aware of the fact that they have int values. Think of them as policies, not as
int values.)
 
Search WWH ::




Custom Search