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.

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