第11章 GUI 07 ActionEvent 2
来源:互联网 发布:网络打印机软件 编辑:程序博客网 时间:2024/06/16 20:56
鱼欲遇雨:每日都学习一点,持之以恒,天道酬勤!不能用电脑时,提前补上!(2012.9.15)
// TestActionEvent2.javaimport java.awt.*;import java.awt.event.*;public class TestActionEvent2 {public static void main(String args[]) {Frame f = new Frame("Test");Button b1 = new Button("Start");Button b2 = new Button("Stop");Moniter2 mh = new Moniter2();b1.addActionListener(mh);b2.addActionListener(mh);b2.setActionCommand("game over");f.add(b1, "North");f.add(b2, "Center");f.pack();f.setVisible(true);}}class Moniter2 implements ActionListener {public void actionPerformed(ActionEvent e) {System.out.println("A button has been pressed." +"the relative info is :\n" + e.getActionCommand());}}
- 第11章 GUI 07 ActionEvent 2
- 第11章 GUI 06 事件模型 ActionEvent
- 第11章 GUI 06 事件模型 ActionEvent
- 马士兵 J2SE 第11章 GUI编程 事件模型ACTIONEVENT TEXTFIELD事件监听 内部类 PAINT adapter和repaint window事件 键盘事件
- ActionEvent
- 第11章 GUI 01 GUI 初步 Frame and Panel1
- 第11章 GUI 02 GUI 初步 Frame and Panel2
- 第11章 GUI 04 布局管理器2
- GUI事件模型ActionEvent举例,TextField事件监听举例
- GUI编程第三弹_按钮上的ActionEvent事件
- 第11章 GUI 11 Paint 方法
- 第11章 GUI 08 TextField ActionEvent1
- 第11章 GUI 10 内部类
- 马士兵 J2SE 第11章 GUI编程 GUI初步和布局管理器
- 第11章 GUI 03 布局管理器1
- 第11章 GUI 05 布局管理器3
- 第11章 GUI 09 持有对方引用
- 第11章 GUI 12 Adapter and repaint.flv
- SPLAY模板
- Windows 7下不借助deinstall删除Oracle 11gR2软件
- sys_guid()
- 9.14 javaBean
- jsp+mysql实例简单的购物车
- 第11章 GUI 07 ActionEvent 2
- 第11章 GUI 08 TextField ActionEvent1
- poj1061
- HDU 1506 Largest Rectangle in a Histogram
- 求多个有序数组的中位数
- javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach>
- Ubuntu下gcc安装及使用
- SSH学习之——Spring、Struts和Hibernate整合开发
- 我,又回来了