Topic: 请帮忙看一下程序错在哪

  Print this page

1.请帮忙看一下程序错在哪 Copy to clipboard
Posted by: haoyue
Posted on: 2004-08-03 14:49

import java.awt.*;
import java.awt.event.*;

public class MultipleEventTester extends Frame implements WindowListener,MouseListener,KeyListener
{
public MultipleEventTester()
{
addWindowListener(this);
addMouseListener(this);
addKeyListener(this);
setSize(200,200);
show();
}
//窗口处理事件方法
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void windowOpened(WindowEvent e)
{
System.out.println("Window opened");
}
public void windowIconified(WindowEvent e)
{
System.out.println("Window iconified"+e);
}
public void windowDeiconified(WindowEvent e)
{
System.out.println("window deiconified"+e);
}
public void windowClosed(WindowEvent e)
{
System.out.println("Window closed"+e);
}
public void windowActivated(WindowEvent e)
{
System.out.println("Window activated"+e);
}
public void windowDeactivated(WindowEvent e)
{
System.out.println("window deactivated"+e);
}
//鼠标事件处理方法
public void MousePressed(MouseEvent e)
{
System.out.println("Mouse pressed"+e);
}
public void MouseReleased(MouseEvent e)
{
System.out.println("Mouse release"+e);
}
public void MouseEntered(MouseEvent e)
{
System.out.println("Mouse dntered"+e);
}
public void MouseExited(MouseEvent e)
{
System.out.println("Mouse exited"+e);
}
public void MouseClicked(MouseEvent e)
{
System.out.println("Mouse Clicked"+e);
}
//键盘事件处理方法
public void keyPressed(KeyEvent e)
{
System.out.println("Key pressed"+e);
}
public void keyReleased(KeyEvent e)
{
System.out.println("Key released"+e);
}
public void keyTyped(KeyEvent e)
{
System.out.println("Key type"+e);
}
public static void main(String args[])
{
MultipleEventTester p=new MultipleEventTester();
}
}

2.Re:请帮忙看一下程序错在哪 [Re: haoyue] Copy to clipboard
Posted by: zslzx
Posted on: 2004-08-03 23:52

把所有鼠标处理时间中的Mouse。。改成mouse。。

3.Re:请帮忙看一下程序错在哪 [Re: haoyue] Copy to clipboard
Posted by: haoyue
Posted on: 2004-08-04 09:33

谢谢指点


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923