Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package game;
- import java.awt.Graphics;
- import java.awt.Image;
- import javax.swing.JPanel;
- public class Pole extends JPanel{
- int slogn;
- Image fon, shapka;
- //
- int shapkaX = 400;
- int shapkaY = 460;
- public Pole(int slogn){
- this.slogn = slogn;
- fon = ImageUtil.loadImage(Game.getFonPath());
- shapka = ImageUtil.loadImage(Game.getShapkaPath());
- }
- //
- public void paintComponent(Graphics gr){
- super.paintComponent(gr);
- // отображение граф информации
- // drawImage - для отображения информации на основе объекта типа Image
- //String fileName = "k:/images/fon.jpg";
- //Image i = ImageUtil.loadImage(fileName);
- // drawImage - для отображения информации на основе объекта типа Image
- gr.drawImage(fon, 0, 0, null);
- gr.drawImage(shapka, shapkaX, shapkaY, null);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement