- 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
Java Program to display JTabbedPane on the right
To display JTabbedPane on the right, you need to set the location to the right using the constant RIGHT −
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.RIGHT);
The following is an example to display JTabbedPane on the right −
Example
package my; import javax.swing.*; public class SwingDemo { public static void main(String args[]) { JFrame frame = new JFrame("Technologies"); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.RIGHT); JPanel panel1, panel2, panel3, panel4, panel5; panel1 = new JPanel(); panel2 = new JPanel(); panel3 = new JPanel(); panel4 = new JPanel(); panel5 = new JPanel(); tabbedPane.addTab("PHP", panel1); tabbedPane.addTab("Blockchain ", panel2); tabbedPane.addTab("Matlab", panel3); tabbedPane.addTab("JSP ", panel4); tabbedPane.addTab("Servlet", panel5); frame.add(tabbedPane); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(550,350); frame.setVisible(true); } }
Output
- Related Articles
- Display all the titles of JTabbedPane tabs on Console in Java
- Java program to set the color of a single tab’s text in a JTabbedPane Container
- Java Program to Segregate 0s on Left Side & 1s on Right Side of the Array
- Java Program to display the contents in JTextArea
- Java program to display English alphabets
- Java Program to display printable characters
- Java Program to Display Fibonacci Series
- How to add a Tab in JTabbedPane with Java?
- How to customize how a JTabbedPane looks in Java?
- Java Program to shift array elements to the right
- Java Program to display upper triangular matrix
- How to disable a Tab in a JTabbedPane Container with Java?
- Java Program to display previous month from GregorianCalendar
- Java Program to display previous day from GregorianCalender
- Java Program to display previous year from GregorianCalendar

Advertisements