previous |
start |
next
Text Components
- JTextField holds a single line of text
- JTextArea holds multiple lines
- Construct with new JTextArea(rows, columns)
- textArea.append(aString) appends text
- Use textArea.setEditable(false) to use for display
only
- To add scroll bars, use
JScrollPane scrollPane = new JScrollPane(textArea);
textArea.setContentPane(scrollPane);
previous |
start |
next