JProgressBar: low values will not be displayed

前端 未结 3 1454
感情败类
感情败类 2020-12-20 18:04

I tried out the function of the JProgressBar in Java. But there is a problem I couldn\'t solve:

When I set the minimum to zero, the maximum value to 100 and the curr

3条回答
  •  离开以前
    2020-12-20 18:30

    It looks like a layout issue / bug when setting the system L&F.

    I managed to hide the bug by setting a preferred size to the progress bar with the issue:

    progressSix.setPreferredSize(new Dimension(200, 15));
    

    It seems to be related to the progress bar size. If I use a BoxLayout instead of the FlowLayout and resize the container enough, I can see it displaying even for smaller values.

提交回复
热议问题