开发者

this.Visible() won't work on Ecipse contrary Netbeans

I'm usung now Eclipse t开发者_开发问答o develop a Java application. My problem is when I pass from interface I1 to interface I2. I want to hide I1 and show I2 when I click a button in I2.

I tried to use this instruction in NetBeans:

I2 interface = new I2();
this.setVisible(false);
interface.setVisible(true);

But trying this in Eclipse ann error occur, Eclipse ask me to create a mrthod 'setVisible' .. Now I use eclipse ...

this.Visible() won't work on Ecipse contrary Netbeans

Why ?? and what can I do?? Thanks in advance. Best regards, Ali


The two pieces of code are not the same. In the Eclipse example this refers to the anonymous inner class of type ActionListener which I assume doesn't have a setVisible method. I guess you're trying to call the setVisible method of the parent class, try removing this, then it should automatically refer to the parent class' method, like so:

ws.setVisible(true);
setVisible(false);


Yes, the first snapshot is for the project that I work on and the second is for an old project. Thanks for replying! It worked finally... :)

I confirm: setVisible(false); for Eclipse and this.setVisible(false); for NetBeans.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜