I am creating a simple option pane that asks for multiple user inputs. I have specified the labels and text fields, but at the end of my option pane, there lies a text field that doesn't belong to any variable, so I'm guessing it comes along when specifying the option pane.
Here's my code:
JTextField locationField = new JTextField(10);
JTextField usedByField = new JTextField(5);
JTextField commentField = new JTextField(50);
...
myPanel.add(new JLabel("Location: ");
myPanel.add(locationField);
myPanel.add(new JLabel("Used By: ");
myPanel.add(usedByField);
myPanel.add(new JLabel("Comments: ");
myPanel.add(commentField);
...
JOptionPane.showInputDialog(myPanel);
My dialog ends up looking like this, and as you can see there is a stray text field at the bottom of my pane:
My question is, where in my code would I be secretly specifying this? I don't think I am, so how do I go about in order to get rid of this stray text field that I don't need.
Thank you.