From ccff798960f403a9f5d2dc6f968a6b570f4c6c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Fri, 13 May 2016 13:06:48 +0200 Subject: [PATCH] implemented event handler for ApplicationFrame's mapselecting --- cicaprojekt/ApplicationFrame.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cicaprojekt/ApplicationFrame.java b/cicaprojekt/ApplicationFrame.java index 62168ca..fd25f86 100644 --- a/cicaprojekt/ApplicationFrame.java +++ b/cicaprojekt/ApplicationFrame.java @@ -26,7 +26,9 @@ public class ApplicationFrame implements Runnable private class ListMouseHandler extends MouseAdapter{ @Override public void mouseClicked(MouseEvent e) { - JOptionPane.showMessageDialog(null, ((JList)e.getComponent()).getSelectedValue().toString()); + jframe.remove(mapselectorpanel); + jframe.add(gamepanel); + jframe.revalidate(); } } @@ -52,10 +54,11 @@ public class ApplicationFrame implements Runnable filelist.addMouseListener(new ListMouseHandler()); mapselectorpanel.add(filelist); + gamepanel = new JPanel(); jframe.add(mapselectorpanel); - //TODO rewrite demo ListMouseHandler and do Game stuff... + // TODO add Ejik's magic to gamepanel } @Override