Jump to content
  • Advertisement
Sign in to follow this  
Radiocreed

[java] JTextField problems

This topic is 4977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

This topic is 4977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!