New dialog has no size

I created a dialog:

public class SearchDialog extends JDialog {
    public SearchDialog() {         setTitle("Find jars");
    }
}


Then, I created a new dialog in an action:

class DialogAction extends AnAction {      def actionPerformed(e: AnActionEvent): Unit = {           def dialog = new SearchDialog           dialog.setSize(500, 420)           dialog.setVisible(true)      } }



But the "dialog.setSize(...)" doesn't work, the new created dialog is on the left top of the screen, and has no size.

See the attached image.

Attachment(s):
QQ截图20110707124104.png
1 comment
Comment actions Permalink

I believe you can debug state of the dialog when it's already shown and has unexpected size. Also you can debug who and why calls setSize() with different arguments on it.

Btw, you can checkout Community Edition sources and check how new dialogs are processed at IntelliJ IDEA code (start from com.intellij.openapi.ui.DialogWrapper)

Denis

0

Please sign in to leave a comment.