🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12509

JTextArea and JScrollPane - no scrollbars?

#12509
From: Michael Appelmans
Date: Wed, 16 Dec 1998 00:00
33 lines
1524 bytes
When I place a JTextArea in a JScrollPane and add succesive lines of
text using add method no scrollbars appear and I can't see lines of
text past the bottom of the frame. Any suggestion on what I am doing
wrong with textarea?

relevant code....
public MyJFrame extends JFrame{

....
  JScrollPane jsp = new JScrollPane();
  JTextArea jta = new JTextArea();
...
   jsp.getViewport().add(jta, null);
   bevelPanel1.setLayout(borderLayout1);
   bevelPanel1.add(jsp, BorderLayout.CENTER);
   this.getContentPane().add(bevelPanel1, BorderLayout.CENTER);
....
  public static void main(String[] args) {
   MyJFrame jf = new MyJFrame();

   for (int i = 1; i < 50; i++)
       jf.jta.addLine("Test: " + Integer.toString(i));

Here I can't scroll to text below line 20 which is the size of the
frame.

Any help would be appreciated...
Thanks
Michael Appelmans

Agility, Inc.
*remove 123 to mail*
mappelmans@123agility-inc.com
Technical Details
Message-ID: <758mfd$qsn16@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,852e538c8260ff1a,start
X-Google-Attributes: gid111d45,public
From: "Michael Appelmans" <mappel@123ibm.net>
Subject: JTextArea and JScrollPane - no scrollbars?
Date: 1998/12/16
Message-ID: <758mfd$qsn16@forums.borland.com>
X-Deja-AN: 422917723
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing