sergAccount

Untitled

Oct 18th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 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 java.awt.Color;
  9. import java.awt.Graphics;
  10. import javax.swing.JPanel;
  11.  
  12. public class Pole extends JPanel{
  13.    
  14.     int slogn;
  15.    
  16.     public Pole(int slogn){
  17.         this.slogn = slogn;
  18.     }
  19.     //
  20.     public void paintComponent(Graphics gr){
  21.         super.paintComponent(gr);
  22.         // отображение граф информации
  23.         // drawImage - для отображения информации на основе объекта типа Image
  24.         gr.setColor(Color.red);
  25.         gr.fillRect(10, 10, 200, 200);
  26.     }        
  27. }
  28.  
Add Comment
Please, Sign In to add comment