979899100101102103104105
size.height -= 2 * BORDER_WIDTH; viewer.setPreferredSize(size); viewer.setSize(size); viewer.setLocation(BORDER_WIDTH, BORDER_WIDTH); add(viewer); viewer.revalidate(); viewer.repaint(); } }