import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.*;/***Erstellt ein Fenster mit Zeilenummerrieung*/class TextFeld extends JTextArea{ //Konstruktor TextFeld(String text){setText(text); Border border = BorderFactory.createMatteBorder(0, 25, 0, 0, Color.lightGray); setBorder(border);} public void paintBorder(Graphics g) { super.paintBorder( g); for ( int i = 1;i <= getLineCount()+40;i++){ g.drawString ( "" + i,20 - g.getFontMetrics().stringWidth("" + i ),i * g.getFontMetrics().getHeight()-3); } } }