我有一个JDialog,如果它为空,则不应显示。这是我的代码:
MyGridFaultDialog addFaultdialog =
new MyGridFaultDialog(this.parent.getScene(),myFrame, user, this.getLayer());
// The following line creates a very small JDialog which is dragable.
// However, it should not be displayed if it is blank.
MyApp.showCenteredWindow(addFaultdialog, true);
我假设我必须实现一个简单的if
条件以确保不显示一个空对话框,但是我不知道该怎么做。这种状况看起来如何?