Vorlesungen
  Download     DBS     Sprachen     Oberflächen     File Formats     Impressum     Datenschutz  
1. Sem
2. Sem
3. Sem
GUI I / SAT(II)
MC & AP
Programmierung 3
Prog / Wing
Web-Technologien
4. Sem
5. Sem
Wahlpflicht-SoSe
Wahlpflicht-WiSe
Projektwochen
Allgemein:
Startseite
Vorlesungen
Labore
Sinnvolle Programme
Lineare Regression
GUI-Entwurfsarbeit
Single-Format
Design Pattern-Termine
Observer1
Bsp2
Json-Array
Json-Dialogelemente
Webtechnologien

ActionListener


public class Hauptklasse extends JFrame implements ActionListener {
	
  private final String BN1 = "bn1";

	
  private void setGUI() {
    JButton button1 = new JButton("Klick mich1");
    button1.setFont( new Font("Verdana", Font.PLAIN,18));
    // panelBn.add(button1);

    button1.addActionListener(this);
    button1.setActionCommand( BN1  );
  } // setGUI
	
	
  @Override
  public void actionPerformed(ActionEvent e) {
     String cmd = e.getActionCommand();
     switch (cmd) {
       case BN1:
         button1_Click();
         break;
       default:
          editor.append("\nError in actionPerformed: falsches CMD "+cmd );	
     } // switch
   }
	
   private void button1_Click() {
    syso("in button1_click");
   }

}

KeyListener
GridBagLayout