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.

154 lines
4.9 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. JMenuItem menuItem3 = null;
  13. JMenuBar bar =null;
  14. JMenu mF= null;
  15. JMenu mH = null;
  16. JMenu mI = null;
  17. //Konstruktor Gui
  18. public Main(){
  19. fr = new JFrame("Coutinius Integration SS 2019");
  20. fr.setSize(1920,1080);
  21. fr.setFont(new Font("Helvetica", Font.PLAIN, 12));
  22. fr.setLayout(new FlowLayout());
  23. Panele = new JPanel();
  24. fr.setContentPane(Panele);
  25. bar = new JMenuBar();
  26. fr.setJMenuBar(bar);
  27. mF = new JMenu("File");
  28. mH = new JMenu("Help");
  29. mI = new JMenu("Info");
  30. bar.add(mF);
  31. bar.add(mH);
  32. bar.add(mI);
  33. menuItem1 = new JMenuItem("Hauptprogramm"); mF.add(menuItem1);
  34. menuItem2 = new JMenuItem("Exit"); mF.add(menuItem2);
  35. menuItem3 = new JMenuItem("Über"); mI.add(menuItem3);
  36. menuItem1.addActionListener(new ActionListener() {
  37. public void actionPerformed(ActionEvent ie) {
  38. try {
  39. JOptionPane.showMessageDialog(fr, "Wir wechseln zum Hauptprogramm");
  40. Main mn = new Main();
  41. fr.setVisible((false));
  42. Panele.setVisible(false);
  43. mn.fr.setVisible(true);
  44. //System.exit(0);
  45. }catch (Exception ex) {
  46. JOptionPane.showMessageDialog(null, "Fehler");
  47. }
  48. }
  49. });
  50. menuItem2.addActionListener(new ActionListener() {
  51. public void actionPerformed(ActionEvent ie) {
  52. try {
  53. System.exit(-1);
  54. }catch (Exception ex) {
  55. JOptionPane.showMessageDialog(null, "Fehler");
  56. }
  57. }
  58. });
  59. menuItem3.addActionListener(new ActionListener() {
  60. public void actionPerformed(ActionEvent ie) {
  61. try {
  62. JOptionPane.showMessageDialog(fr, "Tools entwickelt für CI 2019 Copyright by DEM Consulting");
  63. }catch (Exception ex) {
  64. JOptionPane.showMessageDialog(null, "Fehler");
  65. }
  66. }
  67. });
  68. this.fr.addWindowListener(new WindowAdapter() {
  69. public void windowClosing(WindowEvent e) {
  70. System.exit(-1);
  71. }
  72. });
  73. Panele.add(new JLabel("CI Tools von "));
  74. ButtonGroup buttonGroup = new ButtonGroup();
  75. JButton DTools = new JButton("Daniel"); DTools.setBounds(100, 100, 100, 40);
  76. buttonGroup.add(DTools); Panele.add(DTools);
  77. JButton ETools = new JButton("Eugen"); ETools.setBounds(200, 200, 100, 40);
  78. buttonGroup.add(ETools); Panele.add(ETools);
  79. JButton MTools = new JButton("Michael"); MTools.setBounds(300, 300, 100, 40);
  80. buttonGroup.add(MTools); Panele.add(MTools);
  81. DTools.addActionListener(new ActionListener() {
  82. public void actionPerformed(ActionEvent ie) {
  83. try {
  84. JOptionPane.showMessageDialog(fr, "Aufruf von Daniel Tools");
  85. fr.setVisible(false);
  86. Tage_D tage = new Tage_D();
  87. }catch (Exception ex) {
  88. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Daniels Tools");
  89. }
  90. }
  91. });
  92. ETools.addActionListener(new ActionListener() {
  93. public void actionPerformed(ActionEvent ie) {
  94. try {
  95. JOptionPane.showMessageDialog(fr, "Aufruf von Eugens Tools");
  96. //fr.setVisible(false);
  97. Quiz_Spiel window = new Quiz_Spiel();
  98. window.setTitle("Quiz_Spiel");
  99. window.pack();
  100. window.show();
  101. }catch (Exception ex) {
  102. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Eugens Tools");
  103. }
  104. }
  105. });
  106. MTools.addActionListener(new ActionListener() {
  107. public void actionPerformed(ActionEvent ie) {
  108. try {
  109. JOptionPane.showMessageDialog(fr, "Aufruf von Michaels Tools");
  110. fr.setVisible(false);
  111. FitnessTest_M M = new FitnessTest_M();
  112. }catch (Exception ex) {
  113. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Michaels Tools");
  114. }
  115. }
  116. });
  117. Panele.setVisible(true);
  118. this.fr.setVisible(true);
  119. this.fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  120. }
  121. public static void main(String[] args) {
  122. Main mn = new Main();
  123. }
  124. }