import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextArea;
public class JTextAreaScrollPane extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
JTextAreaScrollPane frame = new JTextAreaScrollPane();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public JTextAreaScrollPane() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JTextArea textArea = new JTextArea();
textArea.setLineWrap(true);
textArea.setBounds(61, 41, 330, 182);
contentPane.add(textArea);
JScrollPane jsp = new JScrollPane(textArea);
jsp.setBounds(61, 41, 330, 182);
contentPane.add(jsp);
}
}