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.

115 lines
3.0 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
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  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. JComboBox combobox_1;
  14. //Konstruktor Gui
  15. public Main(){
  16. fr = new JFrame("Coutinius Integration SS 2019");
  17. fr.setSize(600,900);
  18. fr.setFont(new Font("Helvetica", Font.PLAIN, 12));
  19. jmb = new JMenuBar();
  20. fr.setJMenuBar(jmb);
  21. jm = new JMenu("Menu");
  22. jmb.add(jm);
  23. jmI = new JMenuItem("Exit");
  24. jm.add(jmI);
  25. jmI.addActionListener(new ActionListener() {
  26. public void actionPerformed(ActionEvent ie) {
  27. System.exit(-1);
  28. }
  29. });
  30. jm1 = new JMenu("Info");
  31. jmb.add(jm1);
  32. contantPane = new JPanel();
  33. fr.setContentPane(contantPane);
  34. contantPane.add(new JLabel("Ein Tool der CI!"));
  35. contantPane.add(new JLabel("Tools von Daniel, Eugen, Michael"));
  36. ButtonGroup buttonGroup = new ButtonGroup();
  37. fr.addWindowListener(new WindowAdapter() {
  38. public void windowClosing(WindowEvent e) {
  39. System.exit(0);
  40. }
  41. });
  42. combobox_1 = new JComboBox();
  43. combobox_1.addItem("Daniels Tools");
  44. combobox_1.addItem("Eugen Tools");
  45. combobox_1.addItem("Michaels Tools");
  46. fr.add(combobox_1);
  47. JRadioButton DTools = new JRadioButton("Daniels Tools"); DTools.setBounds(100, 100, 100, 20);
  48. buttonGroup.add(DTools); contantPane.add(DTools);
  49. JRadioButton ETools = new JRadioButton("Eugen Tools"); ETools.setBounds(200, 100, 100, 20);
  50. buttonGroup.add(ETools); contantPane.add(ETools);
  51. JRadioButton MTools = new JRadioButton("Eugen Tools"); MTools.setBounds(300, 100, 100, 20);
  52. buttonGroup.add(MTools); contantPane.add(MTools);
  53. JLabel auswahl = new JLabel("Ihre Auswahl:");
  54. auswahl.setBounds(10, 200, 100, 20);
  55. contantPane.add(auswahl);
  56. final JTextField text1 = new JTextField("..Bisher keine Auswahl!..");
  57. text1.setBounds(100, 200, 300, 20);
  58. contantPane.add(text1);
  59. DTools.addActionListener(new ActionListener() {
  60. public void actionPerformed(ActionEvent ie) {
  61. text1.setText("Daniel Tools");
  62. }
  63. });
  64. ETools.addActionListener(new ActionListener() {
  65. public void actionPerformed(ActionEvent ie) {
  66. text1.setText("Eugens Tools");
  67. }
  68. });
  69. MTools.addActionListener(new ActionListener() {
  70. public void actionPerformed(ActionEvent ie) {
  71. text1.setText("Michaels Tools");
  72. }
  73. });
  74. contantPane.setVisible(true);
  75. fr.setVisible(true);
  76. fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  77. }
  78. public static void main(String[] args) {
  79. Main mn = new Main();
  80. }
  81. }