开发者

Java question codes on class not executing

开发者 https://www.devze.com 2023-01-27 23:06 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消