Advertisement
sergAccount

Untitled

Oct 18th, 2020
1,760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 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 java.awt.Image;
  11. import javax.swing.JPanel;
  12.  
  13. public class Pole extends JPanel{
  14.    
  15.     int slogn;
  16.    
  17.     public Pole(int slogn){
  18.         this.slogn = slogn;
  19.     }
  20.     //
  21.     public void paintComponent(Graphics gr){
  22.         super.paintComponent(gr);
  23.         // отображение граф информации
  24.         // drawImage - для отображения информации на основе объекта типа Image        
  25.         String fileName = "k:/images/fon.jpg";        
  26.         Image i = ImageUtil.loadImage(fileName);
  27.         // drawImage - для отображения информации на основе объекта типа Image
  28.         gr.drawImage(i, 0, 0, null);
  29.     }        
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement