Boiled down code for starting the thread for my window:
public static LiDrThread lidrThread;
public void onKeyInput(InputEvent.KeyInputEvent event){
if( lidrThread== null || !lidrThread.isAlive())
{
lidrThread= new LiDrThread();
lidrThread.start();
}
}
Overriden run method in my LiDrThread class, it extends Thread
private LightDrafterWindow window;
@Override
public void run() {
try {
LogHelper.info("Initializing window");
window = new LightDrafterWindow();
LogHelper.info("Setting window Visible");
window.setVisible(true); // altered since original post
} catch (Exception e) {
LogHelper.warn("Window failed to open");
e.printStackTrace();
}
}
This is the boiled down code for my constructor, my window extends JFrame:
public JPanel contentPane;
public LightDrafterWindow() {
LogHelper.info("Accessing PlayerName");
LogHelper.info("Accessing Player Capabilities");
LogHelper.info("Setting up basics of Window");
//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // line 48
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
setContentPane(contentPane);
contentPane.setLayout(null);
//PlayerInfo section -----------------------------------------------------------------------------------------------
LogHelper.info("Initializing player info panel");
contentPane.setVisible(true);
}
there is more after the last LogHelper but this is what shows up in my console:
[18:12:46] [Thread-15/INFO] [lidr]: Initializing window
[18:12:46] [Thread-15/INFO] [lidr]: Accessing PlayerName
[18:12:46] [Thread-15/INFO] [lidr]: Accessing Player Capabilities
[18:12:46] [Thread-15/INFO] [lidr]: Setting up basics of Window
[18:12:46] [Thread-15/WARN] [lidr]: Window failed to open
[18:51:14] [Thread-15/INFO] [STDERR]: [main.java.lidr.thread.LiDrThread:run:23]: java.lang.ArrayIndexOutOfBoundsException: 5
[18:51:14] [Thread-15/INFO] [STDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:21)
[18:51:14] [Thread-15/INFO] [STDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at java.lang.SecurityManager.checkExit(Unknown Source)
[18:51:14] [Thread-15/INFO] [STDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at javax.swing.JFrame.setDefaultCloseOperation(Unknown Source)
[18:51:14] [Thread-15/INFO] [STDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at main.java.lidr.thread.LightDrafterWindow.<init>(LightDrafterWindow.java:48)
[18:51:14] [Thread-15/INFO] [STDERR]: [main.java.lidr.thread.LiDrThread:run:23]: at main.java.lidr.thread.LiDrThread.run(LiDrThread.java:18)
At this point I am not sure what could be going wrong. It seems to be failing on the generated code and I just don't know enough about Gui's to see anything wrong with this.
If you want to see more of the code of I have this project on github
EDIT------------ After commenting out the line that is causing this error, nothing else is causing errors, however the jframe is still not displaying. updated code to reflect changes.