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?