document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. public class TV{
  4.    public static void startTV(String args[]){
  5.        String channelNo="01";
  6.        Frame frame=new Frame("TV TH");
  7.        TextField channel=new TextField("Channel 01");
  8.        channel.setEditable(false);
  9.        channel.setBounds(30,50,100,25);
  10.            
  11.        Button remot=new Button("Remote");
  12.        remot.setBounds(150,250,100,25);
  13.        remot.addActionListener(new ActionListener(){
  14.            public void actionPerformed(ActionEvent e){
  15.                Frame remote=new Frame("Remot TV");
  16.                Button one=new Button("01");
  17.                one.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 01");}});
  18.                one.setBounds(25,75,25,25);
  19.                remote.add(one);
  20.                Button two=new Button("02");
  21.                two.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 02");}});
  22.                two.setBounds(85,75,25,25);
  23.                remote.add(two);
  24.                Button three=new Button("03");
  25.                three.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 03");}});
  26.                three.setBounds(150,75,25,25);
  27.                remote.add(three);
  28.                Button four=new Button("04");
  29.                four.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 04");}});
  30.                four.setBounds(25,150,25,25);
  31.                remote.add(four);
  32.                Button five=new Button("05");
  33.                five.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 05");}});
  34.                five.setBounds(85,150,25,25);
  35.                remote.add(five);
  36.                Button six=new Button("06");
  37.                six.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 06");}});
  38.                six.setBounds(150,150,25,25);
  39.                remote.add(six);
  40.                Button seven=new Button("07");
  41.                seven.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 07");}});
  42.                seven.setBounds(25,225,25,25);
  43.                remote.add(seven);
  44.                Button eight=new Button("08");
  45.                eight.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 08");}});
  46.                eight.setBounds(85,225,25,25);
  47.                remote.add(eight);
  48.                Button nine=new Button("09");
  49.                nine.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){channel.setText("Channel 09");}});
  50.                nine.setBounds(150,225,25,25);
  51.                remote.add(nine);
  52.        
  53.                Button power = new Button("On/Off");
  54.                power.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){remote.dispose();frame.dispose();}});
  55.                power.setBounds(140,30,40,25);
  56.                remote.add(power);
  57.        
  58.                remote.setSize(200,450);
  59.                remote.setLayout(null);
  60.                remote.setVisible(true);
  61.            }
  62.        });
  63.        
  64.        frame.add(channel);
  65.        frame.add(remot);
  66.        frame.setSize(400,300);
  67.        frame.setLayout(null);
  68.        frame.setVisible(true);
  69.    }  
  70. }
');