I'm trying to put a TextBox & a Button in a JOptionPane.showOptionDialog horizontally. I've used this code.
JTextField txt = new JTextField();
JButton btn = new JButton("Button");
int value = JOptionPane.showOptionDialog(this,
new Object[]{txt, btn},
"Hello World",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null, null, null);
But TextBox & Button showing vertically. How can I show them in horizontally ? Please help... Thanks.