Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Basic Java Help.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
AnthraX1
Advanced Cheater
Reputation: 0

Joined: 07 Nov 2006
Posts: 51

PostPosted: Wed Mar 28, 2007 4:21 pm    Post subject: Basic Java Help. Reply with quote

Hello I just began learning java just a couple days ago, [it is basicly my first language] I seem to have a problem with this tutorial on applets (my applet is broken :tear: ) http://www.mandomartis.com/onlinecourses/basicgamedev/chapter2/chapter2.html

It tells me to compile this to a class....
Code:

import java.applet.*;

import java.awt.*;



public class myapplet extends Applet {





public void init()

{

    System.out.println("Hello Sweden!");

}



}



and make an html of this and then open the html

<HTML>
<HEAD><TITLE>My first applet</TITLE></HEAD>
<BODY>
<APPLET CODE="myapplet.class" WIDTH=100 HEIGHT=100>
</APPLET>
</BODY>
</HTML>

It appears I am getting an error because I do not have a main class but I am not shure, I am doing exactly as the tutorial says is there something I should add. And if it is the main class how and where should I add it.

All help is greatly appreciated,

Regards, iMi

_________________
CAn SOMEONE PLESE TEECH ME Hw To HcK I figured out how o donwlad Ceat Egnegine I just can't oPen it! I GET A SYSTEM 43 ERROR IT ANNOYING HELP!
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Wed Mar 28, 2007 9:29 pm    Post subject: Reply with quote

What compiler/IDE are you using? The main method is only required for applications, not applets. The main for applets is the init method, which you have right there.

Your IDE might be trying to run the compiled class as an application, that's why it complains that main is not found.

Also, I would suggest that you get another tutorial. That one is horrible. It's full of spelling errors ("compilator", IO as "In Our", and lots more), it doesn't follow Java naming conventions (first letter of classes should be capitalized, words used in method names are indistinguishable from lack of capitalization), it's old (talks of Netscape and IE4.0), and it talks bullshit (the String class is NOT a part of AWT). Their spacing and indentation is shit too.

I am also pretty sure (90%) that a System.out.println will NOT work in an applet when opened with a browser (another thing wrong about the tutorial). To see it, you have to open the thing with a console window using the java command.

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites