Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
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 621 times)
0 Members and 1 Guest are viewing this topic.
Offline herah

Senior Newbie





« Posted 2013-02-20 00: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="http://domain.com/full/path/to/yourJar.jar"]</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 03: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.


"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #2 - Posted 2013-02-20 03: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 16: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-21 00:36:30 »

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

http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html

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 http://docs.oracle.com/javase/tutorial/deployment/applet/developingApplet.html 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().]

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (23 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org 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‑gaming.org
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!