How to start another swing application from an action
I have a third party swing application that does some changes to current L&F (for example sets the default panel background black), and when I start this application from a plugin aciton, L&F in IDE also changes: all panels become black.
Is there any way to avoid this? Here is a sample action, illustrating my promblem:
public class TestAction extends AnAction {
public void actionPerformed(AnActionEvent e) {
runApplication();
}
private void runApplication() {
UIManager.put("Panel.background", Color.BLACK);
JFrame frame = new JFrame();
frame.setSize(200, 300);
frame.setVisible(true);
}
}
Please sign in to leave a comment.
Hello Konstantin,
You need to either start the third-party application in a separate process,
or restore your changes to UIManager after the third-party code has finished
running.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thank you, Dmitry!
yeah, I was afraid I was gonna have to do it.