Is there any mechanizm to detect the Display closing event ?? I mean Display as an object of GLApp class. I am using a Swing window using JFrame and I start GLApp display as an answer od button clicked. I run a method GLApp.run(). But when a close GLApp Display my JFrame also closed itself. I think that GLApp display don't have any method similar to WindowListener from Swing. So if you know how to manage with this trouble, let me know. Is it possible to run GLApp as a diffrent Thread and then kill it only, leaving JFrame still working?
I've got some idea to override method run() in class GLApp and but I don't know how that function should look like. If I could do that I will be able to change the way of exiting the program from calling method exit() wchich shuts down everuthing including my JFrame. My overrided run() looks:
public void run(){
// this == GLApp
this.init();
this.setup();
this.handleEvents();
while(!Keyboard.isKeyDown(Keyboard.KEY_E)) {
this.handleEvents();
this.render();
this.update();
}
this.cleanup();
}
[/b]
Beside detecting closing event I would like to make my JFrame and GLApp display work together. For example, when I change a variable in JFrame window, the changes will be shown in GLApp display. How can I do that??