List of usage examples for javax.swing.text JTextComponent setComponentPopupMenu
@BeanProperty(preferred = true, description = "Popup to show") public void setComponentPopupMenu(JPopupMenu popup)
JPopupMenu
for this JComponent
. From source file:net.pandoragames.far.ui.swing.component.UndoHistoryPopupMenu.java
/** * Creates a new UndoHistoryPopupMenu and wires it as component popup menu to the * specified text component. The text component must already been registerd with an * {@link net.pandoragames.far.ui.swing.component.UndoHistory UndoHistory}. * @param config application configuration * @param componentRepository shared components * @param component previously registered with an <code>UndoHistory</code> * @return UndoHistoryPopupMenu the menu that has bee created. *//*from ww w. ja v a2s . co m*/ public static UndoHistoryPopupMenu createPopUpMenu(SwingConfig config, ComponentRepository componentRepository, JTextComponent component) { UndoHistoryPopupMenu popup = new UndoHistoryPopupMenu(config, componentRepository, component); component.setComponentPopupMenu(popup); return popup; }