🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10917

Re: inverting string on JTabbedPane

#10917
From: Tad Frysinger TeamB Tad Frysinge...
Date: Mon, 26 Jul 1999 00:00
60 lines
2269 bytes
In article <37989ACE.CEE4B975@inprise.com>, rwilkman@inprise.com says...
> Jonathan:
> 
> I think you need Java 2D (read this, JDK 1.2) to do rotated text.
> 
> -Rich
> 
> Jonathan wrote:
> > 
> > I have set the JTabbedPane so the tabs are to the left of the tab pane,
> > 
> > the only problem is , I want the word to display on its size, instead of
> > left to right,
> > 
> > any Ideas how to do this?
> 
> 
Not only that, but changing the tab involves changing the look and feel!  
It really should be implemented as a custom renderer (a la JBCL), but it 
isn't.  So what you can do is create a custom UI Delegate (I showed this 
at BorCon, and is the best way for smallish changes so you don't screw up 
if the user changes from Windows to Java, for instance), but of course, 
this only is acceptable if the changes you make to the UI delegate are 
fundamental enough to make sense across L&F's:

      myJTabbedPane1.setUI( new RDTabbedPaneUI() );

package com.reddragon.toolbox;
import java.awt.*;

import javax.swing.plaf.basic.*;
public class RDTabbedPaneUI extends BasicTabbedPaneUI
{

   public RDTabbedPaneUI()
   {
   }
   protected void paintText(Graphics g, int tabPlacement,
                            Font font, FontMetrics metrics, int tabIndex,
                            String title, Rectangle textRect,
                            boolean isSelected)
   {
      // DO ALL YOUR FUNNY BUSINESS HERE....	

      // THEN. IF NECESSARY...
      super.paintText( g,
                       tabPlacement,
                       font,
                       metrics,
                       tabIndex,
                       title,
                       textRect,
                       isSelected);

   }
}



Tad Frysinger (TeamB)
Technical Details
Message-ID: <MPG.120682cbcfd3630e989682@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7n9ad2$o885@forums.borland.com> <37989ACE.CEE4B975@inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,22f1bff8f6b37df3
X-Google-Attributes: gid111d45,public
From: Tad Frysinger (TeamB) (Tad Frysinger)
Subject: Re: inverting string on JTabbedPane
Date: 1999/07/26
Message-ID: <MPG.120682cbcfd3630e989682@forums.borland.com>
X-Deja-AN: 505530369
References: <7n9ad2$o885@forums.borland.com> <37989ACE.CEE4B975@inprise.com>
Organization: RTOne
Newsgroups: borland.public.jbuilder.java.swing