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

Problems Resizing TextArea

Ben David
Ranch Hand

Joined: Oct 01, 2010
Posts: 67

I cant seem to resize a text area box.

I tried resizing the text area and the panel that I put it in.

What am I doing wrong?




method







whole class
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

99.99% of the layout managers ignore the size set specifically, and only look at the preferred size.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ben David
Ranch Hand

Joined: Oct 01, 2010
Posts: 67
Thanks! I will look into preffered size next time I have a problem.

I ended up specifying columns and rows in the TextArea Constructor.




Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Why are you using TextArea and not JTextArea? It's a bad idea to mix AWT components (like TextArea) with Swing components (like JPanel).
Ben David
Ranch Hand

Joined: Oct 01, 2010
Posts: 67
Rob Prime wrote:Why are you using TextArea and not JTextArea? It's a bad idea to mix AWT components (like TextArea) with Swing components (like JPanel).


oops. that was a newb mistake. Thanks for the pointer!

I changed it to a swing JTextArea.

Now I just need to put it inside a JScrollPane to get a scroll bar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems Resizing TextArea