[問題] 疑似編譯器的問題 (以解決)

看板java作者 (那年夏天)時間15年前 (2010/12/09 15:19), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/1
編輯環境 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
actionperformed IS NOT actionPerformed
12/09 15:23, 1F

12/09 15:47, , 2F
編譯器不都是JDK JAVAC嗎 你有換喔
12/09 15:47, 2F

12/09 17:43, , 3F
我的天啊 真不知道該如何感謝一樓的大大了...
12/09 17:43, 3F

12/09 17:46, , 4F
問題解決了 P!=p阿.........
12/09 17:46, 4F
※ 編輯: i002149 來自: 59.115.162.91 (12/09 17:46)
文章代碼(AID): #1D08Bv7m (java)