private void checkAndAddResizeHandler(){
  Component parent=getParent();
  if (parent != null && resizable && resizeHandler == null) {
    resizeHandler=new ResizeHandler();
    parent.addComponentListener(resizeHandler);
  }
}

private void checkAndAddResizeHandler ( ) { Component parent = getParent ( ) ; if ( parent != null && resizable && resizeHandler == null ) { resizeHandler = new ResizeHandler ( ) ; parent . addComponentListener ( resizeHandler ) ; } }
checks conditions and adds resize handler if they are met .
