English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Please put the codes.

Im using awt and swing....................

2007-08-21 16:33:54 · 4 answers · asked by Bob 3 in Computers & Internet Programming & Design

4 answers

Create a JScrollPane. The JScrollPane will contain the thing that you want to scroll (the JTextArea), and itself be inserted in the upper-level component that is supposed to contain the JTextArea.

You can set the scroll bar policy on the ScrollPane (always has a scrollbar, only has a scrollbar when the content is larger than the area it occupies, never show a scrollbar).

Snippet of some of my code:
============================
// Create the TextArea
JTextArea jXmlContent = new JTextArea();

// Create the ScrollPane containing the TextArea
JScrollPane jXmlContentScroll = new JScrollPane( jXmlContent );

// Set vertical scroll = always on
jXmlContentScroll. setVerticalScrollBarPolicy( JScrollPane. VERTICAL_SCROLLBAR_ALWAYS );

// Add the scroll pane to the window
jContentPanel.add( jXmlContentScroll);
============================

2007-08-21 16:46:27 · answer #1 · answered by McFate 7 · 0 0

Textarea Scrollbar

2016-11-09 19:57:25 · answer #2 · answered by mattu 4 · 0 0

Java Scrollpane

2017-01-05 08:53:41 · answer #3 · answered by fescine 4 · 0 0

properly assuming you have the two frames made, purely make an eventlistener or whichever listener you're working with to make as quickly as you press the button, to make the present physique.isVisible(pretend) and the nice and comfortable physique isVisible(actual).

2016-11-13 03:18:15 · answer #4 · answered by ? 4 · 0 0

fedest.com, questions and answers