Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set a fixed max height on a JComponent.

843806Apr 3 2008 — edited Apr 7 2008

Is there someway to set a fixed height on a JComponent e.g a JTextField.

setPrefferdSize() works but then I need to set the width as well which aint a solution for me. The main problem is that setPrefferdSize() and setMaximumSize() .... etc all requiers a Dim object which is both height and width.

//Andreas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2008
Added on Apr 3 2008
6 comments
865 views