setMinimumSize(new Dimension(Math.max(200, width), height));
    private void resetPreferredSize() {        int width = 0;        for (int i = 0; i < images.length; i++) {            width += images[i].getWidth(null);        }        this.trainWidth = width;        this.setPreferredSize(new Dimension(width, height));    }