Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) {
- //We do nothing here to disable painting the Tab Border
- }
- @Override
- protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) {
- g.setFont(font);
- View v = getTextViewForTab(tabIndex);
- if (v != null) {
- // html
- v.paint(g, textRect);
- } else {
- // plain text
- int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
- if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) {
- //Change the text to White here <- Causing Border Issues
- g.setColor(Color.WHITE);
- SwingUtilities2.drawStringUnderlineCharAt(tabPane, g,
- title, mnemIndex,
- textRect.x, textRect.y + metrics.getAscent());
- } else { // tab disabled
- g.setColor(tabPane.getBackgroundAt(tabIndex).brighter());
- SwingUtilities2.drawStringUnderlineCharAt(tabPane, g,
- title, mnemIndex,
- textRect.x, textRect.y + metrics.getAscent());
- g.setColor(tabPane.getBackgroundAt(tabIndex).darker());
- SwingUtilities2.drawStringUnderlineCharAt(tabPane, g,
- title, mnemIndex,
- textRect.x - 1, textRect.y + metrics.getAscent() - 1);
- }
- }
- }
Add Comment
Please, Sign In to add comment