Advertisement
Zidinjo

Labor1

Mar 25th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package de.marvin.oopLabor1;
  2.  
  3. import javax.swing.JFrame;
  4. import javax.swing.JLabel;
  5.  
  6. public class VieleFenster {
  7.    
  8.     public static void main(String[] args)
  9.     {
  10.         JFrame[] dieFenster = new JFrame[7];
  11.         int breite = 800;
  12.         int hoehe = 800;
  13.        
  14.         for(int i = 0; i<dieFenster.length;i++)
  15.         {
  16.             dieFenster[i] = new JFrame();
  17.             dieFenster[i].setTitle("Fenster"+(1+i));
  18.             dieFenster[i].setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  19.             dieFenster[i].setSize(breite,hoehe);
  20.             dieFenster[i].add(new JLabel("Moin"));
  21.             dieFenster[i].setLocationRelativeTo(null);
  22.             breite = breite- 100;
  23.             hoehe = hoehe - 100;
  24.            
  25.             dieFenster[i].setVisible(true);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement