Sign in to follow this  
Radiocreed

[java] JTextField problems

Recommended Posts

I'm having some trouble with my JTextField, it's height is too high. Using methods setPreferredSize, setMaximum, setMinimum doesn't affect it at all. I'm using box layout in my program. Here's a picture of the user interface. http://www.student.cs.uwaterloo.ca/~thalamya/trouble.JPG Does anyone know how to restrict the height of the JTextField?

Share this post


Link to post
Share on other sites
Usually when using layouts you cannot specify the size of your component with those methods. Try setBounds(int x ,int y , int width, int height).

Edit: Oh wait I read your question wrong.


The method setMaximumSize( Dimension d ) should work for specifying the size of the JTextField although only SpringLayout and BoxLayout pay attention to it.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this