简体   繁体   English

如何检查 jframe 窗口打开。如果 jframe 窗口打开而不是单击外部然后在 java 中闪烁 jframe 窗口

[英]How to check jframe window opened .If jframe window opened than click outside then blinking jframe window in java

Allow Only One Jframe window if try to open other than blinking jframe window in java swing **如果在 java swing 中尝试打开闪烁的 jframe 窗口以外的其他窗口,则只允许一个 Jframe 窗口**

HOW如何

** **

I can only guess what your question is supposed to mean, but my best guess would be that you want to create a modal frame.我只能猜测你的问题应该是什么意思,但我最好的猜测是你想创建一个模态框架。 JFrame doesn't support this type of frame. JFrame不支持这种类型的框架。 You'll have to use JDialog ( http://docs.oracle.com/javase/7/docs/api/javax/swing/JDialog.html ) instead.您必须改用JDialog ( http://docs.oracle.com/javase/7/docs/api/javax/swing/JDialog.html )。

JDialog dialog = new JDialog(parentFrame , "someTitle" , true);
... //create dialog

dialog.setVisible(true);
//now the parentFrame is blocked until the dialogwindow is closed

Allow Only One Jframe window if try to open other than blinking jframe window in java swing如果在 java swing 中尝试打开闪烁的 jframe 窗口以外的其他窗口,则只允许一个 Jframe 窗口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM