Swing/MillisToDecideToPopup のバックアップソース(No.1)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- バックアップ を表示
- Swing/MillisToDecideToPopup へ行く。
TITLE:ProgressMonitorがダイアログを表示までの待ち時間 #navi(../) #tags(ProgressMonitor, SwingWorker, JProgressBar) RIGHT:Posted by &author(aterai); at 2013-04-15 *ProgressMonitorがダイアログを表示までの待ち時間 [#m3b1b7b4] ``ProgressMonitor``のダイアログが表示されるまでの待ち時間を設定します。 -&jnlp; -&jar; -&zip; //#screenshot #ref(https://lh6.googleusercontent.com/-R5-8dJERlmk/UWrm3iXBukI/AAAAAAAABpk/i7YjNRcIkpM/s800/MillisToDecideToPopup.png) **サンプルコード [#z986c4f1] #code(link){{ monitor = new ProgressMonitor(w, "message", "note", 0, 100); monitor.setMillisToDecideToPopup((int)millisToDecideToPopup.getValue()); monitor.setMillisToPopup((int)millisToPopup.getValue()); }} **解説 [#t949b4fd] - [http://docs.oracle.com/javase/jp/6/api/javax/swing/ProgressMonitor.html#getMillisToDecideToPopup() ``ProgressMonitor#setMillisToDecideToPopup(int)``] -- ``ProgressMonitor``のダイアログを表示するかどうかを決めるまでの待ち時間を設定 -- デフォルト: ``500``ミリ秒 -- この待ち時間の間は``ProgressMonitor``のダイアログは表示されない --- ``ProgressMonitor``で使用する``JProgressBar``が``null``でない場合(``ProgressMonitor``を使い回しして``ProgressMonitor#close()``されていないなど)は、無視してダイアログが表示される場合がある - [http://docs.oracle.com/javase/jp/6/api/javax/swing/ProgressMonitor.html#getMillisToPopup() ``ProgressMonitor#setMillisToPopup(int)``] -- ``ProgressMonitor``のダイアログが表示されるまでの待ち時間を設定 -- デフォルト: ``2000``ミリ秒 -- 予想残り時間がこの時間より短い場合、ダイアログは表示されない --- 予想残り時間は、``JProgressBar``の進捗状況(パーセント)と処理開始からの時間で計算される -- ``ProgressMonitor#getMillisToDecideToPopup()``からの待ち時間ではなく独立している(処理開始からの待ち時間になる) --- ``ProgressMonitor#getMillisToDecideToPopup()``以下の場合は、その直後にダイアログが表示される //**参考リンク **コメント [#u77ad727] #comment