Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextField

 
Eric Wilson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i use/override the method getPreferredSize for a JTextField
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic