Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help with JApplet

Name: Anonymous 2008-12-19 18:04

I need to write an event driven JApplet, with 15 labeled buttons. The buttons say nearly identical things, with the exception of a number. I do not want to write them individually, and I need to know a way I can group them in a JApplet.

Essentially I need a way I can just write one string such as:
buttons [i] = new JButton ("Seat " + (i+1) + " is open.");
and have it label all the buttons.

I have an hour to figure out how to do this.
Help is greatly appreciated.

Name: Anonymous 2008-12-20 0:56

I have another question.

I need to know how I would write
(buttons [i] == e.getSource ()

as an e.ActionCommand, such as
(e.getActionCommand( ).equals("Exit"))

I've tried writing it as
(e.getActionCommand( ).equals(buttons [i])
and while it doesn't bring back any errors, it doesn't do what I need it to.

I'm trying to write an if-else statement for the buttons that brings up a dialog box such as
JOptionPane.YES_NO_OPTION
I know how to bring up the dialog box as long as I can find a way to call the buttons [i] into the statement.

It doesn't have to be an e.ActionCommand, it just needs to be able to call buttons [i] into the statement.

I know these seem like dumb questions... I just really suck at JApplets.

Any help is greatly appreciated.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List