LanguageTextField Background scrambles when scrolling

已计划

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

 

0

Sorry, but I'm not sure what exactly your problem is.

0

@Jakub Chrzanowski 

Please pay attention to the background picture, the second screenshot is obviously messy

0

Is this custom background your plugin's implementation? Which class do you extend? Is there any parent methods that you may call in componentResized?

0

 

来自的背景图片:

My more code:

private JPanel templateDataPanel;
private LanguageTextField editorPane;
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) {

}
}

 

0

Added: Only appear in independent window, it is normal to dock on the right.

0

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

0
Avatar
Permanently deleted user

Cannot reproduce the problem, it just works for me.

0

请先登录再写评论。