2016-07-27 7 views
0

私は、いくつかのPanelDescriptorを持つWizard Iteratorを持っています。 WizardDescriptor.ValidatingPanelを実装する1つのPanelDescriptorで「次へ」をクリックしたときに、待機カーソルを表示しようとしています。その中でvalidate()メソッドが実行されます。「次へ」をクリックしたときに待機カーソルを表示する - Netbeans WizardDescriptor

これまでのところ私はいくつかの方法を試しましたが、それらのどれも私のためには機能しません。

https://community.oracle.com/message/5322657#5322657

try {    
    TopComponent.getRegistry().getActivated().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 
    doBusyStuff(); 
} finally { 
    TopComponent.getRegistry().getActivated().setCursor(Cursor.getDefaultCursor()); 
} 

private static void changeCursorWaitStatus(final boolean isWaiting) { 
    Mutex.EVENT.writeAccess(new Runnable() { 
     public void run() { 
      try { 
       JFrame mainFrame = (JFrame) WindowManager.getDefault().getMainWindow(); 
       Component glassPane = mainFrame.getGlassPane(); 
       if (isWaiting) { 
        glassPane.setVisible(true); 
        glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 
       } else { 
        glassPane.setVisible(false); 
        glassPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); 
       } 
      } catch (Exception e) { 
       // probably not worth handling 
      } 
     } 
    }); 
} 
  • 正しい方向に私を指すように任意のヒント
  • http://netbeans-org.1045718.n5.nabble.com/Setting-wait-cursor-td3026613.html#a3026614

  • http://dev.platform.netbeans.narkive.com/ofiffInN/finally-a-waitcursor-routine-that-works-in-netbeans
    1. が理解う。

    答えて

    1

    含まれているこの

    private static final java.awt.event.MouseAdapter mouseAdapter = new java.awt.event.MouseAdapter() { 
    
        }; 
    
        protected static final Cursor READY_CSR = new Cursor(Cursor.DEFAULT_CURSOR); 
        protected static final Cursor WAIT_CSR = new Cursor(Cursor.WAIT_CURSOR); 
    
        public void setBusy(boolean busy) { 
    
         if(busy) { 
          setCursor(WAIT_CSR); 
          frame.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); 
          frame.getGlassPane().addMouseListener(mouseAdapter); 
          frame.getGlassPane().setVisible(true); 
         }else { 
          setCursor(READY_CSR); 
          frame.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); 
          frame.getGlassPane().removeMouseListener(mouseAdapter); 
          frame.getGlassPane().setVisible(false); 
         } 
        } 
    
    +0

    [第一リンク](http://dev.platform.netbeans.narkive.com/ofiffInN/finally-a-waitcursor-routine-that-works-in-netbeans)を試してみてくださいこのような解決策は私の場合は機能しません。 – kuz

    関連する問題