Hi all,
I'm writing a small class that part of a much larger application that I can't modify. The class is supposed to open a
java program and return a JPanel representing the program's output window. That JPanel will then display in the main program's JFrame.
Here is a snippet of my code:
This code works fine if I create a little main method in this class which gets this JPanel and sticks in in a new JFrame. Nothing wrong there.
However, when the main program tries to get the JPanel to place it in the JFrame, I get:
Where the line referenced at the bottom of that is
Reading through some tutorials, I see that if getJPanel() were called using InvokeLater, the problem should be fixed(?). However, I can't change the code that calls this method. I tried putting the code above in a Runnable, and calling InvokeLater on it, but I get the same error.
Anyone have any clues as to how I can fix this, without changing either the code that calls this method or the WaveInterferenceApplication?
Any help would be much appreciated,
Thanks!
Sam