| | |
netbeans 4.0 HELP!
![]() |
•
•
Join Date: Jun 2005
Posts: 5
Reputation:
Solved Threads: 0
i know java, ive had two classes in it but ive only written it in notepad.. lol
so here im trying to make an applet in netbeans and implement an action listener.. why do i get an error at my first line here:
i.e this line:
heres the error message i recieve:
what can i do to fix this? is netbeans doing something for me to where i dont have to write this? or do i have to use a frame?
thanks
so here im trying to make an applet in netbeans and implement an action listener.. why do i get an error at my first line here:
Java Syntax (Toggle Plain Text)
import java.awt.event.*; import java.awt.*; public class applet1 extends java.applet.Applet implements java.awt.event.ActionListener
i.e this line:
Java Syntax (Toggle Plain Text)
public class applet1 extends java.applet.Applet implements java.awt.event.ActionListener
heres the error message i recieve:
•
•
•
•
applet1 is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
thanks
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
Did you override that method? If not you need to add this method in your class;
Java Syntax (Toggle Plain Text)
public void actionPerformed(ActionEvent ae) { }
•
•
Join Date: Jun 2005
Posts: 5
Reputation:
Solved Threads: 0
hmm i will add that! i was just trying to get it to build but if it wont build without that class then ill add it!
also why do i have to write this like this:
why not like this:
is this something new or just something netbeans does?
also why do i have to write this like this:
Java Syntax (Toggle Plain Text)
extends java.applet.Applet
why not like this:
Java Syntax (Toggle Plain Text)
extends Applet
is this something new or just something netbeans does?
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
Import java.applet.*;
and that should allow it. Since you don't have an import statement you're having to use the fully qualified name. The same goes for the actionListener. If you don't want to continously use the fully qualified name, then:
import java.awt.event.*;
By the way, if you want to just test the app and not worry about adding that method, just take off the implements.... statement.
and that should allow it. Since you don't have an import statement you're having to use the fully qualified name. The same goes for the actionListener. If you don't want to continously use the fully qualified name, then:
import java.awt.event.*;
By the way, if you want to just test the app and not worry about adding that method, just take off the implements.... statement.
•
•
Join Date: Jun 2005
Posts: 5
Reputation:
Solved Threads: 0
thanks for the help 
i decided to start from the top with a hello world. well i cant get it to open the applet, ill run it and it will just build it.. heres the code, am i doing something small wrong?
also im wondering if i should be using an applet.. are frames and applets the same? i just want to make an application thats readily available anywhere where you have internet access

i decided to start from the top with a hello world. well i cant get it to open the applet, ill run it and it will just build it.. heres the code, am i doing something small wrong?
Java Syntax (Toggle Plain Text)
import java.awt.event.*; import java.awt.*; import java.applet.*; public class applet1 extends Applet { public static void main(String args[]) { System.out.println("Hello World"); } public void init() { } // TODO overwrite start(), stop() and destroy() methods }
also im wondering if i should be using an applet.. are frames and applets the same? i just want to make an application thats readily available anywhere where you have internet access
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
•
•
•
•
Originally Posted by Wrath
thanks for the help
i decided to start from the top with a hello world. well i cant get it to open the applet, ill run it and it will just build it.. heres the code, am i doing something small wrong?
Java Syntax (Toggle Plain Text)
import java.awt.event.*; import java.awt.*; import java.applet.*; public class applet1 extends Applet { public static void main(String args[]) { System.out.println("Hello World"); } public void init() { } // TODO overwrite start(), stop() and destroy() methods }
also im wondering if i should be using an applet.. are frames and applets the same? i just want to make an application thats readily available anywhere where you have internet access
Java Syntax (Toggle Plain Text)
import java.awt.event.*; import java.awt.*; import java.applet.*; public class applet1 extends Applet { public void init() { } public void paint(Graphics g) { g.drawString("Hello World",0,0); } // TODO overwrite start(), stop() and destroy() methods }
See if that works.
For your last question, I would go with an applet. You won't be able to just run a framed application anywhere like you can an applet. ALL newer browsers support java and will show up applets.
![]() |
Similar Threads
- netbeans problem (Java)
- How to download source code for NetBeans and Eclipse? (Java)
- Integrating NetBeans 4.0 and Microsoft VSS 6.0 (Java)
- linux/netbeans problem with default color covers set color of JTabbedPane (Java)
- first project in netbeans (Java)
- problem importing elements package into netbeans 4.0 (Java)
Other Threads in the Java Forum
- Previous Thread: 'directed acyclic word graph'??
- Next Thread: Java GUI problem... contents of JFrame is invisible...
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows






