Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.marvin.oopLabor1;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- public class VieleFenster {
- public static void main(String[] args)
- {
- JFrame[] dieFenster = new JFrame[7];
- int breite = 800;
- int hoehe = 800;
- for(int i = 0; i<dieFenster.length;i++)
- {
- dieFenster[i] = new JFrame();
- dieFenster[i].setTitle("Fenster"+(1+i));
- dieFenster[i].setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- dieFenster[i].setSize(breite,hoehe);
- dieFenster[i].add(new JLabel("Moin"));
- dieFenster[i].setLocationRelativeTo(null);
- breite = breite- 100;
- hoehe = hoehe - 100;
- dieFenster[i].setVisible(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement