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 --- Bachelor/ERGO/Praktikum1/test.java | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Bachelor/ERGO/Praktikum1/test.java (limited to 'Bachelor/ERGO/Praktikum1') diff --git a/Bachelor/ERGO/Praktikum1/test.java b/Bachelor/ERGO/Praktikum1/test.java new file mode 100644 index 0000000..bc32d47 --- /dev/null +++ b/Bachelor/ERGO/Praktikum1/test.java @@ -0,0 +1,68 @@ +/* + * Created on 17.10.2005 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ + +/** + * @author sven + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +import java.awt.*; +import javax.swing.*; + +public class test extends JFrame{ + Container c; + JLabel beschrift; + public test() + { + c = getContentPane(); + c.setLayout(new FlowLayout()); + beschrift = new JLabel ("Text im Frame"); + c.add(beschrift); + } + public test(String[] labelText) + { + /** + * @param labelText in + */ + c = getContentPane(); + c.setLayout(new FlowLayout()); + String LabelText=""; + for (int i=1;i [] []"); + } + public Color getRandomColor() { + Color myColor = new Color ((float) Math.random(),(float) Math.random(),(float) Math.random()); + return myColor; + } + public static void main(String[] args) { + test TestWinClass; + if (args.length == 0) { + TestWinClass = new test(); + TestWinClass.hilfe(); + } + else { + TestWinClass = new test(args); + } + TestWinClass.setTitle("Frame mit Text"); + TestWinClass.setSize(300,150); + TestWinClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + TestWinClass.setVisible(true); + + } +} -- cgit v1.2.3