JEditor editor = new JEditor(); editor.setRightClickPopup(new DefaultEditorPopup());will show:
JEditor() editor = new JEditor(); editor.setRightClickPopup(new ContextPopup()); public class ContextPopup extends AbstractContextEditorPopup { public ContextPopup() { super("Popup"); } @Override protected boolean createPopupItems(int line, int column) { this.add(new JMenuItem("Line " + (line + 1 ) + " Column " + (column + 1))); return true; } }
true
for the CodeEditorDefaults.hasPopup value will also show the DefaultEditorPopup
. For example, the following code will also allow to show the same Popup:defaults.hasPopup = true; JEditor ta = new JEditor(defaults);
Copyright 2016-2019 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence