I have jFrame from which I creating new jDialog frame with DEFAULT_MODALITY_TYPE. Then I maximizing some other app (like browser or something) so my app is not seen. When I want to show my app and clicking on icon from taskbar, it shows only child frame. What can I do to show all frames without disabling modality?
1 に答える
0
あなた自身の質問に答えるのは不適切ですが、将来誰かを助けるかもしれません. いくつかのコーディングの後、この小さな問題を (最終的に) 解決することに決めたので、多くのことを試みました。私にとってうまくいったのは(おそらく、このようにするのは悪い考えです)、mainFrame.setVisible(true)(またはmainFrame.toFront()、この場合に何が悪いのかわかりません)をformWindowGainedFocus(WindowEvent evt)イベントから呼び出すことですその childFrame が呼び出しています。繰り返しますが、この問題を解決するための小さなコード:
public class NewFileFrame extends javax.swing.JDialog {
...
private void formWindowGainedFocus(java.awt.event.WindowEvent evt) {
Main.mainFrame.setVisible(true);
//Main.mainFrame.toFront();
}
...
}
于 2014-05-28T12:51:52.587 に答える