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

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

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.

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

Code for Tutorial

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");
    }
}

I am bit confused still about the use of "*":

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.

Any input would be appreciated.
Thank-you,
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:

commented: help with applets\\ thanks, mattyd +3

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.