Hi
I need some help.... Here is what Im trying to do....I havent worked with java in about 4 years.
I have created a JOptionpane showInputDialog with a list of options to choose from inside a method. What I want to do next is once one of those options is selected to call upon another method. Im not sure how to do that. I tried to create variables and assign them to the value of the object and then create an if statement to compair the two.
public static void selectTask()
{
//In initialization code:
Object[] possibleValues = { "Print", "Borrow", "Return", "Quit" };
Object selectedValue = JOptionPane.showInputDialog(null, "What Would You Like To Do?", "SELECT A TASK", JOptionPane.INFORMATION_MESSAGE, null,
possibleValues, possibleValues[0]);}
I also tried to call upon the aray and that did not work either....
if
((selectedValue != null) && (possibleValues =[1]))
JOptionPane.showMessageDialog(null,"TEST TO SEE IF WORKS", "WELCOME",JOptionPane.PLAIN_MESSAGE);
Am I way off in what Im trying to do...Any help would be greatly appreciated....Or a suggestion on a simpler way to do this.