在我的 JFrame 中,它循环执行一些任务,我想查看 JFrame 标题中的状态,所以我有这样的东西:
frame.setTitle("当前状态["+Auto_Count_Id+"/"+Auto_Count_Total+" ]");
但它并没有像我需要的那样重新粉刷。所以我尝试了以下方法:
<1>
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
frame.setTitle("Current status [ "+Auto_Count_Id+"/"+Auto_Count_Total+" ]");
}
});
和
<2>
// repaint(long time, int x, int y, int width, int height)
frame.repaint(10,0,0,500,300)
他们也不工作,它只是在任务完成后重新绘制,我该怎么办?