Results 1 to 2 of 2
- 08-09-2010, 09:11 AM #1Member
- Join Date
- Jul 2010
- Wollongong, NSW, Australia
- Rep Power
adding background image to jtabbedpane
Hey, is it possible to add a background image to a jtabbedpane?
Ive been looking around and all i can find are examples of setting the color but thats not what im after.
I thought it would be something similar to the add COLOR background but this gives me a compiling error
JTabbedPane tabbedPane = new JTabbedPane(); ImageIcon icon = createImageIcon("http://www.java-forums.org/images/photo.gif"); tabbedPane.setBackground(icon); TESTING panel1 = new TESTING(); tabbedPane.addTab("Fisrt tab", panel1);
Just thought i might add Im after a rounded corners look to the tabs themselves, with a custom gradient as their background colour, not just the plain default one colour thats there already, if there is a way I can do this without having to make the image with photoshop then add it like ive been doing, please tell me the key words i should be seraching for :)
Last edited by Gloomy; 08-09-2010 at 09:13 AM.
Since a JTabbedPane inherits from JComponent, why not just override its paintComponent method as we do for a JPanel and draw in there. If you do this, then you'll need to make sure that the components added have their opaque properties set to false.
- By Stephen Douglas in forum New To JavaReplies: 1Last Post: 04-12-2010, 05:54 PM
- By javanewbie in forum New To JavaReplies: 1Last Post: 05-27-2009, 12:02 PM
- By JDCAce in forum AWT / SwingReplies: 5Last Post: 10-18-2008, 09:45 AM
- By bigpappatrader in forum AWT / SwingReplies: 0Last Post: 12-05-2007, 07:09 AM
- By blackstone in forum AWT / SwingReplies: 2Last Post: 11-14-2007, 03:15 PM