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