| getPreferredSize() | ใช้คืนค่า preferred size ของ component ในรูปแบบของ dimension |
|---|
method:getPreferredSize ();
return type:Dimension
content:ใช้คืนค่า preferred size ของ component ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); button.setBounds ( 0, 0, 100, 30 ); Dimension dimension = button.getPreferredSize ();