Java Code Examples for javax.swing.JMenu#addActionListener()

The following examples show how to use javax.swing.JMenu#addActionListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VideoDownloadWindow.java    From xdm with GNU General Public License v2.0 6 votes vote down vote up
private void createPopup() {
	pop = new JPopupMenu();
	pop.setBackground(ColorResource.getDarkerBgColor());
	JMenu dl = new JMenu(StringResource.get("ND_DOWNLOAD_LATER"));
	dl.setForeground(Color.WHITE);
	dl.setBorder(new EmptyBorder(getScaledInt(5), getScaledInt(5), getScaledInt(5), getScaledInt(5)));
	dl.addActionListener(this);
	dl.setBackground(ColorResource.getDarkerBgColor());
	dl.setBorderPainted(false);
	// dl.setBackground(C);
	pop.add(dl);

	createQueueItems(dl);

	JMenuItem ig = new JMenuItem(StringResource.get("ND_IGNORE_URL"));
	ig.setName("IGNORE_URL");
	ig.setForeground(Color.WHITE);
	ig.addActionListener(this);
	pop.add(ig);
	pop.setInvoker(btnMore);
}
 
Example 2
Source File: NewDownloadWindow.java    From xdm with GNU General Public License v2.0 6 votes vote down vote up
private void createPopup() {
	pop = new JPopupMenu();
	pop.setBackground(ColorResource.getDarkerBgColor());
	JMenu dl = new JMenu(StringResource.get("ND_DOWNLOAD_LATER"));
	dl.setForeground(Color.WHITE);
	dl.setBorder(new EmptyBorder(getScaledInt(5), getScaledInt(5), getScaledInt(5), getScaledInt(5)));
	dl.addActionListener(this);
	dl.setBackground(ColorResource.getDarkerBgColor());
	dl.setBorderPainted(false);
	// dl.setBackground(C);
	pop.add(dl);

	createQueueItems(dl);

	JMenuItem ig = new JMenuItem(StringResource.get("ND_IGNORE_URL"));
	ig.setName("IGNORE_URL");
	ig.setForeground(Color.WHITE);
	ig.addActionListener(this);
	pop.add(ig);
	pop.setInvoker(btnMore);
}
 
Example 3
Source File: MainWindow.java    From xdm with GNU General Public License v2.0 5 votes vote down vote up
private JMenu addSubMenu(String id, JMenu parentMenu, PopupMenuListener popupListener) {
	JMenu menu = new JMenu(StringResource.get(id));
	menu.setName(id);
	menu.setFont(FontResource.getNormalFont());
	// menu.setForeground(ColorResource.getLightFontColor());
	menu.addActionListener(this);
	// menu.setBackground(ColorResource.getDarkerBgColor());
	menu.setBorderPainted(false);
	menu.getPopupMenu().addPopupMenuListener(popupListener);
	parentMenu.add(menu);
	return menu;
}