|
what's wrong with my Applet?
|
View this Thread in Original format
| UglyDave |
code:
import javax.swing.JApplet;
import javax.swing.JOptionPane;
import java.awt.Graphics;
public class ticker extends JApplet{
private String tickText;
public void init(){
tickText = JOptionPane.showInputDialog(null,"Enter text:");
}
public void paint(Graphics g){
super.paint(g);
g.drawString(tickText,25,25);
}
}
html:
code:
wont work for some reason, but when i run it from blueJ it's fine.
anyone got any suggestions?? |
|
|
| UglyDave |
by the way.. i'm way leeter than what might appear.. it's just that i'm new to applets :)
just incase u were thinkin i was a lamo! |
|
|
| SuperFarStucker |
| quote: | Originally posted by UglyDave
by the way.. i'm way leeter than what might appear.. it's just that i'm new to applets :)
just incase u were thinkin i was a lamo! |
lol |
|
|
| getfoul |
| quote: | Originally posted by UglyDave
by the way.. i'm way leeter than what might appear.. it's just that i'm new to applets :)
just incase u were thinkin i was a lamo! | that was actually my first thought. |
|
|
| Teknikol |
| quote: | Originally posted by UglyDave
by the way.. i'm way leeter than what might appear.. it's just that i'm new to applets :)
just incase u were thinkin i was a lamo! |
:eek: |
|
|
| UglyDave |
lots of useful feedback here :)
where's DigiNut??
he usually knows his :)
i guess it's a big non-leet of me to be askin in the first place, but ah well :)
i plan on makin loads of wee web apps and givin them away for free..
so far i've made a guestbook, user tracking devices.. and now i'm gonna start applets :) |
|
|
| DigiNut |
My Swing is a little bit rusty, but does that init method ever actually get executed? If not, then you're trying to draw a string that hasn't been initialized.
What exactly is the error? |
|
|
| UglyDave |
only msg i get is:
"applet ticket notinited"
which is in the status bar of the browser.
thank goodness! DigiNut is on the case! |
|
|
| DigiNut |
Oh, I see it.
You called the applet "ticker" and tried to embed class "ticket" into the HTML.
Doofus. :p |
|
|
| UglyDave |
| quote: | Originally posted by DigiNut
Oh, I see it.
You called the applet "ticker" and tried to embed class "ticket" into the HTML.
Doofus. :p |
oookkk
explain that :)
*feels stupid*
i swear to God i'm leet!!!
honnestly i am :p
i'd kick ur ass in a java theory test :)
or programmin chellenge :) |
|
|
| DigiNut |
Sure you are Dave, suuuuuure you are. ;)
Well as long as it's fixed. Should say code="tickeR.class". :p
|
|
|
| UglyDave |
| quote: | Originally posted by DigiNut
Should say code="tickeR
|
cheers Digi!
had it not been for that huge R i never would have found it :)
now that ur there, are there any timer functions in java? i'm sure there are, know of any?
in VB there was a thing u could use.. set a timer, then every 100 (or whatever u set it to) milliseconds a piece of code would be executed..
ne suggestions? |
|
|
|
|