hi,
Code follows like this. Doubt at @line 1
import java.awt.*
import java.awt.event.*
class TestAwt extends Frame implements ActionListener
{
Panel p1,p2;
Button b1,b2,b3;
TestAwt()
{
p1 = new Panel();
p2 = new Panel();
b1 = new Button("One");
b2 = new Button("Two");
b3 = new Button("Three");
setLayout(new BorderLayout());
add(p1,"North");
add(p2,"South");
p1.setLayout(new FlowLayout());
p1.add(b1);
p1.add(b2);
b1.addActionListener(this);
setvisible(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == b1)
{
p2.add(b3);
b3.setvisible(true); // line 1
}
}
public static void main(
String []arg)
{
new TestAwt();
}
};
my question is at line 1. Everything functions properly and also displays button "Three" when i click on button "One". But actually the button is seen when i maximmize or minimize the window.
I want to show the button when i clicked on the button "One".
thanks in advance