Author | Message |
---|---|
dvictor4
Posts: 34
|
Posted 20:46 Feb 23, 2017 |
Hi so my menu for this lab has 12 menu choices and when I run it the menu does not fit in the screen. Is there a workaround or a way to fix this? Last edited by dvictor4 at
20:46 Feb 23, 2017.
|
JCA08
Posts: 12
|
Posted 22:44 Feb 23, 2017 |
First make a String array of your options you are displaying. You can use JOptionPane.showInputDialog with the following parameters. (null, "A", "B", JOptionPane.QUESTION_MESSAGE, null, choices, choices[0]). A is any message you want to display. B is your dialog box's title. choices is your array of Strings. choices[0] is just the index where you want to start the drop down list. This will allow you to use a drop down menu. You might also need to cast the JOptionPane into a String, hence you'll have you take the return type into account if you're using a switch.
Last edited by JCA08 at
22:46 Feb 23, 2017.
|
dvictor4
Posts: 34
|
Posted 22:56 Feb 23, 2017 |
Is there a way to return the index of the selection? The return value is the string of the selection. |
agoyal3
Posts: 4
|
Posted 00:06 Mar 03, 2017 |
Do we have make methods to add and drop students or faculty members in driver class or in their respective classes? |
ifiguer
Posts: 27
|
Posted 21:30 Mar 03, 2017 |
I ran to the same problem. You could just create sub menus for certain selections. |