943,936 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1608
  • Java RSS
Feb 14th, 2007
0

Javac

Expand Post »
Hello:

I have recently been studying Java; I have followed a few tutorials and building some simple apps.

I am wanting to try applets. I read about them tonight and followed an included tutorial in order to get an introductory feel for doing so.

My questions do not pertain to code or syntax but compiling the text file(s).
  1. Javac: the tutorial refers to Javac. I assumed I could code and run the applet in JBuilder (2005 Foundation). Is this possible? When I open Javac it runs lines and closes. Honestly, I am not very practiced with command-line.
  2. Naming and titling Java text files for applets: I read references to "*.java"; I assume that this would be, for example, something such as "Test*.java" -- is this correct? I have never dealt with this before.
I want to become more clear on these issues before I proceed. Any help or push in the right direction would be greatly appreciated.

Thank-you in advance.
MattyD
Similar Threads
Featured Poster
Reputation Points: 105
Solved Threads: 1
Posting Maven
mattyd is offline Offline
2,582 posts
since Oct 2006
Feb 15th, 2007
0

Re: Javac

Javac is what is called when you hit the button for compiling in your IDE and like in IDE if you have errors it will output them for you if no errors you simple get empty command line to execute another command
Applet is java file, just instead of using main method you call init to start applet and stop to stop it
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Feb 15th, 2007
0

Re: Javac

Click to Expand / Collapse  Quote originally posted by peter_budo ...
Javac is what is called when you hit the button for compiling in your IDE and like in IDE if you have errors it will output them for you if no errors you simple get empty command line to execute another command
Applet is java file, just instead of using main method you call init to start applet and stop to stop it
Peter:

Thank-you for your reply.

[html]The source for that class must live in a plain text file with the same name (including case), with a *.java extension.[/html]

Code for Tutorial
[php]public class MyApplet extends java.applet.Applet {
public MyApplet( ) { //create applet
System.out.println("In ctor");
}
public void init( ) { // initialize
System.out.println("In init");
}
public void start( ) { // display page
System.out.println("In start");
}
public void stop( ) { // leave page
System.out.println("In stop");
}
public void destroy( ) {// clean up
System.out.println("In destroy");
}
}[/php] I am bit confused still about the use of "*":

[html]Create a Panorama Applet class and HTML file. Override the init method and print outa trace message. Test and verify the message is printed.Here are the steps:
1. Create Panorama.java using a text editor.
*In the file, add a public Panorama class and have it inherit from
java.applet.Applet.
*In the class, add an init method that takes no arguments and returns void.
*In init, issue System.out.println of "In Panorama.init". This provides amessage when the method is invoked that traces the flow through the applet.Continue to add trace output to all methods you add to the applet.
*Save the file and exit the editor.[/html]
Any input would be appreciated.
Thank-you,
MattyD
Featured Poster
Reputation Points: 105
Solved Threads: 1
Posting Maven
mattyd is offline Offline
2,582 posts
since Oct 2006
Feb 15th, 2007
1

Re: Javac

Click to Expand / Collapse  Quote originally posted by mattyd ...
The source for that class must live in a plain text file with the same name (including case), with a *.java extension.
I am bit confused still about the use of "*":
Asterix "*" stands for any, it this case they just try to say put there a name you want like myApplet.java. Also "plain text file" is little distracting but take it that this way, they expect you to type your code in notepad and when saving give it java extention. Not everybody start with IDE's, I did my first few months of coding in notepad and compiled all in command prompt :cheesy:

To the rest of your question about applet and Panorama.init I can't comment, I did only requered part of applet coding at university and never returned back to it again. It didn't impress me :rolleyes:
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Feb 15th, 2007
0

Re: Javac

Click to Expand / Collapse  Quote originally posted by peter_budo ...
Asterix "*" stands for any, it this case they just try to say put there a name you want like myApplet.java. Also "plain text file" is little distracting but take it that this way, they expect you to type your code in notepad and when saving give it java extention. Not everybody start with IDE's, I did my first few months of coding in notepad and compiled all in command prompt :cheesy:

To the rest of your question about applet and Panorama.init I can't comment, I did only requered part of applet coding at university and never returned back to it again. It didn't impress me :rolleyes:
Thank-you for your help.
Much appreciated.

Kind Regards,
Matty D
Featured Poster
Reputation Points: 105
Solved Threads: 1
Posting Maven
mattyd is offline Offline
2,582 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: more syntax questions
Next Thread in Java Forum Timeline: Timer Component in JAVA





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC