algorithms-for-computing-li.../src/main/java/View/Panels/MenuPanel.java

40 lines
935 B
Java
Raw Normal View History

2017-06-21 15:41:40 +00:00
package View.Panels;
2017-05-29 15:08:58 +00:00
2017-06-20 14:59:24 +00:00
import java.awt.BorderLayout;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.SwingConstants;
2017-05-29 15:08:58 +00:00
/**
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
*
* @Author: Armin Wolf
* @Email: a_wolf28@uni-muenster.de
* @Date: 29.05.2017.
*/
2017-05-30 12:59:06 +00:00
public class MenuPanel extends JPanel {
2017-05-29 15:08:58 +00:00
2017-06-20 14:59:24 +00:00
private JMenuBar menuBar;
private JMenu menu;
private JMenuItem item;
2017-05-29 15:08:58 +00:00
2017-06-20 14:59:24 +00:00
public MenuPanel() {
this.setLayout(new BorderLayout());
this.menuBar = new JMenuBar();
this.menu = new JMenu("File");
2017-05-29 15:08:58 +00:00
2017-06-20 14:59:24 +00:00
this.item = new JMenuItem("Exit");
this.item.addActionListener(e -> {
System.exit(0);
});
2017-05-29 15:08:58 +00:00
2017-06-20 14:59:24 +00:00
menu.add(item);
menuBar.add(menu);
this.add(menuBar, BorderLayout.WEST);
this.add(new JSeparator(SwingConstants.HORIZONTAL), BorderLayout.SOUTH);
}
2017-05-29 15:08:58 +00:00
}