JBPopup with frame
Hi!
How do I create a JBPopup with a frame like the one on CTRL-E.
I used the following:
but this only produces a popup similar to "Parameter Info" without any frame and no title.
Cheers,
Robert
Please sign in to leave a comment.
Hello Robert,
RB> How do I create a JBPopup with a frame like the one on CTRL-E.
RB> I used the following:
RB>
ComponentPopupBuilder builder = RB> JBPopupFactory.getInstance().createComponentPopupBuilder(myComp, RB> myComp); RB> builder.setResizable(true); RB> builder.setTitle("SomeTitle"); RB> builder.setRequestFocus(true); RB> RB> builder.createPopup().showCenteredInCurrentWindow(psiElement.getProj RB> ect()); RB> ]]>RB> but this only produces a popup similar to "Parameter Info" without
RB> any frame and no title.
Here's how the Recent Files popup is built:
new PopupChooserBuilder(list).
setTitle(IdeBundle.message("title.popup.recent.files")).
setMovable(true).
setItemChoosenCallback(runnable).
addAdditionalChooseKeystroke(getAdditionalSelectKeystroke()).
createPopup().showCenteredInCurrentWindow(project);
--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks, that could help. Currently the popup is only a list. So it will work, but as soon as it becomes a more complex widget, the PopupChooserBuilder won't work. Is there a way to create a popup with a frame that uses a JPanel as the component instead of a JList?
Cheers,
Robert
I found out myself.
I had to make the popup movable and not resizable to get the frame.
Cheers,
Robert