Replace deprecated function awt.component.resize()