- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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 a vertical toolbar in Java?
Let us first create a toolbar −
JToolBar toolbar = new JToolBar();
Now, set the orientation to create vertical toolbar −
toolbar.setOrientation(SwingConstants.VERTICAL);
The following is an example to create a vertical toolbar in Java −
package my; import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JToolBar; import javax.swing.SwingConstants; public class SwingDemo { public static void main(String[] args) { JFrame frame = new JFrame(); JToolBar toolbar = new JToolBar(); toolbar.setOrientation(SwingConstants.VERTICAL); toolbar.add(new JTextArea()); toolbar.add(new JButton("Submit")); frame.add(toolbar,BorderLayout.WEST); frame.setTitle("Vertical ToolBar"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //frame.setLocationByPlatform(true); frame.setSize(550, 400); frame.setVisible(true); } }
Output
- Related Articles
- How to create a ToolBar in JavaFX?
- How to create a Vertical menu bar in Java?
- How to add separator in a ToolBar with Java?
- Java Program to create a vertical ProgressBar
- How to create vertical button column with GridLayout in Java?
- How to create a left-arrow button on a Toolbar on iPhone/iPad?
- How to create Vertical progress bar occupying the entire frame in Java
- How to create a vertical menu with CSS?
- How to create a vertical line with CSS?
- How to create a circle with vertical lines in R?
- How to use SearchView in Toolbar Android?
- How to create a vertical "button group" with CSS?
- How to create vertical line in xyplot in R?
- How to create a dotted vertical line using ggplot2 in R?
- How to set vertical alignment for a component in Java?

Advertisements