分成两个文件写
问题:
第二个listenns文件中函数没有被调用,原因是生成的界面上start按钮和右上角的关闭按钮点击
无反应,请问原因是什么
test文件
package SecondJava;
import java.awt.*;
import java.awt.event.*;
public class test extends Frame implements ActionListener{
private Button start=new Button("Start");
private Button show=new Button("Show");
private Button close=new Button("close");
private TextField display=new TextField(25);
private listens count=new listens(show,25);
private class WindowCloser extends WindowAdapter{
public void WindowClosing(WindowEvent we){
System.exit(0);
}
}
public test(){
super("CountDown Tester");
setLayout(new FlowLayout());
addWindowListener(new WindowCloser());
add(start);</
最后
以上就是乐观汽车最近收集整理的关于java跨文件调用函数_java同一包下的两个文件,一个文件中的函数调用另一个文件中的函数失败?...的全部内容,更多相关java跨文件调用函数_java同一包下内容请搜索靠谱客的其他文章。
发表评论 取消回复