View Full Version : Java Help
Malik
August 3rd, 2010, 20:26
Ok I'm pretty new to java, I'm trying to make my first Application.I'm done with the coding, When I compile I get this error:
Only the registered members can see the link. (Only the registered members can see the link.)
I tried all I can do, can someone help?
Here is what is in:
/*
*
* HelloWorldApplet.java
* Demonstration for Java 106 tutorial
* David Reilly, August 24, 1997
*
*/
import java.awt.*;
import java.applet.*;
class HelloWorldApplet extends Applet
{
// Default constructor
public void HelloWorld()
{
// Call parent constructor
super();
}
Overridden paint; method
public void paint ( Graphics g )
{
g.setBackground ( Color.white );
g.setColor ( Color.blue );
g.drawString ( "Hello world!", 0, size().height - 5);
}
}
EDIT:Fixed it no need for help anymore.
Anthony`
August 3rd, 2010, 20:27
Moved to the correct section.
my pker pure
August 3rd, 2010, 23:44
Ok I'm pretty new to java, I'm trying to make my first Application.I'm done with the coding, When I compile I get this error:
Only the registered members can see the link. (Only the registered members can see the link.)
I tried all I can do, can someone help?
Here is what is in:
It's nothing to do with your compiler not working. It's to do with your applet coding. And there seems to be an error, but you haven't stated what this application is or anything. If you want me to help you fix it you need to add some more information. E.g. What is the application? And your actual coding.
Malik
August 3rd, 2010, 23:59
Oops sorry, forgot to say I figured it out, It wasn't any kind of application, I just wanted to one that said something, Like you probably know about the "Hello World" Thing yeh that was what I was trying to do,but inside an applet instead of through command prompt and it worked out.
Trey
August 4th, 2010, 04:50
I assume you tried to use the Override annotation without knowing what it is it, what an annotation is, or the proper syntax. That or that line was supposed to be a comment. Plus your so-called default constructor isn't even a constructor, so obviously you can call the parent constructor from there.
/*
*
* HelloWorldApplet.java
* Demonstration for Java 106 tutorial
* David Reilly, August 24, 1997
*
*/
import java.awt.*;
import java.applet.*;
class HelloWorldApplet extends Applet {
// Default constructor
public HelloWordApplet() {
// Call parent constructor
super();
}
@Override
public void paint(Graphics g) {
g.setBackground(Color.white);
g.setColor(Color.blue);
g.drawString("Hello world!", 0, size().height - 5);
}
}
All in all, knowing what you're doing or using google could have fixed all of those issues.
Fenway`
August 4th, 2010, 04:55
YouTube has multiple tuts on making helloworld applications and y r u using an IDE
Anthony`
August 4th, 2010, 05:48
YouTube has multiple tuts on making helloworld applications and y r u using an IDE
Whats wrong with using IDE's?
Trey
August 4th, 2010, 05:52
Whats wrong with using IDE's?
Using an IDE before learning how to program is like using a car before you can walk. You become stupid and dependent. Just look at Visual Studio users.
Anthony`
August 4th, 2010, 05:56
To be honest I think using an IDE while learning how to program is good, which looks like the case.
Fenway`
August 4th, 2010, 05:59
Lol I meant to say y aren't you using and IDE but Trey has a good point
I'm on my iPod so typos are inevitable
edit: @Trey what is visual studio
Malik
August 4th, 2010, 17:13
You guys do realize, I figured this out ages ago, and now you comment? :P
Snowz
August 4th, 2010, 19:37
You never said you figured it out lol.
Malik
August 4th, 2010, 19:43
Oops sorry, forgot to say I figured it out, It wasn't any kind of application, I just wanted to one that said something, Like you probably know about the "Hello World" Thing yeh that was what I was trying to do,but inside an applet instead of through command prompt and it worked out.
Yes I did actually ;0
Trey
August 4th, 2010, 21:49
If by ages ago you mean yesterday, 3 hours after you originally posted this thread, you turd. I only posted a correct version because you most likely just google'd and copied a different hello world program without learning anything.
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.