- JTextArea contents = new JTextArea(s, 30, 40);
- contents.setAutoscrolls(true);
- pane.add(contents);
- contents.setBounds(10, 10, 500, 350);
+ pane.add(new JScrollPane(new JTextArea(s, 30, 95)));
+ Action close = new AbstractAction("Close") {
+ public void actionPerformed(ActionEvent ae) {
+ setVisible(false);
+ }};
+ JButton closeButton = new JButton(close);
+ closeButton.setAlignmentX(Component.CENTER_ALIGNMENT);
+ pane.add(closeButton);