Results 1 to 1 of 1
- 02-28-2011, 06:58 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 3
- Rep Power
- 0
Bold font in JTabbedpane in Nimbus L&F
Hello All,
I am new to work with L&F in java. I am using Nimbus L&F for my application.
My requirement is i want to bold some of the tab title based on come constraints.
So i tried to create my own paneUI extending from BasicTabbedPaneUI.
Here is my code:
ts working fine. The problem is its not at all coming with the Nimbus L&F. I can guess bcz of i am setting my UI as my customized one ( setUI(new customTabbedPaneUI ()))Java Code:private class customTabbedPaneUI extends BasicTabbedPaneUI{ private Font boldFont = null; protected void installDefaults() { super.installDefaults(); boldFont = tabPane.getFont().deriveFont(Font.BOLD); } protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected){ if (My condition){ super.paintText(g, tabPlacement, boldFont, metrics, tabIndex, title, textRect, isSelected); }else{ super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected); } }
Can you pleas any one help me. I want to change only the font to Bold without changing my nimbus L&F.
Please help me guys.
-Arun S
Similar Threads
-
How to work Nimbus Look & feel in java
By justbeller in forum AWT / SwingReplies: 5Last Post: 01-18-2011, 01:08 PM -
How to work Nimbus Look & feel in java
By justbeller in forum Java 2DReplies: 1Last Post: 01-18-2011, 06:59 AM -
Set Font Color, Font Style & Font Family While Replacing Text
By sherazam in forum Java SoftwareReplies: 0Last Post: 08-18-2010, 10:31 AM -
How to change font/ font color etc in a graphic object using JCombobox?
By JavaInLove in forum AWT / SwingReplies: 5Last Post: 04-25-2009, 08:00 PM -
TODO in bold font in Text Editor
By SSG_JJV in forum EclipseReplies: 1Last Post: 03-25-2009, 10:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks