How would I do this Question

Hello and thanks for your time. The program I am trying to develop is something that would calculate the start value of a gymnastics routine. Basically there are two components to it:

Firstly there is a drop down menu with a long list of different gymnasics moves, that move is assigned a point value, the point values are added up to create the total start value of the routine.

Secondly I want a text box of sorts that would list all the different moves that the user entered. Perhaps under the drop down menu an "Add" button of sorts to add the selected item to the list.

I have the drop down menu, the point counter, and the GUI all developed, i just have to add that second component to the program and I am having difficulty wraping my mind around what I would use to do something like the second component I want.

Thanks for your help and advise, it is very much appreciated!

-Ian

[924 byte] By [Stemmana] at [2007-11-27 8:28:26]
# 1

What about a JTextArea? You could setEditable(false) since you don't want to type in it directly.

Or you could use a JList. That would allow you to select items from this list for a remove function (in case one or more items were added by mistake).

Message was edited by:

Hippolyte

Hippolytea at 2007-7-12 20:18:25 > top of Java-index,Java Essentials,New To Java...
# 2
I like the idea of a JList. What do you mean by a remove function though?
Stemmana at 2007-7-12 20:18:25 > top of Java-index,Java Essentials,New To Java...
# 3

> I like the idea of a JList. What do you mean by a

> remove function though?

Have you even seen a GUI where you are asked to choose items from a list? Often it is set up like this: a list of the possible choices on the left, your selection list on the right and arrow buttons (<--, -->, and more) in between. You select items on either list and then press the appropriate arrow to move the selected items to the opposite list. Button --> adds items to your selection; button <-- returns selected items to the choice list.

Hippolytea at 2007-7-12 20:18:25 > top of Java-index,Java Essentials,New To Java...
# 4

Thats what I thought you meant. I'm assuming I would be able to set it up so I could move from the left side to the right side without removing it from the left side?

I'm no gymnast, i'm doing this for a family member, but I'm assuming they might repeat the same skills over and over again.

Stemmana at 2007-7-12 20:18:25 > top of Java-index,Java Essentials,New To Java...
# 5

> Thats what I thought you meant. I'm assuming I would be able to set it up so I

> could move from the left side to the right side without removing it from the left side?

Sorry, I was just describing a typical GUI, but since you are writing the code to do this, I'm sure you could make it so that items wouldn't disappear from the left list and could appear multiple times on the right list.

Hippolytea at 2007-7-12 20:18:25 > top of Java-index,Java Essentials,New To Java...
# 6
thanks for your help!I'm on the right track now :)
Stemmana at 2007-7-12 20:18:25 > top of Java-index,Java Essentials,New To Java...