You'll need to save the previous component size as an attribute in whatever class is implementing ComponentListener and compare it against the current size of the Component causing the event. ( You can get the current size easily with event.getComponent().getSize()... )
Write once, run anywhere, because there's nowhere to hide! - /. A.C.