diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java | |
| download | Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2 | |
Diffstat (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java')
| -rw-r--r-- | Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java b/Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java new file mode 100644 index 0000000..287d8fd --- /dev/null +++ b/Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java @@ -0,0 +1,37 @@ +/* Listing4404.java */
+
+import java.awt.*;
+import java.awt.event.*;
+
+public class Listing4404
+extends Frame
+{
+ public Listing4404()
+ {
+ super("Bean einbinden");
+ setLayout(new FlowLayout());
+ setBackground(Color.lightGray);
+ LightBulb bulb1 = new LightBulb();
+ bulb1.setLightOn(false);
+ add(bulb1);
+ LightBulb bulb2 = new LightBulb();
+ bulb2.setLightOn(true);
+ add(bulb2);
+ addWindowListener(
+ new WindowAdapter() {
+ public void windowClosing(WindowEvent event)
+ {
+ System.exit(0);
+ }
+ }
+ );
+ }
+
+ public static void main(String[] args)
+ {
+ Listing4404 frm = new Listing4404();
+ frm.setLocation(100, 100);
+ frm.pack();
+ frm.setVisible(true);
+ }
+}
\ No newline at end of file |
