aspose file tools
The moose likes Swing / AWT / SWT and the fly likes JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField" Watch "JTextField" New topic


Eric Wilson

Joined: Nov 30, 2003
Posts: 1
How do i use/override the method getPreferredSize for a JTextField
Joe Ess

Joined: Oct 29, 2001
Posts: 9026

If you want to set the preferred size, every get method usually has a corresponding set (i.e. setPreferredSize(java.awt.Dimension)). If you want to override getPreferredSize, you'd have write your own class to extend JTextField.

[How To Ask Questions On JavaRanch]
It is sorta covered in the JavaRanch Style Guide.
subject: JTextField