VISTALL / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Version 0.9.3 give NPE error. Can't get it work #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. DefaultSyntaxKit.initKit();
2. editorPane = new JEditorPane();
3. editorPane.setContentType("text/java");

What is the expected output? What do you see instead?
Exception in thread "main" java.lang.NullPointerException at
jsyntaxpane.components.LineNumbersRuler.install(LineNumbersRuler.java:113)
    at jsyntaxpane.DefaultSyntaxKit.install(DefaultSyntaxKit.java:109)
    at javax.swing.JEditorPane.setEditorKit(Unknown Source)
    at javax.swing.JEditorPane.setContentType(Unknown Source)
    at main.CustomEditor.getEditorPane(CustomEditor.java:96)
    at main.CustomEditor.getEditorScrollPane(CustomEditor.java:82)
    at main.CustomEditor.getMainPanel(CustomEditor.java:63)
    at main.CustomEditor.<init>(CustomEditor.java:47)
    at main.TestClass.<init>(TestClass.java:10)
    at main.TestClass.main(TestClass.java:59)

What version of the product are you using? On what operating system?
jsyntaxpane-0.9.3.jar with jre 1.6.0_03 on Windows Vista 32 bits

Please provide any additional information below.

Original issue reported on code.google.com by gratt...@gmail.com on 10 Nov 2008 at 1:06

GoogleCodeExporter commented 9 years ago
The bug is Know because the is a comment in the source:

    public void install(JEditorPane editor) {
        this.pane = editor;
        this.pane.addCaretListener(this);
        updateSize();
        // This will throw a NPE if the Ediror is not inside a JScrollPane
        JScrollPane sp = getScrollPane(pane);
        sp.setRowHeaderView(this);
    }

Should throw a more appropriate message

Original comment by gratt...@gmail.com on 10 Nov 2008 at 1:25

GoogleCodeExporter commented 9 years ago
Thanks `for the report.  This will be fixed shortly.
I only used NetBeans as the GUI editor, and it always encloses the JEditorPane 
in a
JScrollPane.  Should be more careful if this is not the case

Original comment by ayman.al...@gmail.com on 10 Nov 2008 at 5:04

GoogleCodeExporter commented 9 years ago
Fixed in 0.9.3a binary.

Original comment by ayman.al...@gmail.com on 10 Nov 2008 at 5:20

GoogleCodeExporter commented 9 years ago

Original comment by ayman.al...@gmail.com on 10 Nov 2008 at 5:20

GoogleCodeExporter commented 9 years ago
Ok yeah I understand. I'm using Eclipse and do all my GUI manually. I was
instanciating my JEditorPane and content type before adding it to the 
JScrollPane.

Original comment by gratt...@gmail.com on 10 Nov 2008 at 1:19