implemented event handler for ApplicationFrame's mapselecting
This commit is contained in:
parent
e25cc615cd
commit
ccff798960
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user