Java question codes on class not executing
Im new to java,
so let say i have a class开发者_高级运维 called A
class A {
A {
//init codes
//why does this code below not works?
if(!jFrame1.isVisible() && !jFrame0.isVisible())
jFrame0.setVisible(true);
}
What i am trying to do is, i have two JFrame, so when ppl press button on jFrame0, jFrame0 will be setVisible(false) and jFrame1 will be opened, so how do i achieve when ppl press X/Close on jFrame1, jFrame0 will be visible back?
Obviously, if people press a button on jFrame0
, it is visible (this is true for jFrame1
as well). So the condition in if
becomes false
.
精彩评论