JScrollpane行标题查看行号

时间:2013-01-15 10:44:19

标签: java swing

  

可能重复:
  Line numbers in jtextpane in Netbeans

我想实施亚麻布。

   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);

但我在亚麻布和文字之间转换。我该怎么做才能将行文本和亚麻布编号放在一行中?

0 个答案:

没有答案