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

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

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

JTextComponent.setComponentPopupMenu介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

  1. super(proxy);
  2. this.getProxy().setComponentPopupMenu(new JPopupMenuText(this.getProxy()));

代码示例来源:origin: stackoverflow.com

  1. // allows default cut copy paste popup menu actions
  2. private void addCutCopyPastePopUp(JTextComponent textComponent) {
  3. ActionMap am = textComponent.getActionMap();
  4. Action paste = am.get("paste-from-clipboard");
  5. Action copy = am.get("copy-to-clipboard");
  6. Action cut = am.get("cut-to-clipboard");
  7. cut.putValue(Action.NAME, "Cut");
  8. copy.putValue(Action.NAME, "Copy");
  9. paste.putValue(Action.NAME, "Paste");
  10. JPopupMenu popup = new JPopupMenu("My Popup");
  11. textComponent.setComponentPopupMenu(popup);
  12. popup.add(new JMenuItem(cut));
  13. popup.add(new JMenuItem(copy));
  14. popup.add(new JMenuItem(paste));
  15. }

代码示例来源:origin: SKCraft/Launcher

  1. textComponent.setComponentPopupMenu(TextFieldPopupMenu.INSTANCE);
  2. DefaultCaret caret = (DefaultCaret) textComponent.getCaret();
  3. caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);

代码示例来源:origin: SKCraft/SKMCLauncher

  1. textComponent.setFont(new JLabel().getFont());
  2. textComponent.setEditable(false);
  3. textComponent.setComponentPopupMenu(TextFieldPopupMenu.INSTANCE);
  4. DefaultCaret caret = (DefaultCaret) textComponent.getCaret();
  5. caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);

相关文章

JTextComponent类方法