Forum Discussion

klusht's avatar
klusht
Occasional Contributor
11 years ago

support.UISupport on right click conetext menu dialog suppor

Hi ,
I am baste my head for one day to figure out a solution for this.
I have build a custom dialog that should pop up on a key prees when having the WsdlTestCase focused, and because I dont make the dialog modal, the frame is not showing up.

I have the following :

JprogressFrame = UISupport.getMainFrame() ; // define the owner here tried :UISupport.getMainFrame().getFrames()[0]
dialog = new JDialog(JprogressFrame); // define the 1 top level frame
//dialog.setAlwaysOnTop(true) // does not work...
dialogContentPane = dialog.getContentPane();// get container
dialogContentPane.setLayout(new BorderLayout(10, 10)); // set layout
dialogContentPane.setPreferredSize(new Dimension(300, 45));
dialog.add(progressBar, BorderLayout.NORTH); // add the progress bar component to the content pane ( container )
dialog.pack();
dialog.setLocationRelativeTo(null)
UISupport.showDialog(dialog) // this is setting the visibility to true as well (plus center on screen)
dialog.setVisible(true);

When building this from a groovy step the getMainFrame is not null. and hence is displayed as expected. but when I add this class as a plugin and fier the call from the context menu, the UI main frame is null, so no window is visible until an error is displayed ( which has the modal set to true).
( I don't wish to make it modal , as this is a simple progress bar, so no confirmation is required )

it is true I am novice in swing classes, so I need some help for this, as Google didn't help much.

Thanks in advance,
klusht
No RepliesBe the first to reply