Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue May 5, 2015 · 5 comments
Closed

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

GoogleCodeExporter opened this issue May 5, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Accepted
  • Added labels: OpSys-All, Priority-High, Type-Defect

@GoogleCodeExporter
Copy link
Author

Fixed in 0.9.3a binary.

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant