• 天语m618游戏下载java > javautilEventObject
  • javautilEventObject

    免费下载 下载该文档 文档格式:PPT   更新时间:2000-02-01   下载次数:0   点击次数:1
    文档基本属性
    文档语言:
    文档格式:ppt
    文档作者:Hoony Park
    关键词:
    主题:
    备注:
    点击这里显示更多文档属性
    Event Handling
    Feb 14, 2000
    Event Model Revisited
    Recall that a component can fire an event.
    Each type of event is defined as a distinct class.
    An event is received by one or more listeners.
    An event listener is an object of a class which implements particular type of listener interface
    Since a class can implement multiple interfaces, an object can act on multiple events of different types.
    To receive an event of particular type, we only need to register with the component that fire the event.
    Event Hierarchy
    java.util.EventObject
    java.awt.AWTEvent
    java.awt.event.ComponentEvent
    java.awt.event.FocusEvent
    java.awt.event.KeyEvent
    java.awt.event.MouseEvent
    java.awt.event.AdjustmentEvent
    java.awt.event.WindowEvent
    java.awt.event.ActionEvent
    java.awt.event.ItemEvent
    java.awt.event.TextEvent
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ButtonDemo implements ActionListener {
    Container pane;
    ButtonDemo() {
    JFrame frame =
    new JFrame("Button Demo");
    pane = frame.getContentPane();
    pane.setLayout(new GridLayout(5,3));
    addButtons();
    frame.pack();
    frame.setSize(300,200);
    frame.setVisible(true);
    }
    // place addButtons() here!!!
    public void actionPerformed(
    ActionEvent event) {
    String command
    = event.getActionCommand();

    下一页

  • 下载地址 (推荐使用迅雷下载地址,速度快,支持断点续传)
  • 免费下载 PPT格式下载
  • 您可能感兴趣的
  • 天语java手机游戏下载  天语java游戏下载  天语java破解游戏下载  天语java游戏免费下载  天语m618java  天语手机java软件下载  天语手机java下载安装  天语java软件下载专区  天语手机java主题下载