i have this wierd exception wheere it's stack trace IS NOT HELPING OR SHOWING WHERE IT IS FROM !!!!!!!!! .
I'v searched about it and the usefull resault with someone who did have the same glitch when using a modal JDialog instances and disposing it with KeyListner while the frame owner alwaysOnTop proprety is set to false .
But in my case i havn't use any dialogs at all!! here is the exception stack trace :
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location at java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:2062) at java.awt.Component.getLocationOnScreen(Component.java:2036) at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(JTextComponent.java:4643) at sun.awt.im.InputMethodContext.getTextLocation(InputMethodContext.java:278) at sun.awt.windows.WInputMethod$1.run(WInputMethod.java:588) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) I haven't used this app for a while and i can confirm that no one did mess with the code ,earlier i was devoloping the app in a linux enviroment it didn't throw that exception , but after changing my laptop and the enviroment to windows somehow this is happenning . I need to deliver my app soon and this exception have a strange thing that it's not thrown every time i open my app ! and i couldn't face any pattern to notice when it wil be thrown or what specific action that would do that . what am asing is if any one did face off a strange case like this what is it usually from ?? and thanks in advance .
Edit
Found the solution !I just found it at bugzilla it seems to be some sort of bug when is extending JRootPane without implemeting RootPaneContainer in windows in Runtime: Java(TM) SE Runtime Environment 1.8.0_141-b15 with some gpu and methods related stuff i couldn't understand and if also used modal JDialogs without the owner always on top when using the default rootpane button of the dialogs to exit .
it's not thrown every time i open my app- Swing components should be created and updated on the Event Dispatch Thread (EDT), otherwise you can have random results. Read the Swing tutorial on Concurrency for more information and examples of the proper way to create the GUI.