martaczaska

Okieninio

Jan 6th, 2020
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package com.company;
  2.  
  3. import javax.swing.JFrame;
  4. import javax.swing.JPanel;
  5. import java.awt.*;
  6.  
  7. public class Okno extends JFrame {
  8.  
  9.     static JPanel karty;
  10.    
  11.     public Okno(int w_okno, int h_okno) {
  12.         super("Witaj w grze!");
  13.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  14.         setSize(w_okno, h_okno);
  15.         setResizable(false);
  16.         setLocationRelativeTo(null);
  17.  
  18.         Menu menu = new Menu();
  19.         Poziomy lvl = new Poziomy();
  20.         Etap_1 e_1 = new Etap_1();
  21.  
  22.         karty = new JPanel(new CardLayout());
  23.         karty.add(menu, "menu");
  24.         karty.add(lvl, "poziomy");
  25.         karty.add(e_1, "etap_1");
  26.         add(karty, BorderLayout.CENTER);
  27.         setVisible(true);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment