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.
イベント リマインダーの作成方法。たとえば、ユーザーが今日の午後 5 時にイベントを作成し、データベースに保存したとします。プログラムを実行すると、システム時間が午後 5 時になるとリマインダーがポップアップ表示されます。それができるAPIはありますか?私がグーグルから得たのはそれらのフリーウェアでした。
Date を使用してアラートを発生させたい時間を表すと仮定すると、ScheduledExecutorService でカスタム Callable タスクをスケジュールします。
このコードは次のようになります。
myScheculer.schedule(alertTime.getTime() - System.currentTimeMillis(), new AlertTask());
AlertTask 実装では、 JOptionPane.showMessage() を使用して通知をポップします。