我想实现行号。
JTextpane linenumbers = new JTextPane("1\n2\n3\n4\n");
// in my project I'm using a function to generate the String with the numbers.
//I think that this is not important for my problem.
JTextPane text = new JTextPane();
JScrollPane scroll = new ScrollPane(text);
scroll.setRowheaderView(linenumbers);
// I'm adding my scroll to my extended JFrame-Class
this.add(scroll, BorderLayout.CENTER);
但我在行号和文本之间转换。我必须做什么才能将行文本和行编号放在一行中?