wood burning stoves 2.0*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField" Watch "JTextField" New topic
Author

JTextField

Eric Wilson
Greenhorn

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

Joined: Oct 29, 2001
Posts: 8705
    
    6

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
jQuery in Action, 2nd edition
 
subject: JTextField
 
Similar Threads
cant figure this out
Restricting numeric input
how can consume Paste content in the JTextField
2 textfields 1 model
textbox validation