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.

137 lines
3.8 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(600,800);
  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. menuItem2.addActionListener(new ActionListener() {
  35. public void actionPerformed(ActionEvent ie) {
  36. try {
  37. JOptionPane.showMessageDialog(fr, "Tools entwickelt für CI 2019 Copyright by DEM Consulting");
  38. }catch (Exception ex) {
  39. JOptionPane.showMessageDialog(null, "Fehler");
  40. }
  41. }
  42. });
  43. this.fr.addWindowListener(new WindowAdapter() {
  44. public void windowClosing(WindowEvent e) {
  45. System.exit(-1);
  46. }
  47. });
  48. fr.setContentPane(Panele);
  49. Panele.add(new JLabel("CI Tools von "));
  50. ButtonGroup buttonGroup = new ButtonGroup();
  51. JButton DTools = new JButton("Daniel"); DTools.setBounds(100, 100, 100, 20);
  52. buttonGroup.add(DTools); Panele.add(DTools);
  53. JButton ETools = new JButton("Eugen"); ETools.setBounds(200, 200, 100, 20);
  54. buttonGroup.add(ETools); Panele.add(ETools);
  55. JButton MTools = new JButton("Michael"); MTools.setBounds(300, 300, 100, 20);
  56. buttonGroup.add(MTools); Panele.add(MTools);
  57. DTools.addActionListener(new ActionListener() {
  58. public void actionPerformed(ActionEvent ie) {
  59. try {
  60. JOptionPane.showMessageDialog(fr, "Aufruf von Daniels Tools");
  61. fr.setVisible(false);
  62. Tage_D gb = new Tage_D();
  63. }catch (Exception ex) {
  64. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Daniels Tools");
  65. }
  66. }
  67. });
  68. ETools.addActionListener(new ActionListener() {
  69. public void actionPerformed(ActionEvent ie) {
  70. try {
  71. JOptionPane.showMessageDialog(fr, "Aufruf von Eugens Tools");
  72. //fr.setVisible(false);
  73. Quiz q = new Quiz();
  74. }catch (Exception ex) {
  75. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Eugens Tools");
  76. }
  77. }
  78. });
  79. MTools.addActionListener(new ActionListener() {
  80. public void actionPerformed(ActionEvent ie) {
  81. try {
  82. JOptionPane.showMessageDialog(fr, "Aufruf von Michaels Tools");
  83. fr.setVisible(false);
  84. Quiz q = new Quiz();
  85. }catch (Exception ex) {
  86. JOptionPane.showMessageDialog(null, "Fehler beim Aufruf von Michaels Tools");
  87. }
  88. }
  89. });
  90. Panele.setVisible(true);
  91. this.fr.setVisible(true);
  92. this.fr.setAlwaysOnTop(true);
  93. this.fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  94. }
  95. public static void main(String[] args) {
  96. Main mn = new Main();
  97. }
  98. }