implemented event handler for ApplicationFrame's mapselecting

This commit is contained in:
Kjistóf 2016-05-13 13:06:48 +02:00
parent e25cc615cd
commit ccff798960

View File

@ -26,7 +26,9 @@ public class ApplicationFrame implements Runnable
private class ListMouseHandler extends MouseAdapter{ private class ListMouseHandler extends MouseAdapter{
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
JOptionPane.showMessageDialog(null, ((JList<File>)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()); filelist.addMouseListener(new ListMouseHandler());
mapselectorpanel.add(filelist); mapselectorpanel.add(filelist);
gamepanel = new JPanel();
jframe.add(mapselectorpanel); jframe.add(mapselectorpanel);
//TODO rewrite demo ListMouseHandler and do Game stuff... // TODO add Ejik's magic to gamepanel
} }
@Override @Override