nordfalk/jsyntaxpane

How to disable line numbers

Closed this issue · 1 comments

I want to remove the line numbers area. I found no informations and i didn't 
get it working on my own. 

When i add a syntax kit to the editor pane before putting it into a scrollpane 
there is a warning message that there will be no line numbers, but 
unfortunately i get a NPE at LineNumbersRuler.java line 106 if i do so. 

Is it possible to remove the line numbers and if so,  how to do that?

I use version 0.9.5-b29.

Original issue reported on code.google.com by teenriot...@googlemail.com on 14 Oct 2010 at 5:15

You can remove line numbers, and any other component / element you do not want, 
such as matching pairs, auto insert of closing quote, bracket.
There is more than one way to do it too.
1.  Edit the config.properties for either the kit you will use or for the 
default.  You can then either replace the file in the jar, or put it under the 
same path where in you classpath.  Note that the classpath is searched in 
sequence, so make sure you put it in a classpath BEFORE jsyntaxpane.jar.
2,  You can remove the component programatically. There is a static method in 
the DefaultSyntaxKit that manages properties for Editors.  The line number, and 
others are one property / component you can remove.

Hope that helps.  I will close the issue, but if you have problems, just add 
another note here.

Original comment by ayman.al...@gmail.com on 30 Oct 2010 at 4:11

  • Changed state: Answered
  • Added labels: OpSys-All, Type-Other