Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以删除下图中的红色区域(在 JProgressBar 上)。
这些是我想删除的进度条顶部和左侧的蓝线。我已经设法使用 paint() 方法将其删除,手动绘制进度条。但可能有更正确的方法。
谢谢,谢尔希。
如果您想修改栏的行为,则子类化JProgressBar和覆盖很好并且完全正确。paint()我不确定你的蓝线是从哪里来的;你在某处设置了阴影效果吗?
JProgressBar
paint()
未经测试,但我认为 progressBar.setBorderPainted(false) 应该可以解决问题。