Set an option from a choice object

219 Views Asked by At

So I am trying to set an option to be shown when you select something from a choice. For example:

Choice selection = new Choice();

selection.add("Please select");
selection.add("Add");
selection.add("Remove");

I am using these to switch between JPanels containers, when it is on add it will show one screen, when it is on remove it will show the other. The issue I am having is, let's say you're on the add screen and the selection says 'please select', so you go to remove. Remove will then be the selected option on the remove page, so when you go back to that page to try and add something, the selection says 'remove'.

I was just wondering is there was a way to set which option is being shown? There is no panel for the 'please select' choice which is why I want to have this selected after you have made your selection.

0

There are 0 best solutions below