Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Image;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import javax.swing.JOptionPane;
- /*
- * 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.
- */
- /**
- *
- * @author Sergey
- */
- public class Game {
- //
- public static Image loadImage(String fileName){
- //
- try{
- return ImageIO.read(new File(fileName));
- }catch(IOException ex){
- ex.printStackTrace();
- }
- return null;
- }
- //
- public static void main(String[] args){
- //
- String rez = JOptionPane.showInputDialog(null, "Введите сложность игры от 1 от 7:", "Сложность игры", 1);
- int slogn = rez.charAt(0) - '0';
- // Проверка что введена цифра от 1 до 7
- if(slogn>=1 && slogn<=7){
- //Okno window = new Okno(slogn);
- }
- }
- }
- /*
- Image im = loadImage("c:/game/fon.jpg");
- System.out.println("image.h=" + im.getHeight(null));
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement