java 遥控_java小程序,模拟电视机和遥控

1 import java.awt.*;2 import java.awt.event.*;3

4 public class remote extendsFrame {5

6 /**

7 *@paramargs8 */

9 private static final long serialVersionUID = 22;10 GridLayout gl0, gl1,gl2;11 Panel p0,p1,p2;12 Button b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b_cancel,b_ok,b_turn_on,b_turn_off,b_channel_up,b_channel_down,b_volume_up,b_volume_down, b_random;13 StringBuffer str;14

15 publicremote()16 {17 gl0=new GridLayout(4,5,10,15);18 gl1=new GridLayout(3,1,0,15);19 gl2=new GridLayout(4,1,0,15);20

21 b0 = new Button("0");22 b0.setForeground(Color.blue);23 b0.addActionListener(newBt());24 b1 = new Button("1");25 b1.setForeground(Color.blue);26 b1.addActionListener(newBt());27 b2 = new Button("2");28 b2.setForeground(Color.blue);29 b2.addActionListener(newBt());30 b3 = new Button("3");31 b3.setForeground(Color.blue);32 b3.addActionListener(newBt());33 b4 = new Button("4");34 b4.setForeground(Color.blue);35 b4.addActionListener(newBt());36 b5 = new Button("5");37 b5.setForeground(Color.blue);38 b5.addActionListener(newBt());39 b6 = new Button("6");40 b6.setForeground(Color.blue);41 b6.addActionListener(newBt());42 b7 = new Button("7");43 b7.setForeground(Color.blue);44 b7.addActionListener(newBt());45 b8 = new Button("8");46 b8.setForeground(Color.blue);47 b8.addActionListener(newBt());48 b9 = new Button("9");49 b9.setForeground(Color.blue);50 b9.addActionListener(newBt());51 b_cancel= new Button("C");52 b_cancel.setFore

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值