• Post Reply Bookmark Topic Watch Topic
  • New Topic

Watz D Difference?

 
Sumi Jacob
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this is really basic, but can you please tell me as to what the difference between setSize() and setPreferredSize() is?
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setSize() method actually changes the size of the component. The setPreferredSize() is more of a hint to the layout manager.
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!