return new Dimension(maxWidth * 5, 150);
int perLine = getWidth() / maxWidth; if (perLine > 0) { int lines = (brushes.size() + (perLine - 1)) / perLine; return new Dimension(maxWidth, maxWidth * lines); } else { return new Dimension(maxWidth, 150); }
    public Dimension getPreferredSize() {        return new Dimension(maxWidth * 5, 150);    }