Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Embedding my game on website.  (Read 2160 times)
0 Members and 1 Guest are viewing this topic.
Offline herah

Senior Newbie

« Posted 2013-02-19 23:48:43 »

Hey everyone, I am completely new to making java applets and just built my first game. It's an executable jar file and I'd like to link it here as well as add it to my own wordpress webpage. I don't understand what needs to be done to do this however. I have the plugin for wordpress and I guess I just dont understand what I need to put in.

<code>[applet code="your.applet.ClassName" file=""]</code><br />

I know the url to my file, but not what to put in for your.applet.ClassName.  I have been trying to just put in the name of the class with my main method in it but get an error.

Thank you, I realize this is a pretty dumb question but I dont get it.
Offline philfrei
« Reply #1 - Posted 2013-02-20 02:11:54 »

Neat! I didn't know WordPress had an Applet plugin! Where did you get it? I want to get a copy for my site.

It wouldn't be an invocation of the "main()" method, because that is for applications and not applets.

The name should be a JApplet or Applet object, and you should include the package structure as part of the url.

music and music apps:
Offline ra4king

JGO Kernel

Medals: 508
Projects: 3
Exp: 5 years

I'm the King!

« Reply #2 - Posted 2013-02-20 02:35:24 »

@Philfrei, search in the plugin market for "Java Applet Embed" Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline herah

Senior Newbie

« Reply #3 - Posted 2013-02-20 15:23:35 »

Ah I see, that makes sense now. I guess the problem is that I have never made an applet before and don't know how to go about changing my program into an applet. From the small amount of reading I did, it seemed that I needed an applet class, then have my game extend applet. I must be misunderstanding this because my classes already extend frame so i can't seem to also extend applet. I dont know if this makes any sense. As I said, I am brand spanking new to this. I'd be happy to send my file to someone if it would make more sense for help converting it.

Thanks for the replies.
Offline philfrei
« Reply #4 - Posted 2013-02-20 23:36:30 »

JFrame is a top-level container. So is JApplet. Everything has to be contained in either one or the other.

There is an article that shows how to make a next-to-top level container that can be dropped into either, so you don't have to do a lot of "duplicate" coding at the top. It's somewhere in the "deployment" section of the tutorials, but I have to run and can't track it down right now. Sorry.

 [EDIT: I'm back. I found this link which makes a reference to making a top-level JPanel. This isn't the article I remember, but this is pretty much the idea, that either the JFrame or the JApplet can display the same JPanel.

By the way, a jar file can contain both a JFrame and a JApplet, but only one or the other gets invoked when you run the program. In other words, if you have a class with a main() in it, but you use the html to open the jar, you would address the JApplet (or subclass) not the class with the main().]

music and music apps:
Pages: [1]
  ignore  |  Print  

hadezbladez (276 views)
2018-11-16 13:46:03

hadezbladez (154 views)
2018-11-16 13:41:33

hadezbladez (287 views)
2018-11-16 13:35:35

hadezbladez (69 views)
2018-11-16 13:32:03

EgonOlsen (2124 views)
2018-06-10 19:43:48

EgonOlsen (2148 views)
2018-06-10 19:43:44

EgonOlsen (1361 views)
2018-06-10 19:43:20

DesertCoockie (1957 views)
2018-05-13 18:23:11

nelsongames (1598 views)
2018-04-24 18:15:36

nelsongames (2246 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!