Results 1 to 2 of 2
Thread: My application Will Not Execute
- 07-16-2007, 09:55 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 26
- Rep Power
- 0
My application Will Not Execute
I then used 'javac' to convert that into a file named 'MyProgram.class'.
MyProgram.java
I have an html that looks like this:Java Code:public class MyProgram { public static void main(String[] args) { System.out.println( "Eureka, I can put Java on my resume."); } }
Now I am quite new to java and i'm not sure but I think my software is ok so if i can get an explanation to why this only displays a little white piece of paper with a red 'X'.Java Code:<html> <head> <title></title> </head> <body> <applet width="300" height="300" src="MyProgram.class"></applet> </body> </html>
- 08-07-2007, 05:16 AM #2
Member
- Join Date
- Jul 2007
- Posts
- 40
- Rep Power
- 0
Have a look at Java's own Applet tutorial, Lesson: Applets (The Java™ Tutorials > Deployment)
Code snippets you'll want to look at:
Java Code:<applet code=HelloWorld.class width="200" height="200"></applet>
Also Java's API is invaluable. Familiarize yourself with it and it will help you solve many problems very quickly. Java 2 Platform SE v1.3.1Java Code:import javax.swing.JApplet; import java.awt.Graphics; public class HelloWorld extends JApplet { public void paint(Graphics g) { g.drawRect(0, 0, getSize().width - 1, getSize().height - 1); g.drawString("Hello world!", 5, 15); } }
Java tutorial site: The Java™ Tutorials
Usually when I need to find something Java related I head to Google, search: Java api 'whatever' and will find a related document in the api files.
Example: for this thread a googled: Java api Applet and that tutorial was the first link.
Greetings.
Similar Threads
-
cannot execute EJB application.
By JavaEmpires in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 07-17-2008, 09:53 AM -
Execute Jar file
By barney in forum New To JavaReplies: 1Last Post: 08-07-2007, 07:13 AM -
problems when I try to execute a jsp page
By christina in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 08-01-2007, 12:23 PM -
why does not execute this?
By aleplgr in forum New To JavaReplies: 6Last Post: 08-01-2007, 11:37 AM -
Execute a new program in java
By mathias in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:42 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks