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.

96 lines
2.5 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
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.event.ActionEvent;
  3. import java.awt.event.ActionListener;
  4. public class Main {
  5. //Variablen GUI
  6. JFrame fr = null;
  7. JMenuBar jmb = null;
  8. JMenu jm = null;
  9. JMenu jm1 = null;
  10. JPanel contantPane = null;
  11. JLabel label = null;
  12. JMenuItem jmI = null;
  13. //Konstruktor Gui
  14. public Main(){
  15. this.fr = new JFrame("Coutinius Integration");
  16. this.fr.setSize(666,900);
  17. this.jmb = new JMenuBar();
  18. this.fr.setJMenuBar(jmb);
  19. this.jm = new JMenu("Menu");
  20. this.jmb.add(jm);
  21. this.jmI = new JMenuItem("Exit");
  22. this.jm.add(jmI);
  23. this.jmI.addActionListener(new ActionListener1());
  24. this.jm1 = new JMenu("Info");
  25. this.jmb.add(jm1);
  26. this.contantPane = new JPanel();
  27. this.fr.setContentPane(contantPane);
  28. this.contantPane.add(new JLabel("Ein Tool der CI!"));
  29. this.contantPane.add(new JLabel("1) Tools von Daniel"));
  30. ButtonGroup buttonGroup = new ButtonGroup();
  31. JRadioButton hzeit = new JRadioButton("Hochzeit");
  32. hzeit.setBounds(100, 170, 100, 20);
  33. buttonGroup.add(hzeit);
  34. this.contantPane.add(hzeit);
  35. JRadioButton gtag = new JRadioButton("Geburtstag");
  36. gtag.setBounds(250, 170, 100, 20);
  37. buttonGroup.add(gtag);
  38. this.contantPane.add(gtag);
  39. JLabel auswahl = new JLabel("Ihre Auswahl:");
  40. auswahl.setBounds(10, 200, 100, 20);
  41. this.contantPane.add(auswahl);
  42. final JTextField text1 = new JTextField();
  43. text1.setBounds(100, 200, 300, 20);
  44. this.contantPane.add(text1);
  45. hzeit.addActionListener(new ActionListener() {
  46. public void actionPerformed(ActionEvent ie) {
  47. text1.setText("MALE");
  48. }
  49. });
  50. gtag.addActionListener(new ActionListener() {
  51. public void actionPerformed(ActionEvent ie) {
  52. text1.setText("FEMALE");
  53. }
  54. });
  55. this.contantPane.add(new JLabel("2) Tools von Eugen"));
  56. this.contantPane.add(new JLabel("3) Tools von Michael"));
  57. this.contantPane.setVisible(true);
  58. this.fr.setVisible(true);
  59. }
  60. public static void main(String[] args) {
  61. System.out.println("Hello World!");
  62. Main mn = new Main();
  63. }
  64. // Action Listener
  65. private class ActionListener1 implements ActionListener{
  66. @Override
  67. public void actionPerformed(ActionEvent e) {
  68. System.exit(0);
  69. }
  70. }
  71. }