Campos de texto: JTextArea
JTextField es un componente que muestra una sola línea de texto, en cambio JTextArea muestra múltiples líneas de texto. Ambos componentes muestran todo su texto en el mismo formato (fuente, color...), sin embargo, es factible modificar esos dos parámetos y no usar los que Java implementa por defecto.
JScrollPane pScroll = new JScrollPane(texto, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
p1 = new JPanel(new BorderLayout()); //panel
contenedor principal
... / ...
p1.add(pScroll, BorderLayout.CENTER); //el panel principal contiene a JScrollPane
y éste a su vez a JTextArea

// CLASE QUE AÑADE LÍNEAS DESDE JTEXTFIELD A TEXTAREA
class ponerTexto implements ActionListener {
public void actionPerformed(ActionEvent evt) {
String texto = texto1.getText();
/* 16 líneas como máximo, mostrando al principio el número de línea
* mostrar un cero antes del número de línea hasta llegar a 10 */
if (orden<16) {
if (orden<9) {
texto2.append("0" + (orden+1) + " - " + texto + newline); }
else if (orden>=9)
{ texto2.append((orden+1) + " - " + texto + newline); }
// posicionarse siempre en la última línea de JTExtArea
texto2.setCaretPosition(texto2.getDocument().getLength());
orden++; }
else {
texto1.setFont(new java.awt.Font("Arial", Font.BOLD, 12));
F2 = new Color(255,0,0);
texto1.setForeground(F2);
texto1.setText("No se pueden añadir más de 16 líneas."); }
}
}
// CLASE QUE VACÍA TEXTAREA
class limpiarTexto implements ActionListener {
public void actionPerformed(ActionEvent evt) {
texto1.setFont(new java.awt.Font("Arial", Font.PLAIN, 12));
F3 = new Color(0,0,0);
texto1.setForeground(F3);
texto1.setText(texto1Inicio);
texto2.setText("");
orden=0;}
}