CI 2019 von Daniel, Eugen und Michael
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
4.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4. public class Main {
  5. //Variablen GUI
  6. JButton button = null;
  7. ImageIcon icon = null;
  8. JFrame fr = null;
  9. JPanel Panele = null;
  10. JMenuItem menuItem1 = null;
  11. JMenuItem menuItem2 = null;
  12. JMenuBar bar =null;
  13. JMenu mF= null;
  14. JMenu mH = null;
  15. JMenu mI = null;
  16. //Konstruktor Gui
  17. public Main(){
  18. fr = new JFrame("Coutinius Integration SS 2019");
  19. fr.setSize(1920,1080);
  20. fr.setFont(new Font("Helvetica", Font.PLAIN, 12));
  21. fr.setLayout(new FlowLayout());
  22. Panele = new JPanel();
  23. fr.setContentPane(Panele);
  24. bar = new JMenuBar();
  25. fr.setJMenuBar(bar);
  26. mF = new JMenu("File");
  27. mH = new JMenu("Help");
  28. mI = new JMenu("Info");
  29. bar.add(mF);
  30. bar.add(mH);
  31. bar.add(mI);
  32. menuItem1 = new JMenuItem("Exit"); mF.add(menuItem1);
  33. menuItem2 = new JMenuItem("Über"); mI.add(menuItem2);
  34. menuItem1.addActionListener(new ActionListener() {
  35. public void actionPerformed(ActionEvent ie) {
  36. try {
  37. System.exit(-1);
  38. }catch (Exception ex) {
  39. JOptionPane.showMessageDialog(null, "Fehler");
  40. }
  41. }
  42. });
  43. menuItem2.addActionListener(new ActionListener() {
  44. public void actionPerformed(ActionEvent ie) {
  45. try {
  46. JOptionPane.showMessageDialog(fr, "Tools entwickelt für CI 2019 Copyright by DEM Consulting");
  47. }catch (Exception ex) {
  48. JOptionPane.showMessageDialog(null, "Fehler");
  49. }
  50. }
  51. });
  52. this.fr.addWindowListener(new WindowAdapter() {
  53. public void windowClosing(WindowEvent e) {
  54. System.exit(-1);
  55. }
  56. });
  57. Panele.add(new JLabel("CI Tools von "));
  58. ButtonGroup buttonGroup = new ButtonGroup();
  59. JButton DTools = new JButton("Daniel"); DTools.setBounds(100, 100, 100, 40);
  60. buttonGroup.add(DTools); Panele.add(DTools);
  61. JButton ETools = new JButton("Eugen"); ETools.setBounds(200, 200, 100, 40);
  62. buttonGroup.add(ETools); Panele.add(ETools);
  63. JButton MTools = new JButton("Michael"); MTools.setBounds(300, 300, 100, 40);
  64. buttonGroup.add(MTools); Panele.add(MTools);
  65. DTools.addActionListener(new ActionListener() {
  66. public void actionPerformed(ActionEvent ie) {
  67. try {
  68. JOptionPane.showMessageDialog(fr, "Aufruf von Daniels Tools");
  69. fr.setVisible(false);
  70. Tage_D gb = new Tage_D();
  71. }catch (Exception ex) {
  72. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Daniels Tools");
  73. }
  74. }
  75. });
  76. ETools.addActionListener(new ActionListener() {
  77. public void actionPerformed(ActionEvent ie) {
  78. try {
  79. JOptionPane.showMessageDialog(fr, "Aufruf von Eugens Tools");
  80. //fr.setVisible(false);
  81. Quiz_Spiel window = new Quiz_Spiel();
  82. window.setTitle("Quiz_Spiel");
  83. window.pack();
  84. window.show();
  85. }catch (Exception ex) {
  86. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Eugens Tools");
  87. }
  88. }
  89. });
  90. MTools.addActionListener(new ActionListener() {
  91. public void actionPerformed(ActionEvent ie) {
  92. try {
  93. JOptionPane.showMessageDialog(fr, "Aufruf von Michaels Tools");
  94. fr.setVisible(false);
  95. Quiz qwqqq = new Quiz();
  96. }catch (Exception ex) {
  97. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Michaels Tools");
  98. }
  99. }
  100. });
  101. Panele.setVisible(true);
  102. this.fr.setVisible(true);
  103. this.fr.setAlwaysOnTop(true);
  104. this.fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  105. }
  106. public static void main(String[] args) {
  107. Main mn = new Main();
  108. }
  109. }