Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 4th, 2005, 7:08 AM   #1
Cup O' Java
Newbie
 
Cup O' Java's Avatar
 
Join Date: Dec 2004
Posts: 18
Rep Power: 0 Cup O' Java is on a distinguished road
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
Cup O' Java is offline   Reply With Quote
Old Jan 4th, 2005, 9:00 AM   #2
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
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
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Jan 4th, 2005, 6:48 PM   #3
Cup O' Java
Newbie
 
Cup O' Java's Avatar
 
Join Date: Dec 2004
Posts: 18
Rep Power: 0 Cup O' Java is on a distinguished road
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.
Cup O' Java is offline   Reply With Quote
Old Jan 4th, 2005, 7:08 PM   #4
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Jan 4th, 2005, 8:14 PM   #5
Cup O' Java
Newbie
 
Cup O' Java's Avatar
 
Join Date: Dec 2004
Posts: 18
Rep Power: 0 Cup O' Java is on a distinguished road
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:

import javax.swing.JApplet;
import java.awt.Graphics;

public class applet1 extends JApplet
{
public void paint(Graphics g)
{
g.drawString("To climb a ladder, start at the bottom rung", 20, 90);
}
}
Cup O' Java is offline   Reply With Quote
Old Jan 8th, 2005, 4:50 PM   #6
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC