Fixed issue where mapselectorpanel would initialize more than once
This commit is contained in:
parent
12cb4fd10f
commit
5db401d2ab
@ -13,7 +13,7 @@ public class ApplicationFrame implements Runnable
|
||||
{
|
||||
private JFrame jframe;
|
||||
|
||||
private JPanel mapselectorpanel;
|
||||
private JPanel mapselectorpanel = null;
|
||||
private Display gamepanel;
|
||||
|
||||
private JList<File> filelist;
|
||||
@ -52,7 +52,6 @@ public class ApplicationFrame implements Runnable
|
||||
jframe.remove(gamepanel);
|
||||
jframe.removeKeyListener(keyHandler);
|
||||
initMapselector();
|
||||
jframe.remove(mapselectorpanel);
|
||||
jframe.add(mapselectorpanel);
|
||||
jframe.revalidate();
|
||||
}
|
||||
@ -63,6 +62,8 @@ public class ApplicationFrame implements Runnable
|
||||
}
|
||||
|
||||
private void initMapselector() {
|
||||
if(mapselectorpanel != null)
|
||||
jframe.remove(mapselectorpanel);
|
||||
mapselectorpanel = new JPanel();
|
||||
|
||||
DefaultListModel<File> dungeonslist = new DefaultListModel<>();
|
||||
|
Loading…
Reference in New Issue
Block a user