[填空题] 本题的功能是在文本域面板中添加一个带有行数的面板。窗口中有一个文本域,在文本域的左侧有一个带有数字的面板,该面板上的数字指示着文本域中的行数。
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
public class java3 extends JFrame
public static JTextPane textPane;
public static JScrollPane scrollPane;
JPanel panel;
public java3()
super("java3()");
panel=new JPanel();
panel.setLayout(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(20,20,20,20));
textPane=new JTextPane();
textPane.setFont(new Font("monospaced",Font.PLAIN,12));
scrollPane=new JScrollPane(textPane);
panel.add(scrollPane);
scrollPane.setPreferredsize(new Dimension(300,250));
setContentPane(panel);
setCloseOperation(JFrame.EXIT_ON_CLOSE);
LineNumber