/*
4. Program which creates a frame with two buttons father and mother. When we click the
father button the name of the father, his age and designation must appear. When we click
mother similar details of mother also appear.
*/
import java.awt.event.*;
import javax.swing.*;
public class programB4 {
public static void main(String[] args) {
JFrame f=new JFrame("PROGRAM B4");
final JTextArea tf=new JTextArea ();
tf.setBounds(50,50, 250,150);
JButton b=new JButton("FATHER");
b.setBounds(50,250,95,30);
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
tf.setText(" FATHER AGE= 40 \n designation = Manager.");
}
});
JButton b2=new JButton("Mother");
b2.setBounds(150,250,95,30);
b2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
tf.setText(" Mother AGE= 35 \n designation = teacher.");
}
});
f.add(tf);
f.add(b);
f.add(b2);
f.setSize(500,500);
f.setLayout(null);
f.setVisible(true);
}
}