Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / August 2003

Tip: Looking for answers? Try searching our database.

TitledBorder.setTitle() problem

Thread view: 
EnKan - 23 Aug 2003 12:21 GMT
Hi All,

I'm trying to modify the title of a TitledBorder at "run time".
But, what I find is that the title doesn't change unless
I iconify my app., or cover/uncover my app. window with any other
window - some kind of a refresh/repaint problem.

The snippet is something as below:

      // design time
       JPanel p = new JPanel();
       p.setLayout( new BorderLayout() );
       Border etchedBorder = BorderFactory.createEtchedBorder();
       TitledBorder title =
            BorderFactory.createTitledBorder( etchedBorder, "OLD NAME" );
       title.setTitleJustification( TitledBorder.CENTER );
       p.setBorder( title );

       // run time
       ((TitledBorder)(p.getBorder())).setTitle( "NEW NAME" );

The title doesn't get repainted to NEW NAME instantly.

Am I doing anything wrong ?

TIA
Sandip Chitale - 23 Aug 2003 22:34 GMT
Call

p.repaint();

HTH,
sandip

> Hi All,
>
[quoted text clipped - 22 lines]
>
> TIA


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.