本文整理了Java中javax.swing.JMenu.addMouseListener()
方法的一些代码示例,展示了JMenu.addMouseListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenu.addMouseListener()
方法的具体详情如下:
包路径:javax.swing.JMenu
类名称:JMenu
方法名:addMouseListener
暂无
代码示例来源:origin: com.github.insubstantial/substance
/**
* Returns the <code>JMenu</code> displaying the appropriate menu items for
* manipulating the Frame.
*
* @return <code>JMenu</code> displaying the appropriate menu items for
* manipulating the Frame.
*/
@Override
protected JMenu createSystemMenu() {
JMenu menu = super.createSystemMenu();
menu.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1) {
closeAction.actionPerformed(new ActionEvent(e.getSource(),
ActionEvent.ACTION_PERFORMED, null,
EventQueue.getMostRecentEventTime(), e.getModifiers()));
}
}
});
return menu;
}
代码示例来源:origin: PortSwigger/backslash-powered-scanner
public void run()
{
menuButton = new JMenu("Backslash");
menuButton.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent mouseEvent) {
SwingUtilities.invokeLater(new Runnable() {
public void run(){
Utilities.globalSettings.showSettings();
}
});
}
});
JMenuBar burpMenuBar = getBurpFrame().getJMenuBar();
burpMenuBar.add(menuButton);
}
代码示例来源:origin: com.github.insubstantial/substance
/**
* Returns the <code>JMenu</code> displaying the appropriate menu items for
* manipulating the Frame.
*
* @return <code>JMenu</code> displaying the appropriate menu items for
* manipulating the Frame.
*/
private JMenu createMenu() {
JMenu menu = new JMenu("");
menu.setOpaque(false);
menu.setBackground(null);
//if (this.getWindowDecorationStyle() == JRootPane.FRAME) {
this.addMenuItems(menu);
//}
menu.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1) {
closeAction.actionPerformed(new ActionEvent(e.getSource(),
ActionEvent.ACTION_PERFORMED, null,
EventQueue.getMostRecentEventTime(), e.getModifiers()));
}
}
});
return menu;
}
代码示例来源:origin: stackoverflow.com
fileBtn.addMouseListener(
new MouseAdapter() //This works
代码示例来源:origin: igniterealtime/Spark
mainStatusItem.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent mouseEvent) {
statusAction.actionPerformed(null);
代码示例来源:origin: igniterealtime/Spark
statusMenu.add(status);
status.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent mouseEvent) {
内容来源于网络,如有侵权,请联系作者删除!