- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create Vertical progress bar occupying the entire frame in Java
For this, create a vertical progress bar −
JProgressBar progressBar = new JProgressBar(JProgressBar.VERTICAL); progressBar.setEnabled(true);
Also, set the bounds −
progressBar.setBounds(70, 50, 120, 30);
The following is an example to create vertical progress bar occupying the entire frame −
Example
package my; import java.awt.BorderLayout; import java.awt.Color; import javax.swing.JFrame; import javax.swing.JProgressBar; public class SwingDemo { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JProgressBar progressBar = new JProgressBar(JProgressBar.VERTICAL); progressBar.setEnabled(true); progressBar.setBounds(70, 50, 120, 30); progressBar.setBackground(Color.orange); progressBar.setForeground(Color.white); progressBar.setStringPainted(true); progressBar.setString("1000"); progressBar.setValue(20); frame.setLayout(new BorderLayout()); frame.add(progressBar, BorderLayout.CENTER); frame.setSize(600, 400); frame.setVisible(true); } }
Output
- Related Articles
- How to create a Vertical menu bar in Java?
- How to create a progress bar in HTML?
- How to create a progress bar using JavaFX?
- How to create a download progress bar in Tkinter?
- Create circular Progress Bar in iOS
- Create a progress bar with Bootstrap
- Create a striped Bootstrap progress bar
- How to write Progress Bar in PowerShell?
- Create a Bootstrap progress bar with different styles
- How To Make Circle Custom Progress Bar in Android?
- How to create a vertical toolbar in Java?
- Custom progress Bar in Android?
- Animate Bootstrap progress bar
- Bootstrap progress-bar class
- How to create a stacked bar plot with vertical bars in R using ggplot2?

Advertisements