本文整理了Java中javax.swing.text.JTextComponent.setComponentPopupMenu()
方法的一些代码示例,展示了JTextComponent.setComponentPopupMenu()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.setComponentPopupMenu()
方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:setComponentPopupMenu
暂无
代码示例来源:origin: ron190/jsql-injection
super(proxy);
this.getProxy().setComponentPopupMenu(new JPopupMenuText(this.getProxy()));
代码示例来源:origin: stackoverflow.com
// allows default cut copy paste popup menu actions
private void addCutCopyPastePopUp(JTextComponent textComponent) {
ActionMap am = textComponent.getActionMap();
Action paste = am.get("paste-from-clipboard");
Action copy = am.get("copy-to-clipboard");
Action cut = am.get("cut-to-clipboard");
cut.putValue(Action.NAME, "Cut");
copy.putValue(Action.NAME, "Copy");
paste.putValue(Action.NAME, "Paste");
JPopupMenu popup = new JPopupMenu("My Popup");
textComponent.setComponentPopupMenu(popup);
popup.add(new JMenuItem(cut));
popup.add(new JMenuItem(copy));
popup.add(new JMenuItem(paste));
}
代码示例来源:origin: SKCraft/Launcher
textComponent.setComponentPopupMenu(TextFieldPopupMenu.INSTANCE);
DefaultCaret caret = (DefaultCaret) textComponent.getCaret();
caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
代码示例来源:origin: SKCraft/SKMCLauncher
textComponent.setFont(new JLabel().getFont());
textComponent.setEditable(false);
textComponent.setComponentPopupMenu(TextFieldPopupMenu.INSTANCE);
DefaultCaret caret = (DefaultCaret) textComponent.getCaret();
caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
内容来源于网络,如有侵权,请联系作者删除!