From b2505d283d836859af94309413b5aeb192e98147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Fri, 13 May 2016 18:20:28 +0200 Subject: [PATCH] added Control.ioErrorMessage() method (USE THIS TO HANDLE IOExceptions) --- cicaprojekt/ApplicationFrame.java | 2 +- cicaprojekt/Control.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cicaprojekt/ApplicationFrame.java b/cicaprojekt/ApplicationFrame.java index ef377f3..3ae2a3a 100644 --- a/cicaprojekt/ApplicationFrame.java +++ b/cicaprojekt/ApplicationFrame.java @@ -26,7 +26,7 @@ public class ApplicationFrame implements Runnable setGameParams(dungeonSource); gamepanel.drawVisuals(); } catch (IOException e1) { - JOptionPane.showMessageDialog(null, "Nem sikerült cicát nyitni! :("); + Control.ioErrorMessage(); } jframe.add(gamepanel); diff --git a/cicaprojekt/Control.java b/cicaprojekt/Control.java index d3eb8de..e50fc94 100644 --- a/cicaprojekt/Control.java +++ b/cicaprojekt/Control.java @@ -1,5 +1,6 @@ package cicaprojekt; +import javax.swing.*; import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; @@ -69,4 +70,8 @@ public class Control { Game.instance.updateDisplay(); } } + + public static void ioErrorMessage(){ + JOptionPane.showMessageDialog(null, "Nem sikerült betölteni a dzidzás képeket :( ! Biztos a helyükön vannak?"); + } }