Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Interface - Web based, Applet, Swing?

 
Ray Muirhead
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm developing a new text-based adventure / rpg game (no graphical skills) to help me learn Java, and I was wondering if anyone has some experience with making interfaces for text-based games (or graphical ones with menus etc in them).

I've thought it over, and I definitely need a gui, as just parsing from and printing to System.out doesn't really work that well. I'm still not sure where to proceed from here, but I thought that maybe a great way to do it would be through a browser, which would give a great, easy and flexible interace (esp. for character creation) without a lot of messy gui programming.

Does anyone know of a way to link a Java application with a HTML interface like this (for free)? Basically it would be really nice to have a bunch of forms and textfields for input, and just put the text out as a normal web page. The game could then be played in a more open way, allowing copy and pasting instead of typing. I don't really know how to begin, does anyone have experience with anything like this?

Cheers
 
Ray Muirhead
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, I found the Common DOM API, which was exactly what I was looking for. Still interested in anything anyone has to say on the subject of game gui design though, so please share a little of your wisdom.

Cheers,

Ray
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're interested in a web-based application, the Struts framework may be something to look into. It has some very powerful form validation and also helps you to use an MVC type architecture so that the logic that creates your "view" (the web pages) is seperate from the logic that controls your game.

There's a lot of great books and tutorials out there about Struts, and also we have a Struts forum, so check it out -- and see if you think it will fit for your situation.

(note -- also if you do it this way -- with your game-logic nicely seperated from your view-logic, if later you decide you want to have this be a Swing-based application, it won't be SO hard to convert it)
 
Ray Muirhead
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks Jessica. I might use the DOM / Applets thing anyway, just so that I'll be able to post it on a client side-only website (you can do that with applets, right?). There is a really cool Java API for Mozilla being developed that is worth checking out, in my opinion. You can basically create an applet that has no body and just manipulates the HTML to gain it's effects. Thanks for the MVC head's up too, exactly what I wanted to do but didn't know it yet.

Cheers,

Ray
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!