public void addZone ( String id , Component zone , String constraints ) { // is there already a zone with this id? Component previousZone = getZone ( id ) ; if ( previousZone != null ) { remove ( previousZone ) ; idToZones . remove ( id ) ; } if ( zone instanceof JComponent ) { JComponent jc = ( JComponent ) zone ; if ( jc . getBorder ( ) == null || jc . getBorder ( ) instanceof UIResource ) { if ( jc instanceof JLabel ) { jc . setBorder ( new CompoundBorder ( zoneBorder , new EmptyBorder ( 0 , 2 , 0 , 2 ) ) ) ; ( ( JLabel ) jc ) . setText ( " " ) ; } else { jc . setBorder ( zoneBorder ) ; } } } add ( zone , constraints ) ; idToZones . put ( id , zone ) ; }
Adds a new zone in the StatusBar .