aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Forcing JTextArea to respect its size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Forcing JTextArea to respect its size" Watch "Forcing JTextArea to respect its size" New topic
Author

Forcing JTextArea to respect its size

Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
If I put a JTextArea in a JPanel with BoxLayout, it will not display in its given size. It will take up all the panel if no other components exist. I tried to put an empty border in the JPanel and it even ignores that.

How do I force it to accept the preferred height and width?
[ July 13, 2006: Message edited by: Rusty Shackleford ]

"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Nick Meverden
Ranch Hand

Joined: Jul 03, 2006
Posts: 59
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Thanks, at first it didn't work, then applied to JScrollPane it did. Except for some reason the height of it.
[ July 13, 2006: Message edited by: Rusty Shackleford ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Forcing JTextArea to respect its size