RTextScrollPane

Questions on using RSyntaxTextArea should go here.

Moderator: robert

RTextScrollPane

Postby Adam.Law » Fri Aug 23, 2013 9:07 pm

Good day,

Fantastic piece of work you have here. I have encountered a problem with RTextScrollPaneText, Gutter, and RSyntaxTextArea. This should be elementary, but for the life of me, I can't get it to work.

Here're the details. I construct the text area and set its initial text after an event. When I do as prescribed on the constructor and put the text area into the scrollpane through setViewPortView, the gutter shows and works just fine. Problem with this is, the scroll pane does not scroll any further below the initial line size of the text area. So what I did was, I added the text area to the scroll pane through getViewPort.add(textArea). It now scrolls perfectly, but is also now throwing a NullPointerException when it hits:

Code: Select all
            

Gutter editAreaGutter = RSyntaxUtilities.getGutter(textArea);
editAreaGutter.setBookmarkIcon(bookmarkIcon);


..., which I do in a SwingUtilities.invokeLater() call. I looked at the RSyntaxUtilities.getGutter() code and it returns the gutter just fine (not null), so I'm baffled as to why it's not working as it should.

I hope you can give me some info on how to do this right. Thanks!
Adam.Law
 
Posts: 2
Joined: Fri Aug 23, 2013 7:00 pm

Re: RTextScrollPane

Postby Adam.Law » Tue Sep 17, 2013 7:59 pm

I'm a bit embarrassed to say this, but I finally made the time and found the culprit. There was an extra instance of RTextScrollPanel that was wrapped around and this caused the confusion under the hood. Sorry for the bother, and thanks.

Edit: I can't seem to find where I put a ticket in for a bug report. Sorry again.
Adam.Law
 
Posts: 2
Joined: Fri Aug 23, 2013 7:00 pm

Re: RTextScrollPane

Postby robert » Wed Sep 18, 2013 12:03 pm

No worries, and I'm glad you figured it out. I closed your ticket on GitHub.
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 6 guests