私はアラームアプリケーションに取り組んでいます。SwingUtilities.invokeLater メソッドを使用して、スヌーズ機能の UI を呼び出しています。しかし、実行すると、 SwingUtilities.invokeLater 関数が呼び出されていないことに気付きました。この問題で私を助けてください
public class IsTime {
int hrs;
int min;
int sec;
GregorianCalendar clk=new GregorianCalendar();
Calendar gtl= Calendar.getInstance();
mp3 mix=new mp3();
public void makeReady(int h,int m,int s,String ampm){
Calendar c1=Calendar.getInstance();
c1.set(Calendar.HOUR_OF_DAY,h);
c1.set(Calendar.MINUTE, m);
c1.set(Calendar.SECOND,s);
if("PM".equals(ampm)){
c1.set(Calendar.AM_PM, Calendar.PM);
if(Calendar.getInstance().get(Calendar.AM_PM)==Calendar.PM){
if(c1.after(Calendar.getInstance())){
check(c1);
}
c1.set(Calendar.DAY_OF_YEAR,c1.get(Calendar.DAY_OF_YEAR)+1);
check(c1);
}
}
if(Calendar.getInstance().get(Calendar.AM_PM)==Calendar.AM){
if(c1.after(Calendar.getInstance())){
check(c1);
}
c1.set(Calendar.DAY_OF_YEAR,c1.get(Calendar.DAY_OF_YEAR)+1);
check(c1);
}
if(Calendar.getInstance().get(Calendar.AM_PM)==Calendar.PM){
c1.set(Calendar.DAY_OF_YEAR,c1.get(Calendar.DAY_OF_YEAR)+1);
check(c1);
}
}
public void check(Calendar ch){
while(!(Calendar.getInstance().after(ch))){//this line checks if it is time to sound alarm
}
SwingUtilities.invokeLater(new Runnable(){//here is my invokelater method
public void run(){
System.out.println("git to invoke");
new Snooze();
}
});
mix.start();
}
public void makeReady(int mis){
Calendar sz=Calendar.getInstance();
sz.set(Calendar.SECOND, 0);
sz.set(Calendar.MINUTE, Calendar.getInstance().get(Calendar.MINUTE)+mis);
check(sz);
}
}