?? 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 + -