JScrollPane
public JScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
Creates a JScrollPane that displays the view component in a viewport whose view position can be controlled with a pair of scrollbars. The scrollbar policies specify when the scrollbars are displayed, For example, if vsbPolicy is VERTICAL_SCROLLBAR_AS_NEEDED then the vertical scrollbar only appears if the view doesn't fit vertically. The available policy settings are listed at setVerticalScrollBarPolicy(int) and setHorizontalScrollBarPolicy(int).
Parameters:
view - the component to display in the scrollpanes viewport
vsbPolicy - an integer that specifies the vertical scrollbar policy
hsbPolicy - an integer that specifies the horizontal scrollbar policy
See Also:
setViewportView(java.awt.Component)
In your sample try :
this.getContentPane().add(new JScrollPane(TA,
VERTICAL_SCROLLBAR_ALWAYS,
HORIZONTAL_SCROLLBAR_ALWAYS));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.