What is the best way to popup a window in IDEA from plugin

If I want to open a Dialog with some components inside for the user to select, is there a recommended example/way or do I just use standard Swing dialogs/JFrame classes?

MArkee

3 comments
Comment actions Permalink

Hello mark,

If I want to open a Dialog with some components inside for the user to
select, is there a recommended example/way or do I just use standard
Swing dialogs/JFrame classes?


You should use the DialogWrapper base class for your dialog. You can find
many examples of its usage in different third-party plugins.

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


0
Comment actions Permalink

Thanks. Thats very helpful.

0
Comment actions Permalink

if you need a less weighted popup you may consider using
ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder();
JBPopup popup = popupBuilder.createPopup();

You can specify the main component to be rendered in the center of the popup and as well the component to be focused.

0

Please sign in to leave a comment.