tags:

views:

56

answers:

2

I have a swing component: a JFrame in fact.

I noticed that when my code myframe.setVisible(flag); is executed it becomes invisible if flag is equal to false and visible otherwise.

Does anybody know why?

A: 

It might be because you're running it from Eclipse try using Netbeans.

thanks, I think you are right.
walter
No, he's not. Unless you didn't explain it properly, the method is doing exactly what it is supposed to - toggle the showing of the component.
Thomas Owens
This is quite possibly the most asinine "Accepted Answer" I have ever seen.
Jason Nichols
it might be 'asinine' but since I switch to Netbeans the problem seems to have gone away
walter
Switching IDEs will not make this problem, as you described it in the question, go away. Either you didn't post the entire story or this question is a fake.
Thomas Owens
Please explain how "javanelson" even knew you were running Eclipse to begin with.
Jason Nichols
you are right. the problem is still there. Netbeans or eclipse.setVisible(true) makes the frame appearsetVisible(true) makes it disappear
walter
What is the matter with all of you - can't you see that my answer was a sarcastic reply to the most stupid question I've ever seen. I'm afraid you've all been taken in by a very unfunny joker ...
+3  A: 

Because that's what the setVisible method does. The JFrame class inherits the setVisible method from java.awt.Window.

Thomas Owens