Hello all...
This is from RHE page 316
"It is given that the setSize() & setBounds() method on a component is overruled by Layout Manager. The major exception to this rule is the Frame class which is not under the thumb of Layout Manager & is perfectly willing to have u set the component size or bounds."
What i don't understand is that Frame class has Border Layout as default layout manager, Just look at below source code:-
public class FlowLay2 extends Frame
{
FlowLay2()
{
Button button = new Button("Click");
button.setBounds(70,80,40,40);
add(button);
button.addActionListener(this);
}
public static void main(
String args[])
{
FlowLay2 f = new FlowLay2();
f.setBounds(150,100,300,200);
f.show();
}
Here i m trying to set the bounds of button, but it is placed in Center (Since Border Layout places the component at center by default).
So how can i setbounds for Button.
Thanks