• Post Reply Bookmark Topic Watch Topic
  • New Topic

Identify minimize

 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have two JFrames.If one frame was minimized then i want to identify it.Can anyone help me?

Thank You.
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe a frame becomes deactivated when it is minimized, so you should be able to use a WindowListener to catch this event. Then you would need to use the getExtendedState() method to detemine if the window is iconified.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or just listen to the windowIconified event of WindowListener.
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Or just listen to the windowIconified event of WindowListener.


Even easier ;)
 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thank you very much.

Think I have a class call "main".and I have another one it is "sale". If main class was minimized, then i want to minimize the sale class automatically.If main class was maximized, then i want to maximize the sale class automatically. How can I do this?

Thank you very very much.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a WindowListener to your main frame that iconifies / maximizes the other frame.
 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thank you very very much.
I did it.

Thank you again.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!