Git Product home page Git Product logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
This is strange.  The component should have its size already, unless there is
something wrong.
Can you send/paste me the whole code, instead of just the steps above?

Original comment by [email protected] on 30 Dec 2008 at 10:57

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024

Original comment by [email protected] on 30 Dec 2008 at 10:57

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
In my project, I encountered the problem when dynamically adding or removing
JEditorPane in tabs of a JTabbedPane.

Please find attach the smallest piece of code that I was able to write in order 
to
reproduce the NullPointerException. You have to click on the JButton in order to
generate the NPE.

P.S: thanks a lot for your wonderful piece of code!

Original comment by [email protected] on 30 Dec 2008 at 1:06

Attachments:

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
I just fixed it in the latest release (r64).  It missed the binary release by 
just a
few minutes.
You also need to call the doLayout method on the container just after the add is
called.  Otherwise it wont display immediately.
        c.add(scrPane, BorderLayout.CENTER);
                c.doLayout();

Original comment by [email protected] on 30 Dec 2008 at 1:39

  • Changed state: Fixed
  • Added labels: Type-Defect

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
I tried the latest release (r64). There is no more NPE. Unfortunately, there is 
still
a problem, the lines are not correctly numbered. For instance, if you try to 
execute
my previous TestIssue47 class while providing a multi-line content as parameter 
of
the setText method (setText("xxx\nxxx\nxxx");), only the first line is numbered 
;(. 

Original comment by [email protected] on 30 Dec 2008 at 3:21

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
In that case, maybe other things could fail.  You should call the setContentType
after calling doLayout on the component.  Let me know if that does not work.

Original comment by [email protected] on 30 Dec 2008 at 4:16

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
Unfortunately, it seems the problem is not related to the doLayout() as 
illustrated
in the code attached to this comment. In this example, doLayout() is called 
before
the setContentType(), and latter the setText() is called. 

Original comment by [email protected] on 30 Dec 2008 at 6:07

Attachments:

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
The problem is that the LineNumbersRuler component is a CaretListener, but the 
Caret
is not moved by the initial setText.  I implemented a CaretListener because at 
time
of registering the LineNumbersRuler to the component, the Editor's 
SyntaxDocument is
yet available.  
I'll look at a better solution.  Seems like listening for the components
propertyChange and implementing a DocumentListener will be needed.

Original comment by [email protected] on 31 Dec 2008 at 5:14

  • Changed state: Accepted

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
Fixed in r65.  I did the above, and also don't call the modelToView, relying on 
the
Document Elements now.
Many thanks for keeping me honest :-)

Original comment by [email protected] on 31 Dec 2008 at 8:12

  • Changed state: Fixed

from jsyntaxpane.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
It works like a charm ! 
Thank you very much for your effort and one more time thank you for providing 
us such
a useful component.

Original comment by [email protected] on 31 Dec 2008 at 9:12

from jsyntaxpane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.