e801. 创建一个JProgressBar组件

A progress bar is used to visually indicate how much a task has been progressed. A progress bar can be oriented horizontally (left-to-right) or vertically (bottom-to-top). By default, the orientation is horizontal.

See also e806 创建进程监听对话框.

    // Create a horizontal progress bar
    int minimum = 0;
    int maximum = 100;
    JProgressBar progress = new JProgressBar(minimum, maximum);
    
    // Create a vertical progress bar
    minimum = 0;
    maximum = 100;
    progress = new JProgressBar(JProgressBar.VERTICAL, minimum, maximum);
Related Examples
原文地址:https://www.cnblogs.com/borter/p/9596187.html