javax.swing.JTextPane.setComponentPopupMenu()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中javax.swing.JTextPane.setComponentPopupMenu()方法的一些代码示例,展示了JTextPane.setComponentPopupMenu()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.setComponentPopupMenu()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:setComponentPopupMenu

JTextPane.setComponentPopupMenu介绍

暂无

代码示例

代码示例来源:origin: org.scijava/scijava-ui-swing

public void setPopupMenu(JPopupMenu menu) {
  textPane.setComponentPopupMenu(menu);
}

代码示例来源:origin: orbisgis/orbisgis

public OutputPanel() {
    changeAttribute(lastColor); //Init attribute
    this.setLayout(new BorderLayout());
    textPane = new JTextPane();
    textPane.setEditable(false);
    textPane.setComponentPopupMenu(makePopupMenu());
    this.add(new JScrollPane(textPane), BorderLayout.CENTER);
    this.addPropertyChangeListener("UI",
        EventHandler.create(PropertyChangeListener.class, this, "resetFont"));
}

代码示例来源:origin: org.orbisgis/orbisgis-view

public OutputPanel() {
    changeAttribute(lastColor); //Init attribute
    this.setLayout(new BorderLayout());
    textPane = new JTextPane();
    textPane.setEditable(false);
    textPane.setComponentPopupMenu(makePopupMenu());
    this.add(new JScrollPane(textPane), BorderLayout.CENTER);
    this.addPropertyChangeListener("UI",
        EventHandler.create(PropertyChangeListener.class, this, "resetFont"));
}

代码示例来源:origin: ontop/ontop

queryTextPane.setComponentPopupMenu(sparqlPopupMenu);
jScrollQueryPane.setViewportView(queryTextPane);

代码示例来源:origin: blurpy/kouchat

/**
 * Constructor. Creates the menu.
 *
 * @param textpane The text pane to use the popup on.
 * @param swingMessages The swing messages to use for the menu items.
 */
public CopyPopup(final JTextPane textpane, final SwingMessages swingMessages) {
  Validate.notNull(textpane, "Text pane can not be null");
  Validate.notNull(swingMessages, "Swing messages can not be null");
  this.textpane = textpane;
  final int menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
  copyMI = new JMenuItem(new DefaultEditorKit.CopyAction());
  copyMI.setText(swingMessages.getMessage("swing.rightClickPopup.menu.copy"));
  copyMI.setMnemonic(keyCode(swingMessages.getMessage("swing.rightClickPopup.menu.copy.mnemonic")));
  copyMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, menuShortcutKeyMask));
  selectAllMI = new JMenuItem(swingMessages.getMessage("swing.rightClickPopup.menu.selectAll"));
  selectAllMI.setMnemonic(keyCode(swingMessages.getMessage("swing.rightClickPopup.menu.selectAll.mnemonic")));
  selectAllMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, menuShortcutKeyMask));
  add(copyMI);
  add(selectAllMI);
  textpane.setComponentPopupMenu(this);
  selectAllMI.addActionListener(this);
  addPopupMenuListener(this);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

inbox.setComponentPopupMenu(dropDownMenu);
outbox.setComponentPopupMenu(dropDownMenu);

代码示例来源:origin: com.davidbracewell/hermes-core

StyleConstants.setBackground(style, tagSet.getBackgroundColor(t));
});
editorPane.setComponentPopupMenu(createEditorPopup());
editorPane.addMouseListener(mouseClicked(this::syncEditorSelection));
editorPane.addMouseListener(mousePressed(this::syncEditorSelection));

相关文章

JTextPane类方法