📄 menue.java
字号:
package de.uni_bremen.informatik.p2p.plugins.filesharing.gui;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import de.uni_bremen.informatik.p2p.plugins.filesharing.gui.event.DownloadEventListener;
/**
* An object of the class is the menubar of the filesharing frame.
*
* @author Philipp Hoheisel, Cecile Prigge, Lars Kordes
*/
public class Menue
extends JMenuBar {
/**
* Constructor creates the whole menuebar.
*
* @param actlist Eventlistener for items of the menuebar.
*/
public Menue(DownloadEventListener actlist) {
// add file menu
JMenu menu = new JMenu("File");
menu.add(makeItem("...", actlist));
menu.add(makeItem("Preferences", actlist));
menu.add(makeItem("Exit", actlist));
add(menu);
// add info menu
JMenu menu2 = new JMenu("?");
menu2.add(makeItem("About", actlist));
menu2.add(makeItem("Help", actlist));
add(menu2);
}
/**
* The method creates an menu item with given label and given
* actionlistener.
*
* @param label The label of the button.
* @param actlist The actionlistener of the button.
*
* @return New created menu item.
*/
private JMenuItem makeItem(String label,
DownloadEventListener actlist) {
JMenuItem item = new JMenuItem(label);
item.addActionListener(actlist);
return item;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -