Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert application to applet

 
Mike Adamchuk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am very new to java and am having trouble getting an application which I am trying to convert into an applet to run in a web page. I have replaced the constructor in Main() with the Init() method and included all of Main()'s code within Init(){..}. I have it so that the webpage says "Applet Main Started", however nothing shows up but the grey applet box. One issue that could be causing a problem is that in order to get this far, I had to change this line of code- Container content = getContentPane();- to- JPanel content = new JPanel();- in order to get the application to compile and produce the .class files. Any help or direction would be appreciated.
Thnks from a Java newbie
mpa
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How big is your source file? If it's not too large you could post it here. It's a lot easier to help you if we have access to the source code!
When you post your source code, please use the CODE tags to format it. The easiest way is to use the "CODE" button that is located below the message box, under "Instant UBB Code".
 
Mike Adamchuk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob, My source code is about 150 lines long for the Main.java file so I will provide the important parts here (very beginning and very end). Also, I changed the code so Main extends JApplet so that it is Swing compliant and I can use the "Container content = getContentPane();" code at the end of the page, instead of having to change it to "JPanel content = new JPanel();".
-----------------START OF CODE-------------------

-------------------END OF CODE-------------------------------
Is this enough of the code for you and do you need to know anything else about how the program is set up?
thanks-
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic