Results 1 to 6 of 6
Thread: Cannot complie JApplet in Eclipe
- 04-14-2010, 02:38 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 16
- Rep Power
- 0
Cannot complie JApplet in Eclipe
I try to complie JApplet in Eclipe but it doesn't work.
No error but nothing shows in the program.
The program works fine with run as application but not as applet.
Java Code:package dicegame; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class game extends JApplet { public static void main(String[] args) { JFrame window = new JFrame("game"); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.setContentPane(new roll()); window.setSize(240, 300); window.setLocationRelativeTo(null); window.setVisible(true); } }
- 04-14-2010, 03:52 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Simple, this is not an applet.
What the roll() do, where you define it? I cannot see the definition of it in your code.
- 04-15-2010, 03:43 AM #3
Member
- Join Date
- Apr 2010
- Posts
- 16
- Rep Power
- 0
roll() is from my JPanel class.
How can I made this into JApplet?
I must use with MySql for assignment.
I am new to Java, sorry if I make you feel ignore.
- 04-15-2010, 03:45 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
So what you want to do in the Applet? Better to explain more clearly. And also please keep in mind that no one wants to do your assignment. You must put some effort. :)
-
- 04-15-2010, 04:07 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Seems he just copy the code and extend the applet without having a better idea. I think it's better to go through the following at least before start to work on yours.
Getting Started With Applets (The Java Tutorials > Deployment > Applets)
Similar Threads
-
JApplet on MAC
By ld_pvl in forum Java AppletsReplies: 0Last Post: 08-23-2009, 01:40 PM -
How to set permissions for a JApplet
By Gatts79 in forum Java AppletsReplies: 2Last Post: 08-12-2009, 01:54 PM -
hi,can anyone help with the following code,i could not complie because its got errors
By omutaoka in forum New To JavaReplies: 3Last Post: 03-03-2009, 09:48 PM -
JFrame to JApplet or JApplet to JApplet
By ramesh.8189 in forum AWT / SwingReplies: 13Last Post: 02-08-2009, 06:14 AM -
JApplet Problem
By tanmoy.b81 in forum AWT / SwingReplies: 2Last Post: 07-28-2008, 06:56 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks