LanguageTextField Background scrambles when scrolling
Planned
This is main code:
@Override
public void componentResized(ComponentEvent componentEvent) {
EditorEx editor = (EditorEx) this.editorPane.getEditor();
if (editor != null) {
editor.setHorizontalScrollbarVisible(true);
editor.setVerticalScrollbarVisible(true);
EditorSettings editorSettings = editor.getSettings();
if (!editorSettings.isLineNumbersShown()) editorSettings.setLineNumbersShown(true);
if (!editorSettings.isFoldingOutlineShown()) editorSettings.setFoldingOutlineShown(true);
}
}
Normal background:

Unusual background:

Scrolling will trigger this exception
Please sign in to leave a comment.
Sorry, but I'm not sure what exactly your problem is.
@Jakub Chrzanowski
Please pay attention to the background picture, the second screenshot is obviously messy
看看这个:
Is this custom background your plugin's implementation? Which class do you extend? Is there any parent methods that you may call in componentResized?
来自的背景图片:
My more code:
this.editorPane = new LanguageTextField(JsonLanguage.INSTANCE, project, "{}", false);this.editorPane.addComponentListener(new EventHandler(this.editorPane));
this.templateDataPanel.add(this.editorPane);
static class EventHandler implements ComponentListener {
private LanguageTextField editorPane;
public EventHandler(LanguageTextField editorPane) {
this.editorPane = editorPane;
}
@Override
public void componentResized(ComponentEvent componentEvent) {
EditorEx editor = (EditorEx) this.editorPane.getEditor();
if (editor != null) {
editor.setHorizontalScrollbarVisible(true);
editor.setVerticalScrollbarVisible(true);
EditorSettings editorSettings = editor.getSettings();
if (!editorSettings.isLineNumbersShown()) editorSettings.setLineNumbersShown(true);
if (!editorSettings.isFoldingOutlineShown()) editorSettings.setFoldingOutlineShown(true);
}
}
@Override
public void componentMoved(ComponentEvent componentEvent) {
}
@Override
public void componentShown(ComponentEvent componentEvent) {
}
@Override
public void componentHidden(ComponentEvent componentEvent) {
}
}
Added: Only appear in independent window, it is normal to dock on the right.
Hello, official staff, do you guys deal with this problem now? Or I do n’t provide enough information, you did n’t locate the error, I ’m happy to add more details
Cannot reproduce the problem, it just works for me.