Advertisement
sergAccount

Untitled

Oct 18th, 2020
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package game;
  7.  
  8. import javax.swing.JFrame;
  9.  
  10. public class Okno extends JFrame{
  11.    
  12.     int slogn;
  13.     Pole pole;
  14.    
  15.     public Okno(int slogn){
  16.         this.slogn = slogn;
  17.         //
  18.         setTitle("Игра1");
  19.         // установка фокуса  
  20.         setFocusable(true);
  21.         // запрет на изменение размеров главного окна
  22.         setResizable(false);
  23.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  24.         // позиция и размеры окна
  25.         this.setBounds(10, 10, 800, 620);
  26.         // устанавливаем панель для главного окна
  27.         pole = createPanel(slogn);
  28.         getContentPane().add(pole);
  29.         //
  30.         setVisible(true);
  31.     }
  32.     //
  33.     public Pole createPanel(int slogn){        
  34.         return new Pole(slogn);
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement