category loop java try to fix the panel resizing.