Dimension () { Dimension windowSize = DiffUtil.getDefaultDiffWindowSize(); Dimension size = super.getPreferredSize(); return new Dimension(Math.max(windowSize.width, size.width), Math.max(windowSize.height, size.height)); }