![]() |
| ||
| netbeans 4.0 HELP! 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: import java.awt.event.*; i.e this line: public class applet1 extends java.applet.Applet implements java.awt.event.ActionListener heres the error message i recieve: Quote:
thanks |
| ||
| Re: netbeans 4.0 HELP! Did you override that method? If not you need to add this method in your class; public void actionPerformed(ActionEvent ae) |
| ||
| Re: netbeans 4.0 HELP! 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: extends java.applet.Applet why not like this: extends Applet is this something new or just something netbeans does? |
| ||
| Re: netbeans 4.0 HELP! 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. |
| ||
| Re: netbeans 4.0 HELP! 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? import java.awt.event.*; 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 |
| ||
| Re: netbeans 4.0 HELP! Quote:
import java.awt.event.*; 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. |
| ||
| Re: netbeans 4.0 HELP! it will only pop up the applet if i right click the actual applet1.java icon in the projects list at the left but it wont display the hello world!.. anywhere else like in run/run main project, a pop up says "no main classes found" thanks :) |
| ||
| Re: netbeans 4.0 HELP! oops im sorry, its late! haha yea so i had the x and y values still at 0,0 so it wasnt showing up.. thanks again! |
| ||
| Re: netbeans 4.0 HELP! No problem. Your very welcome. If you have any other trouble just give me a holler. |
| All times are GMT -4. The time now is 3:26 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC