You need a JOptionPane. Use something like the following code snippet inside the JButton ActionListener:
JTextArea textArea = new JTextArea(); textArea.setEditable(true); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.requestFocus(); textArea.requestFocusInWindow(); scrollPane.setPreferredSize(new Dimension(800, 600)); JOptionPane.showMessageDialog( (ControlWindow) App.controller.control, scrollPane, "Paste Info", JOptionPane.PLAIN_MESSAGE); String info = textArea.getText();
You can parse / confirm the double value from the output string. You can also use various swing components - this example is a scrollable text area.
source share