首先应该是
public boolean action
其次,你仍然可以在1.3甚至是以后的版本中继续使用它,
在java2中使用XXXListener(MouseListener for mouseDown...., ActionListener for action, ...)
see java.awt.event.*;
public boolean action
其次,你仍然可以在1.3甚至是以后的版本中继续使用它,
在java2中使用XXXListener(MouseListener for mouseDown...., ActionListener for action, ...)
see java.awt.event.*;
解决方案 »
- SQLGrammarException:could not initialize a collection:
- 为什么讲图片转化为文本存储后,文件的大小就变大了?
- volatile 关键字 除了修饰基本类型外 ,可以修饰InputStream之类的吗
- 字符转换问题,在线,谢谢!
- import javax.swing.*; 报错,,, 在线等,谢谢~~
- JAVA格式化字符串
- jTextPane设置为text/html后,我直接将WORD中的文档复制进去,无法成功,怎么办?
- 本人初学java,求高手,高分送上
- 一个线程同步的问题
- 虚拟机卸载类型的问题
- 哎!文件拷贝之后,里面的中文就成了乱码了.怎么才能让中文显示正常???
- 这样的问题应该如何解决?
import java.awt.*;
public class A implements ActionListener{
public A(){
Button button=new Button("my");
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
………//当按钮有动作时,会触发这部分代码。
}
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
import java.awt.event.*;
import java.awt.*;
public class A implements{
public A(){
Button button=new Button("my");
button.addActionListener(new ActionAdapter(){
public void actionPerformed(ActionEvent e){
……………
}
});
}
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^这种新的事件监听模式,有KeyListener、ActionListener、Mouse………
import java.awt.*;
public class A{
public A(){
Button button=new Button("my");
button.addActionListener(new ActionAdapter(){
public void actionPerformed(ActionEvent e){
……………
}
});//使用匿名内部类来监听按钮事件
}
}
if (e.target instanceof Button){
Button b=(Button)e.target;
if (b.getLabel()=="Add Sphere"){
addChildren.setValue(shape);
}
else if(b.getLabel()=="Add Box"){
addChildren.setValue(box);
}
else if(b.getLabel()=="Add Cone"){
addChildren.setValue(cone);
}
else if(b.getLabel()=="Add Cylinder"){
addChildren.setValue(Cylinder);
}
return true;
} }
原代码是为了控制vrml来用的,希望大家讨论一下,该怎么做。谢了