[問題] 疑似編譯器的問題 (以解決)
編輯環境
JCreator LE 5.00
jdk1.6.0_23
win7 32bit
程式碼
============================================
import java.awt.*;
import java.awt.event.*;
public class a1202 extends Frame implements ActionListener
{
static a1202 frm = new a1202();
static Button btn = new Button("yellow");
public static void main (String args[])
{
frm.setBackground(Color.black);
btn.addActionListener(frm);
frm.setSize(200,150);
frm.setLayout(new FlowLayout(FlowLayout.CENTER));
frm.add(btn);
frm.setVisible(true);
}
public void actionperformed(ActionEvent e)
{
frm.setBackground(Color.black);
}
}
=================================================================
錯誤訊息
--------------------Configuration: <Default>--------------------
C:\a1202.java:5: a1202 is not abstract and does not override abstract method
actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
public class a1202 extends Frame implements ActionListener
^
1 error
Process completed.
------------------------------------------------------------------------------
--------------------Configuration: <Default>--------------------
java.lang.NoClassDefFoundError: a1202
Caused by: java.lang.ClassNotFoundException: a1202
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: a1202. Program will exit.
Exception in thread "main"
Process completed.
----------------------------------------------------------------------------
之前原本用ECLIPSE
出現錯誤才會了這個編譯器
還是不能用
找不到問題在哪裡
懇請各位大大幫忙一下
先謝過了~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 120.127.47.90
※ 編輯: i002149 來自: 120.127.47.90 (12/09 15:21)
推
12/09 15:23, , 1F
12/09 15:23, 1F
推
12/09 15:47, , 2F
12/09 15:47, 2F
→
12/09 17:43, , 3F
12/09 17:43, 3F
→
12/09 17:46, , 4F
12/09 17:46, 4F
※ 編輯: i002149 來自: 59.115.162.91 (12/09 17:46)