🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTextArea and JScrollPane - no scrollbars?

#12516
From: Matt Krevs
Date: Thu, 17 Dec 1998 00:00
37 lines
1646 bytes
Try calling validate() for the frame after you have added your text.

Michael Appelmans wrote in message <758mfd$qsn16@forums.borland.com>...
>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: <75a3nn$rtn5@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <758mfd$qsn16@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,852e538c8260ff1a
X-Google-Attributes: gid111d45,public
From: "Matt Krevs" <mattkrevs@flex.com.au>
Subject: Re: JTextArea and JScrollPane - no scrollbars?
Date: 1998/12/17
Message-ID: <75a3nn$rtn5@forums.borland.com>
X-Deja-AN: 423142218
References: <758mfd$qsn16@forums.borland.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing