1

完了するのに数秒かかる 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

この問題の原因について何か考えはありますか? GlassPaneandを使用する代わりに、探しているものを取得するための他のより良い方法はありThreadますか?

4

1 に答える 1