完了するのに数秒かかる Java ルーチンがあります。GlassPane
そのルーチンの実行中にユーザーが UI を変更するのを防ぎ、ルーチンが終了すると自動的に非表示になる (おそらく "prease wait" メッセージが内部にある)をロードしたいと思います。これを行うには、次のコードを使用します。
Thread t = new Thread(new Runnable(){
@Override
public void run() {
/*
* `getPresentation().getFrame()` are methods that return the
* Frame which contains my UI
*/
getPresentation().getFrame().setGlassPane(myGlassPane);
getPresentation().getFrame().getGlassPane().setVisible(true);
}
});
t.start();
//this is the routine that takes several seconds to be executed
runCEM();
//hide the GlassPane
getPresentation().getFrame().getGlassPane().setVisible(false);
に固有のものを設定しjava.awt.Cursor
ましたmyGlassPane
。上記のコードを実行すると、新しいものが表示されますが、「お待ちください」メッセージなどでjava.awt.Cursor
全体が表示されるわけではありません...GlassPane
この問題の原因について何か考えはありますか? GlassPane
andを使用する代わりに、探しているものを取得するための他のより良い方法はありThread
ますか?