Results 1 to 6 of 6
- 10-13-2012, 03:35 AM #1
Member
- Join Date
- Oct 2012
- Location
- Utah
- Posts
- 2
- Rep Power
- 0
GlassFrame/ JFrame text adventure
I am trying to program a text adventure with JFrame, and I think that in order to let buttons update the frame with new contents that involve text, I need to use GlassFrame.
My dilemma is both that I'm not sure, and that I don't know how to utilize GlassFrame into the program.
Currently, I have the opening-room-text hardcoded into the paint method, but that clearly won't allow it to update and change the text.
- 10-13-2012, 03:47 AM #2
Re: GlassFrame/ JFrame text adventure
What exactly do you mean when you say "update the frame with new contents that involve text"? I don't think that necessarily requires a GlassPane, but if you do want to go that route, start here: A well-behaved GlassPane | Java.net
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-14-2012, 02:39 AM #3
Member
- Join Date
- Oct 2012
- Location
- Utah
- Posts
- 2
- Rep Power
- 0
Re: GlassFrame/ JFrame text adventure
I want to display a paragraph of text (e.g.: What do you want to do? A. Go North. B. Go South) and have a series of buttons that will then display a different paragraph of text (e.g.: You go north and fall in a hole.). It's relatively easy to do this with "regular" java (displaying the text in command promt and getting keyboard input), but I want to do it with JFrame, and I was under the impression that GlassPane was required, but I may be wrong about that.
- 10-15-2012, 03:08 PM #4
Re: GlassFrame/ JFrame text adventure
GlassPane is not required, and probably not even the best solution. Depending on what you want to do, you could extend JPanel and override paintComponent, or just use a JLabel or a JTextArea.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-18-2012, 04:58 AM #5
Re: GlassFrame/ JFrame text adventure
Guesswork isn't fun. Start with this page and work your way through and you'll be on top of things: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 10-18-2012, 04:59 AM #6
Similar Threads
-
Working on an Open Source text adventure / RPG
By CodeMonkeyAlx in forum Java GamingReplies: 3Last Post: 09-07-2012, 04:02 PM -
Need help with my Text Adventure game [Please Read]
By MastaChief11 in forum New To JavaReplies: 21Last Post: 07-21-2012, 04:17 PM -
Newton Adventure
By java software in forum Java SoftwareReplies: 0Last Post: 12-29-2011, 05:46 PM -
Text adventure setup
By xsimsyx in forum New To JavaReplies: 8Last Post: 03-16-2010, 11:32 PM -
Text Adventure Command Parser Exercise - Trying to do it the OOP way.
By derrikc in forum New To JavaReplies: 0Last Post: 07-07-2009, 06:22 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks