An example with ComponentAdapter
//Detect windows changes window.addComponentListener(new ComponentAdapter( ) { public void componentResized(ComponentEvent ev) { label.setText(ev.toString()); } });