第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

java timer,如何實現(xiàn)timertask

java timer,如何實現(xiàn)timertask

慕田峪9158850 2021-04-09 14:15:52
我想每隔一定時間更新對象屬性(調(diào)用休息服務)。我有對象定義和一個帶有new和set的類public class Obj {    private String data;    //Getters and setters}//A class with the new and sets:Public class setData{     public setData{        Obj o = new Obj();        o.setdata("hello");     }     TimerTask timerTask = new MyTimerTask();     Timer timer = new Timer(true);     timer.scheduleAtFixedRate(timerTask, 0, 10*1000);}public class MyTimerTask extends TimerTask {    @Override    public void run() {/*       Here is the question. How can I update the data property of        my object?       I need to call the rest service, and update. The data              string is on a        swing UI.       */    }}這是問題。如何更新對象的數(shù)據(jù)屬性?我需要致電其余服務,并進行更新。數(shù)據(jù)字符串在swing UI上。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 178 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號