File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes GUI Labels and Buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GUI Labels and Buttons" Watch "GUI Labels and Buttons" New topic

GUI Labels and Buttons

Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
Hey yo,

Aparently I have been doing text-based java for a bit too long and im rusty on the GUI side, im making a really simple archery game with the target on the top of the window and the shots, score and restart button on the bottom. I have the target done fine but I just cant remeber how to atucally add labels and buttons :S. Below is my code so far:

I feel like a complete idiot because I just cant remember what to do, i know it has something to do with creating a panel but other than that im lost, any help would be greatly apreciated.
[ November 04, 2004: Message edited by: Peter Shipway ]
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805

[ November 04, 2004: Message edited by: Jeff Bosch ]

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
Hey yo,

Thanks for that, I have another problem now however How do i add the Content pane to the atucal window? As i dont think its possible to add the shapes to a content pane (or not the way im doing it) here is my new code:

Again any help would be great
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
see if this makes any more sense

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
You might get more help if you ask this question at the Swing / AWT / SWT / JFace forum. That is the place to discuss GUI programming around these parts.


p.s. Maybe an admin can just move this thread for you.

Java API Documentation
The Java Tutorial
Joel McNary

Joined: Aug 20, 2001
Posts: 1824


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
I agree. Here's the link:
subject: GUI Labels and Buttons
jQuery in Action, 3rd edition