Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to know the name of the window

 
Nouf Nassri
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

I have 3 frames Fe1, Fe2 and Fe3 The first frame contains two buttons Button 1 << view Fe2 "and button 2 <<viewr Fe2>>
I like when I click a button1 it should check if the frame f3 is active when f3 is active then it must close f3 and display frame f2 and the reverse for button 2

Thank you for the help.
 
Esmaeil Ashrafi
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
have you created any code and faced with problems? if so let us know what's the problem and we'll help you...
By the way with the informations you gave, by looking at (J)Frame's documentations, i would simply suggest you the method
or if you mean something more than just visibility, the methods or
So you can check the status of any frame by these methods and do what you want by means of another methods in JFrame: or
bes of luck
Esmaeil Ashrafi
 
Nouf Nassri
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frame 1

Action Button1


Action Button2
 
Dave Lorde
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can simplify and clarify that:Then simplify further:In fact, you don't even need the 'if' statement - it's OK to call setVisible(true/false) on the frame whether it's visible or not:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic