×

Loading...

java problem

oldsix (oldsix)
here is the application of java.when it compile ,what will be complained by compiler?Why?what's the deference between using the ActionListener and MouseMotionListener?
How to apply the function that listen the mouse motion event by the button?

why?
import java.awt.event.*;
import javax.swing.*;

public class A extends JPanel{
JButton jb=new JBUtton("test");
JTextField txt=new JTextField(20);
jb.addMouseMotionListener(new MouseMotionListener(){
public void mouseDrapped(MouseEvent e){}
public void mouseMoved9MouseEvent e){
txt.setText("Done!");
}
});
public static void main(String[] args){
JFrame frame=new JFrame();
frame.getContentPane().add(new A());
frame.setSize(300,200);
frame.setVisible(true);
}
}
(#11686@0)
2000-10-23 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: java problem

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论