Hi!
Could you tell me please, how can I use the method
getSize() before I call the method setVisible(true)??
If I call the method getSize() before setVisible(true)
then return getSize() only 0 !!!!!
I must call getSize() before setVisible(true).
I tried to call the methods addNotify() and validate()
before I call the getSize() but without success!!
Thank you for your help ;-))
Code:
import java.awt.*;
class Test extends Frame
{
Test()
{
setSize(200, 100);
setLayout(new FlowLayout());
Button b=new Button("test"
add(b);
System.out.println("Size: "+ b.getSize()); //It doesn't work!!!!
setVisible(true);
}
public static void main(String args[])
{
(new Test());
}
}
Could you tell me please, how can I use the method
getSize() before I call the method setVisible(true)??
If I call the method getSize() before setVisible(true)
then return getSize() only 0 !!!!!
I must call getSize() before setVisible(true).
I tried to call the methods addNotify() and validate()
before I call the getSize() but without success!!
Thank you for your help ;-))
Code:
import java.awt.*;
class Test extends Frame
{
Test()
{
setSize(200, 100);
setLayout(new FlowLayout());
Button b=new Button("test"
add(b);
System.out.println("Size: "+ b.getSize()); //It doesn't work!!!!
setVisible(true);
}
public static void main(String args[])
{
(new Test());
}
}