我想要做的是有一个JTextArea而不是JTextField的JOptionPane inputDialog。
我试图把JTextArea的消息参数的内部,像这样JOptionPane自定义输入
Object[] inputText = new Object[]{new JLabel("Enter Graph Information"),
newJTextArea("",20,10)};
graphInfo=(String)JOptionPane.showInputDialog(null,
inputText,
"Create Graph",
JOptionPane.PLAIN_MESSAGE,
null,
null,
"");
但它仍然具有文本字段在底部,我不能从JTextArea中的文本。 有没有办法删除原始文本字段,并从jtextarea中获取文本或完全替换文本区域的文本字段?如果可能,我试图避免必须进行自定义对话框,这“看起来”像是应该很容易做的事情?
可能重复【JAVA - 如何创建自定义对话框(http://stackoverflow.com/questions/789517/java-how-to-create-a-custom-dialog-box) – Tony 2014-10-25 11:38:46