Swing/IndeterminateCycleTime のバックアップ(No.12)
- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- Swing/IndeterminateCycleTime へ行く。
- 1 (2013-07-17 (水) 14:56:10)
- 2 (2015-02-19 (木) 18:39:48)
- 3 (2016-12-13 (火) 16:18:55)
- 4 (2017-12-05 (火) 18:38:04)
- 5 (2018-02-20 (火) 19:10:32)
- 6 (2020-02-14 (金) 16:22:06)
- 7 (2021-08-03 (火) 14:56:26)
- 8 (2025-01-03 (金) 08:57:02)
- 9 (2025-01-03 (金) 09:01:23)
- 10 (2025-01-03 (金) 09:02:38)
- 11 (2025-01-03 (金) 09:03:21)
- 12 (2025-01-03 (金) 09:04:02)
- category: swing
folder: IndeterminateCycleTime
title: JProgressBarの不確定進捗サイクル時間を設定
tags: [JProgressBar, UIManager]
author: aterai
pubdate: 2013-07-15T00:07:35+09:00
description: JProgressBarの不確定進捗状態アニメーションで使用するサイクル時間などを設定します。
image:
Summary
JProgressBar
の不確定進捗状態アニメーションで使用するサイクル時間などを設定します。
Screenshot
![Swing/IndeterminateCycleTime screenshot](https://ateraimemo.com/swing/indeterminatecycletime/screenshot.png)
Advertisement
Source Code Examples
UIManager.put("ProgressBar.repaintInterval", (Integer) repaintIntervalSpinner.getValue());
UIManager.put("ProgressBar.cycleTime", (Integer) cycleTimeSpinner.getValue());
progressBar.setIndeterminate(true);
View in GitHub: Java, KotlinExplanation
上記のサンプルでは、UIManager
を使ってJProgressBar
の不確定進捗のアニメーションで使用するサイクル時間と再ペイント間隔をミリ秒で指定しています。
WindowsLookAndFeel
などの場合、JProgressBar#setIndeterminate(true)
が実行されるタイミングでこれらの値は更新されます。
- サイクル時間:
ProgressBar.cycleTime
UIManager.put("ProgressBar.cycleTime", 1000)
- サイクル時間が再ペイント間隔の偶数倍でない場合、サイクル時間は自動的にそうなるように増加する
- 再ペイント間隔:
ProgressBar.repaintInterval
UIManager.put("ProgressBar.repaintInterval", 10)