No OpenGL context found in the current thread while using action listener JFrame

Started by Joshi Elijah, October 03, 2019, 09:39:33

Previous topic - Next topic

Joshi Elijah

  Hello,

               I have integrated Display inside JFrame using Canvas and Display.setParent(canvas) method. now i would like to update loader(data) in side Display using JButton aciton listener, Doing this i have faced following error
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: No OpenGL context found in the current thread.
	at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
	at org.lwjgl.opengl.GL30.glDeleteVertexArrays(GL30.java:1530)
	at renderEngine.Loader.cleanUp(Loader.java:38)
	at engineTester.MainGameLoop$2.actionPerformed(MainGameLoop.java:79)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)

I have found useful resource which am exactly facing right now here https://stackoverflow.com/questions/49705658/how-to-get-opengl-context-into-my-current-thread-opengl-context-not-found  I know i have to use Queue and Runnables but i never used them and dont know where to start. Can some one help me with some code ? or a resource where i can start and get my action in work.