我正在尝试从一个外部gui应用程序更新时间组件值,该应用程序链接到同一个包中的主gui。任何人都可以帮助更新或刷新gui屏幕与我修改的时间值存储在文件中。?
**SCHEDULER class:** // responsible for retrieving the time value from stored file and display in the main gui.
public static void runTask1(Task_Scheduler tes)
{
if(tes.isActived() >= 1)
{
.... (some operations)
System.out.println("Start time : " + tes.getStartTime());
worker.executeAtAndRepeat(tes.getStartTime().getTime()); // another class method
} else
{
.....
}
}
**GUI class:** // application that i have to update time.
/* GUI components declaration */
public void update_time()
{
...........
...........
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==Ok_button){
try {
update_time(); // This method updates my time.
JOptionPane.showMessageDialog(null, "Updated Successfully !");
.....
} catch (Exception e1) {
e1.printStackTrace();
}
scheduler.runTask1(tes);
}
}
**Task_Scheduler class:** // for passing time value as argument in scheduler class.
...
public Timestamp getStartTime()
{
return startTime;
}
...
以下是我过去一周试图查询同一问题的内容。请参阅此链接,以便有一个共同的想法。 my previous question