Created
March 1, 2016 14:09
-
-
Save bitsmuggler/e2a0bb1d99a10f94d7e8 to your computer and use it in GitHub Desktop.
HelloWorld Klasse für Java-Einstieg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
public class HelloWorld { | |
private JButton buttonOK; | |
private JPanel panel1; | |
public HelloWorld() { | |
buttonOK.addActionListener(new ActionListener() { | |
@Override | |
public void actionPerformed(ActionEvent e) { | |
JOptionPane.showMessageDialog(null, "Mein erstes Click-Event! :-)"); | |
} | |
}); | |
} | |
public static void main(String[] args) { | |
JFrame frame = new JFrame(); | |
frame.setContentPane(new HelloWorld().panel1); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
frame.pack(); | |
frame.setVisible(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment