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);
    }

}
2 comments
Comment actions Permalink

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.

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);
}
}
---
Original message URL:
http://devnet.jetbrains.net/message/5282956#5282956


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thank you, Dmitry!


You need to either start the third-party application in a separate process,

yeah, I was afraid I was gonna have to do it.

0

Please sign in to leave a comment.