Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding icon on JTabbedpane tab

Tags:

java

swing

jframe

I am having a JTabbedPane on my Form. The problem is I want to display icons to the Tabs of my TabbedPane.

How can i do that?

like image 702
hemant Avatar asked Jul 06 '12 11:07

hemant


2 Answers

Use the setIconAt method of the JTabbedPane:

http://docs.oracle.com/javase/7/docs/api/javax/swing/JTabbedPane.html#setIconAt(int, javax.swing.Icon)

like image 109
Guillaume Polet Avatar answered Sep 26 '22 01:09

Guillaume Polet


Please read the java tutorials first, they are really informative: http://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html

like image 21
moeTi Avatar answered Sep 26 '22 01:09

moeTi