Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the shape of a JTabbedPane tab?

I am trying to change the shape of the tabs in a JTabbedPane. Using setTabComponentAt(0, someComponent); doesn't change the exterior of the tab, which is a rectangle with a diagonal top-left corner. What may be done to change the shape?

like image 470
farm ostrich Avatar asked Aug 14 '11 01:08

farm ostrich


1 Answers

You can put html tags into the first parameter of addTab method as following :

MyJTabbedPane.addTab("<html><h1 style='padding:20px;'>TEST</h1></html>", new JPanel());

like image 159
Mike Lowry Avatar answered Sep 20 '22 14:09

Mike Lowry