![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2004
Posts: 18
Rep Power: 0
![]() |
once you create an applet you do have to compile it right? or do you just save it and it will work?
i created an applet and i have saved it and i have also compiled it but i am still getting a broken image when i try to view it. i am using the 30 day trial of JCreator which is pretty nice if i may add. :dancing: i beleive that you have to place your application where u have the html file so they can work together once you view it. like having an index of ur webpages and all the files that accompany it in order for it all to work together. i have to run to work now, if i am unclear about anything and more info is needed i will post back here later. thanks all |
|
|
|
|
|
#2 |
|
Professional Programmer
|
You need to compile the applet just like any other java program. The you must create a html file that runs the applet, that is, if you're doing it from the command line, I don't know how JCreator works, but i'm making an educated guess that it will probably generate a html file for you. If you installed the sun java package, there is a program called appletviewer that will let you run the html file with that applet in it, and it should start.
-JSS |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Dec 2004
Posts: 18
Rep Power: 0
![]() |
i must be missing the appletviewer or something because from what i understand JCreator has created the .html file already, except i keep on getting a broken image.
thanks for the help dizzutch ill see what i can do. |
|
|
|
|
|
#4 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
I use Jcreator, so if you post the code, I'll give it a try for you and see what I get.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#5 | |
|
Newbie
Join Date: Dec 2004
Posts: 18
Rep Power: 0
![]() |
ok i reinstalled it and it worked. i guess it wasnt compiling right before thats why it wasnt posting all the files in the "classes" folder.
i do have on question anyways. i tried to create an applet, it posted all the files after compiling and all accept when i few the html file it posts "Welcome to Java!!" now that is nice accept my code tells it to print something totally different. Quote:
|
|
|
|
|
|
|
#6 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Try this:
import java.awt.*;
import javax.swing.*;
public class applet1 extends JApplet
{
public applet1() {}
public void paint(Graphics g)
{
g.drawString("To climb a ladder, start at the bottom rung", 20, 90);
}
public static void main( String[] args )
{
JFrame window = new JFrame();
window.setBounds( 10, 10, 300, 300 );
applet1 applet = new applet1();
applet.init();
window.getContentPane().add(applet, BorderLayout.CENTER );
window.show();
}
}
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|