I've been trying to find a way to gain access to all the JFRAME functionality
like buttons etc in an applet which is being doublebuffered. Is there any
way to have these buttons etc and chat style panes in an applet?
EXAMPLE:
Say I'm making a small game. In this game I am using something like:
// The paint function handles all the paint requests to draw things to the screen public void paint(Graphics g){ bg.clearRect(0, 0, appWidth, appHeight); // Refresh the background first // GUI PLACEMENT bg.setColor(Color.orange); bg.fillRect(640, 685, 260, 70); // PROGRESS QUICKVIEW bg.setColor(Color.red); bg.fillRect(740, 655, 80, 30); // SERVER TIME //////// MORE CODE HERE ///////// // Finally output the prepared screen g.drawImage(buffer,0,0,this); }
BUT ..... I want to be able to use the JFrame things like buttons to choose
items in the game, and I want to be able to implement a little chat client in
the game as well ......
What would you recommend I do to accomplish this?
I was thinking about writing it all from scratch, boundary boxes and parsing
text to fit inside for the chatbox etc ... and then for the buttons / hotkeys
in the game but JFrame buttons in there to do all the actions but I'm
starting to think that I'm tackling this in the wrong way entirely.
Any help please? Or would using JFrame properties inside my applet work?
VERY IMPORTANT: This is to be embedded into a website so it cannot have
standard windows style borders etc, I just want to utilise the JFrame assets
like buttons etc ...
Anyway any help you can offer me would be appreciated.
Regards
gam35guru