Added Menubar

-added menubar
This commit is contained in:
Weichspieler 2016-11-21 21:25:16 +01:00
parent 0dceecec47
commit a7f29125f1
12 changed files with 28 additions and 1 deletions

1
bin/.gitignore vendored
View File

@ -14,3 +14,4 @@
/jaggob$2.class
/jaggob.class
/GUI$9.class
/GUI$10.class

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,6 +25,7 @@ import java.awt.Component;
import java.awt.Cursor;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.MenuBar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -42,6 +43,9 @@ import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
@ -67,6 +71,10 @@ public class GUI extends JFrame {
//Init
private JButton btn_browse;
private JMenuBar menubar;
private JMenu file;
private JMenuItem exit;
//////////////////////////////////////////////////////////////
@ -170,8 +178,26 @@ public class GUI extends JFrame {
contentPane.add(textField);
textField.setColumns(10);
//browse Button hinzufügen
//Menübar einrichten
menubar = new JMenuBar();
file = new JMenu("File...");
exit = new JMenuItem("Exit");
exit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
file.add(exit);
menubar.add(file);
setJMenuBar(menubar);
//browse Button hinzufügen
btn_browse = new JButton("...");
btn_browse.setBounds(1065, 14, 20, 20);
btn_browse.addActionListener(new ActionListener() {