-1

As the title says - I am trying to figure out a way to make a small gap, say 5 pixels, between the line separating line numbers and the source code in a RSyntaxTextArea instance of my editor. I was looking at the API and found nothing...

NOTE: I am using the latest version available on Maven central - v2.5.3.

Here is a simple demo where you can see how close the gap is: enter image description here

4

1 回答 1

-1

我问这个问题太快了...... RTextAreaBase 提供了 getMargin() 和 setMargin() 方法,可用于更改组件的插图。

以下简单的行增加了差距:

// Increase the gap between the (vertical) margin line and the source code.
Insets in = textArea.getMargin();
textArea.setMargin(new Insets(in.top, in.left + 5, in.bottom, in.right)); 
于 2014-11-11T12:56:52.807 回答