From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../hjp5/examples/Listing4404.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/Listing4404.java') 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 -- cgit v1.2.3