# Das endlos Java-Programm



## tom1985 (2. Jul 2005)

Wie wäre es wenn wir hier ein Programm programmieren.
Das Ende ist noch nicht bekannt , da jeder nur eine Zeile hinzufügt.
Was aus dem Programm wird hängt also von euch ab...
Ist also wie eine endlosgeschichte wo jeder ein Wort hinzufügt.
Zu beachten ist allerdings , das das Programm dennoch lauffähig bleibt...
Damit die Übersicht erhalten bleibt , kopiert immer das bereits gepostete Material in euren Post mit 

Ich mach mal den Anfang :




import java.awt.*;


----------



## tom1985 (2. Jul 2005)

```
import java.awt.*; 
import java.util.*;
import java.awt.event.*;
```


----------



## Beni (2. Jul 2005)

[OT]ups, sorry, hab aus versehen mein Post gelöscht. Ich schrieb ein "import java.util.*;" rein.[/OT]


```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

public class Hallo extends Frame{
```


----------



## Surma (2. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 

public class Hallo extends Frame{
  int var1 = 23 ;
```


----------



## Beni (2. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 

public class Hallo extends Frame{
  int var1 = 23 ;
  private Color color = Color.BLUE;
```

Hm, Java 1.5 oder Java 1.4?


----------



## KISS (2. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

/**
 * please enhance comment as soon as a funtion is recoginizeable 
 */
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;
 
   /**
    * constructor
    */
   private Hello()
   {
       super("Hello by java-forum.org");
   }
   
}
```


----------



## 8ull23y3 (2. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hello()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
   }
   
}
```


----------



## Roar (2. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hello()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
   }
   
}
```


----------



## KISS (2. Jul 2005)

vieliecht waere es besser wenn jeder immer eine methode hinzufuegt, wir sind doch hier oo


```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hello()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   
}
```


----------



## 8ull23y3 (2. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hello()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {

   }
}
```


----------



## KISS (2. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hello()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolbar=new JToolBar();
      initToolBar(toolBar);
      add(toolbar,BorderLayout.CENTER);   
   }
}
```


----------



## Icewind (2. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.CENTER);   
   }

   private void initToolBar(JToolBar toolBar)
   {
   }
}
```

ps: hab ein paar kleinere fehler ausgebessert


----------



## Roar (2. Jul 2005)

nanana KISS swing und AWT mischt man aber nicht :bae:


```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.CENTER);   
   }

   public void paint(Graphics g) {
       g.drawString(20, 40, "Java is cool 8)");
   }

   private void initToolBar(JToolBar toolBar)
   {
   }
}
```


----------



## Beni (3. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.CENTER);   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.drawString(20, 40, "Java is cool 8)");
   }

   private void initToolBar(JToolBar toolBar)
   {
   }
}
```


----------



## Roar (3. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString(20, 40, "Java is cool 8)");
   }

   private void initToolBar(JToolBar toolBar)
   {
   }
}
```


----------



## Icewind (3. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString("Java is cool 8)", 20, 40);
   }

   private void initToolBar(JToolBar toolBar)
   {
	   toolBar.add(new JLabel("test"));
   }
}
```


----------



## Beni (3. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString("Java is cool 8)", 20, 40);
   }

   private void initToolBar(JToolBar toolBar)
   {
	   toolBar.add(new JLabel("test"));
   }

   ---
   public static void main( String[] args ){
   }
}
```


----------



## 8ull23y3 (3. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString("Java is cool 8)", 20, 40);
   }

   private void initToolBar(JToolBar toolBar)
   {
      toolBar.setEnabled(false);
      toolBar.add(new JLabel("test"));
   }

   ---
   public static void main( String[] args ){
   }
}
```


----------



## Icewind (3. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }
    
   public Hallo(Color color)
   {
       this(); // Roar: muss andersrum sein ;)
       this.color=color;
   }

   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString("Java is cool 8)", 20, 40);
   }

   private void initToolBar(JToolBar toolBar)
   {
      toolBar.setEnabled(false);
      toolBar.add(new JLabel("test"));
   }

   //---
   public static void main( String[] args ){
   }
}
```


----------



## SebiB90 (4. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 

/** 
* please enhance comment as soon as a funtion is recoginizeable 
*/ 
public class Hallo extends Frame 
{ 
  int var1 = 23 ; 
  private Color color = Color.BLUE; 

   /** 
    * constructor 
    */ 
   private Hallo() 
   { 
       super("Hello by java-forum.org"); 
       setSize(640, 480); 
       setLocationRelativeTo(null); 
       initUI(); 
   } 
    
   public Hallo(Color color) 
   { 
       this(); // Roar: muss andersrum sein ;) 
       this.color=color; 
   } 

   public void initUI() 
   { 
      //works since 1.5 
      setLayout(new BorderLayout()); 
      final JToolBar toolBar=new JToolBar(); 
      initToolBar(toolBar); 
      add(toolBar,BorderLayout.NORTH); //bessa oben :D    
   } 

   public void paint(Graphics g) { 
       g.setColor( color ); 
       g.setFont(g.getFont().deriveFont(var1)); 
       g.drawString("Java is cool 8)", 20, 40); 
   } 

   private void initToolBar(JToolBar toolBar) 
   { 
      toolBar.setEnabled(false); 
      toolBar.add(new JLabel("test")); 
   } 

   //--- 
   public static void main( String[] args ){ 
     Hallo hallo = new Hallo(Color.RED);
   } 
}
```


----------



## Beni (4. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 

/** 
* please enhance comment as soon as a funtion is recoginizeable 
*/ 
public class Hallo extends Frame 
{ 
  int var1 = 23 ; 
  private Color color = Color.BLUE; 

   /** 
    * constructor 
    */ 
   private Hallo() 
   { 
       super("Hello by java-forum.org"); 
       setSize(640, 480); 
       setLocationRelativeTo(null); 
       initUI(); 
   } 
    
   public Hallo(Color color) 
   { 
       this(); // Roar: muss andersrum sein ;) 
       this.color=color; 
   } 

   public void initUI() 
   { 
      //works since 1.5 
      setLayout(new BorderLayout()); 
      final JToolBar toolBar=new JToolBar(); 
      initToolBar(toolBar); 
      add(toolBar,BorderLayout.NORTH); //bessa oben :D    
   } 

   public void paint(Graphics g) { 
       g.setColor( color ); 
       g.setFont(g.getFont().deriveFont(var1)); 
       g.drawString("Java is cool 8)", 20, 40); 
   } 

   private void initToolBar(JToolBar toolBar) 
   { 
      toolBar.setEnabled(false); 
      toolBar.add(new JLabel("test")); 
   } 

   //--- 
   public static void main( String[] args ){ 
     Hallo hallo = new Hallo(Color.RED);
     hallo.setVisible( true );
   } 
}
```


----------



## Sky (4. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 

/** 
* please enhance comment as soon as a funtion is recoginizeable 
*/ 
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       initUI();
   }

   public Hallo(Color color)
   {
       this(); // Roar: muss andersrum sein ;)
       this.color=color;
   }

   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D
   }

   public void paint(Graphics g) {
       super.paint(g);
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString("Java is cool 8)", 20, 60); // muss jetzt a bissle tiefer, da nun auch die toolbar angezeigt wird
   }

   private void initToolBar(JToolBar toolBar)
   {
      toolBar.setEnabled(false);
      toolBar.add(new JLabel("test"));
   }

   //---
   public static void main( String[] args ){
     Hallo hallo = new Hallo(Color.RED);
     hallo.setVisible( true );
   }
}
```


----------



## 8ull23y3 (4. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
* please enhance comment as soon as a funtion is recoginizeable
*/
public class Hallo extends Frame
{
  int var1 = 23 ;
  private Color color = Color.BLUE;

   /**
    * constructor
    */
   private Hallo()
   {
       super("Hello by java-forum.org");
       setSize(640, 480);
       setLocationRelativeTo(null);
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       initUI();
   }
   
   public Hallo(Color color)
   {
       this(); // Roar: muss andersrum sein ;)
       this.color=color;
   }

   public void initUI()
   {
      //works since 1.5
      setLayout(new BorderLayout());
      final JToolBar toolBar=new JToolBar();
      initToolBar(toolBar);
      add(toolBar,BorderLayout.NORTH); //bessa oben :D   
   }

   public void paint(Graphics g) {
       g.setColor( color );
       g.setFont(g.getFont().deriveFont(var1));
       g.drawString("Java is cool 8)", 20, 40);
   }

   private void initToolBar(JToolBar toolBar)
   {
      toolBar.setEnabled(false);
      toolBar.add(new JLabel("test"));
   }

   //---
   public static void main( String[] args ){
     Hallo hallo = new Hallo(Color.RED);
     hallo.setVisible( true );
   }
}
```


----------



## Gast (5. Jul 2005)

Coole Idee  :toll:


----------



## neXyon (5. Jul 2005)

```
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * Warning: Do not use this class! You could damage your brain!
 */
public class Hallo extends JFrame
{
  int var1 = 23;
  private Color color = Color.BLUE;
  
  /**
   * Creates a new instance of Hello
   */
  private Hallo()
  {
    super("Hello by java-forum.org");
    setSize(640, 480);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    initUI();
  }
  
  /**
   * Creates a new instance of Hello
   * @param color The color
   */
  public Hallo(Color color)
  {
    this(); // Roar: muss andersrum sein ;)
    this.color=color;
  }
  
  /**
   * Initializes the user interface of the the form
   */
  public void initUI()
  {
    //works since 1.5
    setLayout(new BorderLayout());
    final JToolBar toolBar=new JToolBar();
    initToolBar(toolBar);
    add(toolBar,BorderLayout.NORTH); //bessa oben :D
  }
  
  /**
   * Draws the frame
   * @param g The Graphics object to draw on
   */
  public void paint(Graphics g)
  {
    super.paint(g);
    g.setColor(color);
    g.setFont(g.getFont().deriveFont(var1));
    g.drawString("Java is cool 8)", var1, 100);
  }
  
  /**
   * Initializes the toolbar of the form
   */
  private void initToolBar(JToolBar toolBar)
  {
    toolBar.setEnabled(false);
    toolBar.add(new JLabel("test"));
    toolBar.add(new JButton("Click me!"));
  }
  
  /**
   * The main method of the application - please do not run!
   * @param args The arguments passed to the application
   */
  public static void main(String[] args)
  {
    Hallo hallo = new Hallo(Color.RED);
    hallo.setVisible(true);
  }
}
```


----------



## Gast (13. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 

/** 
* Warning: Do not use this class! You could damage your brain! 
*/ 
public class Hallo extends JFrame 
{ 
  int var1 = 23; 
  private Color color = Color.BLUE; 
  
  /** 
   * Creates a new instance of Hello 
   */ 
  private Hallo() 
  { 
    super("Hello by java-forum.org"); 
    setSize(640, 480); 
    setLocationRelativeTo(null); 
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
    initUI(); 
  } 
  
  /** 
   * Creates a new instance of Hello 
   * @param color The color 
   */ 
  public Hallo(Color color) 
  { 
    this(); // Roar: muss andersrum sein ;) 
    this.color=color; 
  } 
  
  /** 
   * Initializes the user interface of the the form 
   */ 
  public void initUI() 
  { 
    //works since 1.5 
    setLayout(new BorderLayout()); 
    final JToolBar toolBar=new JToolBar(); 
    initToolBar(toolBar); 
    add(toolBar,BorderLayout.NORTH); //bessa oben :D 
  } 
  
  /** 
   * Draws the frame 
   * @param g The Graphics object to draw on 
   */ 
  public void paint(Graphics g) 
  { 
    super.paint(g); 
    g.setColor(color); 
    g.setFont(g.getFont().deriveFont(var1)); 
    g.drawString("Java is cool 8)", var1, 100); 
  } 
  
  /** 
   * Initializes the toolbar of the form 
   */ 
  private void initToolBar(JToolBar toolBar) 
  { 
    toolBar.setEnabled(false); 
    toolBar.add(new JLabel("test")); 
    toolBar.add(new JButton("Click me!")); 
  } 
  
  /** 
   * The main method of the application - please do not run! 
   * @param args The arguments passed to the application 
   */ 
  public static void main(String[] args) 
  { 
    Hallo hallo = new Hallo(Color.RED); 
    hallo.setVisible(true); 
  }


public void actionPerformed(ActionEvent e) // ActionListener
		{
			if ( e.getSource() =="Click me!" )
			{
 
}
```


----------



## Gast (13. Jul 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 

/** 
* Warning: Do not use this class! You could damage your brain! 
*/ 
public class Hallo extends JFrame 
{ 
int var1 = 23; 
private Color color = Color.BLUE; 

/** 
* Creates a new instance of Hello 
*/ 
private Hallo() 
{ 
super("Hello by java-forum.org"); 
setSize(640, 480); 
setLocationRelativeTo(null); 
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
initUI(); 
} 

/** 
* Creates a new instance of Hello 
* @param color The color 
*/ 
public Hallo(Color color) 
{ 
this(); // Roar: muss andersrum sein  
this.color=color; 
} 

/** 
* Initializes the user interface of the the form 
*/ 
public void initUI() 
{ 
//works since 1.5 
setLayout(new BorderLayout()); 
final JToolBar toolBar=new JToolBar(); 
initToolBar(toolBar); 
add(toolBar,BorderLayout.NORTH); //bessa oben  
} 

/** 
* Draws the frame 
* @param g The Graphics object to draw on 
*/ 
public void paint(Graphics g) 
{ 
super.paint(g); 
g.setColor(color); 
g.setFont(g.getFont().deriveFont(var1)); 
g.drawString("Java is cool ", var1, 100); 
} 

/** 
* Initializes the toolbar of the form 
*/ 
private void initToolBar(JToolBar toolBar) 
{ 
toolBar.setEnabled(false); 
toolBar.add(new JLabel("test")); 
toolBar.add(new JButton("Click me!")); 
} 

/** 
* The main method of the application - please do not run! 
* @param args The arguments passed to the application 
*/ 
public static void main(String[] args) 
{ 
Hallo hallo = new Hallo(Color.RED); 
hallo.setVisible(true); 
} 


public void actionPerformed(ActionEvent e) // ActionListener 
{ 
if ( e.getSource() =="Click me!" ) 
{ 

}
```


----------



## Java-Pro (1. Sep 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 

/** 
* Warning: Do not use this class! You could damage your brain! 
*/ 
public class Hallo extends JFrame 
{ 
int var1 = 23; 
private Color color = Color.BLUE; 

/** 
* Creates a new instance of Hello 
*/ 
private Hallo() 
{ 
super("Hello by java-forum.org"); 
setSize(640, 480); 
setLocationRelativeTo(null); 
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
initUI(); 
} 

/** 
* Creates a new instance of Hello 
* @param color The color 
*/ 
public Hallo(Color color) 
{ 
this(); // Roar: muss andersrum sein  
this.color=color; 
} 

/** 
* Initializes the user interface of the the form 
*/ 
public void initUI() 
{ 
//works since 1.5 
setLayout(new BorderLayout()); 
final JToolBar toolBar=new JToolBar(); 
initToolBar(toolBar); 
add(toolBar,BorderLayout.NORTH); //bessa oben  
} 

/** 
* Draws the frame 
* @param g The Graphics object to draw on 
*/ 
public void paint(Graphics g) 
{ 
super.paint(g); 
g.setColor(color); 
g.setFont(g.getFont().deriveFont(var1)); 
g.drawString("Java is cool ", var1, 100); 
} 

/** 
* Initializes the toolbar of the form 
*/ 
private void initToolBar(JToolBar toolBar) 
{ 
toolBar.setEnabled(false); 
toolBar.add(new JLabel("test")); 
toolBar.add(new JButton("Click me!")); 
} 

/** 
* The main method of the application - please do not run! 
* @param args The arguments passed to the application 
*/ 
public static void main(String[] args) 
{ 
Hallo hallo = new Hallo(Color.RED); 
hallo.setVisible(true); 
} 


public void actionPerformed(ActionEvent e) // ActionListener 
{ 
if ( e.getSource() =="Click me!" ) 
{ 

}
```


----------



## KSG9|sebastian (1. Sep 2005)

```
import java.awt.*; 
import java.util.*; 
import java.awt.event.*; 
import javax.swing.*; 
import java.util.*

/** 
* Warning: Do not use this class! You could damage your brain! 
*/ 
public class Hallo extends JFrame 
{ 
int var1 = 23; 
private Color color = Color.BLUE; 
private Map paintableComponents;
/** 
* Creates a new instance of Hello 
*/ 
private Hallo() 
{ 
super("Hello by java-forum.org"); 
paintableComponents = new HashMap();
setSize(640, 480); 
setLocationRelativeTo(null); 
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
initUI(); 
} 

/** 
* Creates a new instance of Hello 
* @param color The color 
*/ 
public Hallo(Color color) 
{ 
this(); // Roar: muss andersrum sein  
this.color=color; 
} 

/** 
* Initializes the user interface of the the form 
*/ 
public void initUI() 
{ 
//works since 1.5 
setLayout(new BorderLayout()); 
final JToolBar toolBar=new JToolBar(); 
initToolBar(toolBar); 
add(toolBar,BorderLayout.NORTH); //bessa oben  
} 

/** 
* Draws the frame 
* @param g The Graphics object to draw on 
*/ 
public void paint(Graphics g) 
{ 
super.paint(g); 
g.setColor(color); 
g.setFont(g.getFont().deriveFont(var1)); 
g.drawString("Java is cool ", var1, 100); 
} 

/** 
* Initializes the toolbar of the form 
*/ 
private void initToolBar(JToolBar toolBar) 
{ 
toolBar.setEnabled(false); 
toolBar.add(new JLabel("test")); 
toolBar.add(new JButton("Click me!")); 
} 

/** 
* The main method of the application - please do not run! 
* @param args The arguments passed to the application 
*/ 
public static void main(String[] args) 
{ 
Hallo hallo = new Hallo(Color.RED); 
hallo.setVisible(true); 
} 
/**
* adds a paintable to the map
* @param p the name of the component
*/
public void addPaintable(String name, Paintable p){
   if(!paintableComponents.contains(name))
      paintableComponents.put(name, p);

}
/**
* get a paintable component
* @param name the name of the component
* return the component named <name>
*/
public Paintable getPaintable(String name){
   Object o = null;
   if((o = paintableComponents.get(name)) != null)
      return (Paintable)o;
   else
      return o;
}
/**
* draws the paintable components on the form
*/
private void paintPaintables(){

}
public void actionPerformed(ActionEvent e) // ActionListener 
{ 
if ( e.getSource() =="Click me!" ) 
{ 

}
```


```
public interface Paintable{
   private String name;

   public String getName();
   public void setName(String name);

   public void paint(Graphics g);

}
```


----------



## Roar (1. Sep 2005)

uff, ich glaub is jetz genug ^^
btw: if ( e.getSource() =="Click me!" )  :lol:


----------

