How to create FRAME When BUTTON is clicked?

I tried using following code:

import java.awt.*;
import java.awt.event.*;

class Login extends Frame implements ActionListener
{

        Label l1,l2;
        TextField tf1,tf2;
        Button b1;
        
        public Login()
        {
        l1=new Label("User id");
        l2=new Label("Password");
        
        tf1=new TextField(10);
        tf2=new TextField(10);
        
        b1=new Button("Sign now");
        
        Panel p1=new Panel();
        
        p1.setLayout(new GridLayout(3,2));
        p1.add(l1);     p1.add(tf1);
        p1.add(l2);     p1.add(tf2);
        
        Panel p2=new Panel();
        
        p2.add(b1);
        
        b1.add(s);
        
        add(p1,BorderLayout.CENTER);
        add(p2,BorderLayout.SOUTH);
                setVisible(true);
                setSize(200,150);
        }

        public void ActionPerformed(ActionEvent ae)
        {
                if(ae.getSource()==b1)
                {
                
                   b1.show();

                }
                

        }

        class Sign
        {
                Button b2,b3,b4;
                Frame f1;
                
                //Sign s=new Sign();    
        
                public Sign()
                {
                f1=new Frame();
                
                b2=new Button("Sender");
                b3=new Button("Receiver");
                b4=new Button("Performance");
                
                f1.setLayout(new GridLayout(3,2));
                
                f1.add(b2);
                f1.add(b3);
                f1.add(b4);
                
                

                }

                

        public static void main(String args[])
        {
                
                Sign s=new Sign();
                new Login();
                //s.show();
                
        }
  }
}

On 1/25/10, tht2...@gmail.com <tht2...@gmail.com> wrote:
> Junk Score: 3 out of 10 (below your Auto Allow threshold) | Change:
> https://www.boxbe.com/mail-screening
> Approve sender:
> https://www.boxbe.com/anno?tc=1423892589_799251992
> Block sender:
> https://www.boxbe.com/anno?tc=1423892589_799251992&disp=b
> ___
>

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to