Why declare a JFrame within the script class? Separate it.
public class GUI extends JFrame {
public GUI() {
setTitle("GUI);
...
pack();
setVisible(true);
}
}
Instantiate within the script class
public class ShitScript extends Script {
private GUI gui;
...
@Override
public void onStart() {
gui = new GUI();
}
@Override
public void onExit() {
if(gui != null) gui.dispose();
}
...
}
This way, you can manage your GUI without having to trawl through a ton of unrelated code in the script class.