import java.awt.*;
import java.awt.event.*;
public class TV{
public static void startTV(String args[]){
String channelNo="01";
Frame frame=new Frame("TV TH");
TextField channel=new TextField("Channel 01");
channel.setEditable(false);
channel.setBounds(30,50,100,25);
Button remot=new Button("Remote");
remot.setBounds(150,250,100,25);
remot.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Frame remote=new Frame("Remot TV");
Button one=new Button("01");
one.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 01");}});
one.setBounds(25,75,25,25);
remote.add(one);
Button two=new Button("02");
two.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 02");}});
two.setBounds(85,75,25,25);
remote.add(two);
Button three=new Button("03");
three.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 03");}});
three.setBounds(150,75,25,25);
remote.add(three);
Button four=new Button("04");
four.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 04");}});
four.setBounds(25,150,25,25);
remote.add(four);
Button five=new Button("05");
five.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 05");}});
five.setBounds(85,150,25,25);
remote.add(five);
Button six=new Button("06");
six.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 06");}});
six.setBounds(150,150,25,25);
remote.add(six);
Button seven=new Button("07");
seven.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 07");}});
seven.setBounds(25,225,25,25);
remote.add(seven);
Button eight=new Button("08");
eight.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 08");}});
eight.setBounds(85,225,25,25);
remote.add(eight);
Button nine=new Button("09");
nine.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 09");}});
nine.setBounds(150,225,25,25);
remote.add(nine);
Button power = new Button("On/Off");
power.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){remote.dispose();frame.dispose();}});
power.setBounds(140,30,40,25);
remote.add(power);
remote.setSize(200,450);
remote.setLayout(null);
remote.setVisible(true);
}
});
frame.add(channel);
frame.add(remot);
frame.setSize(400,300);
frame.setLayout(null);
frame.setVisible(true);
}
}