View Single Post
Old Sep 22nd, 2005, 9:19 AM   #1
susam_pal
Encoder
 
Join Date: Sep 2005
Location: India
Posts: 12
Rep Power: 0 susam_pal is on a distinguished road
Send a message via Yahoo to susam_pal
Size of Button before show()

JButton button = new JButton("Click here");
System.out.println(button.getWidth() + ";" + button.getHeight());

The output is always 0;0

Someone in the Yahoo Programming:1 room told me, that we must show() the frame before trying to determine the width and height. But I want to get the width and height of the button before showing the frame.

Can anyone solve my problem?
susam_pal is offline   Reply With Quote