Detect a user click on iconize swing application.

I have a swing application,

If a user iconize my program, the user must click on jframe inside the microsotf windows toolbar to maximize it.

I want to detect when a user click on iconize swing application.

i try to use this listener, but it's not listen when youser click on jframe of my application and the jframe is iconize on window microsoft toolbar.

How i can do it?

addMouseListener(new MouseListener(){

publicvoid mouseClicked(MouseEvent e){

System.err.println("mouseClicked:");<- it's not work

}

publicvoid mouseEntered(MouseEvent e){

System.err.println("mouseEntered:"); <- it'swork

}

publicvoid mouseExited(MouseEvent e){

// TODO Auto-generated method stub

}

publicvoid mousePressed(MouseEvent e){

// TODO Auto-generated method stub

}

publicvoid mouseReleased(MouseEvent e){

// TODO Auto-generated method stub

}

});

[1849 byte] By [andream1977a] at [2007-10-2 2:07:55]
# 1
Look at the WindowListener, methods windowIconified(WindowEvent e) and windowDeiconified(WindowEvent e) .
PhHeina at 2007-7-15 19:49:24 > top of Java-index,Desktop,Core GUI APIs...
# 2

ok it's work but i have one other problem

i have a dialog A and a dialog B

when user click on dialog A, i also show dialog B with this code:

B.toFront();

the problem is this, if B is iconized, the method toFront() has no effect on B, how i can resolve this problem?

thx

andream1977a at 2007-7-15 19:49:24 > top of Java-index,Desktop,Core GUI APIs...
# 3
Hi everyone, Are any of your dialogs modal?Richard West
andream1977a at 2007-7-15 19:49:24 > top of Java-index,Desktop,Core GUI APIs...
# 4

window A is a jframe because it's the main frame

window B is a jframe and i can not use jdialog because i need the iconize and maximize button

any idea is accepted :-D

to resolve my problem i need a modal jframe (with iconize button) but jframe is not modal

or a modal jdialog with iconize button but a jdialog don't have that buttons

andream1977a at 2007-7-15 19:49:24 > top of Java-index,Desktop,Core GUI APIs...