org.jdesktop.swingx.JXHeader Java Examples

The following examples show how to use org.jdesktop.swingx.JXHeader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FlatHeaderUI.java    From FlatLaf with Apache License 2.0 5 votes vote down vote up
@Override
protected void onPropertyChange( JXHeader h, String propertyName, Object oldValue, Object newValue ) {
	super.onPropertyChange( h, propertyName, oldValue, newValue );

	if( "iconPosition".equals( propertyName ) )
		scaleLayout( h );
}
 
Example #2
Source File: FlatHeaderUI.java    From FlatLaf with Apache License 2.0 5 votes vote down vote up
private void scaleLayout( JXHeader header ) {
	if( UIScale.getUserScaleFactor() == 1f )
		return;

	LayoutManager layout = header.getLayout();
	if( !(layout instanceof GridBagLayout) )
		return;

	GridBagLayout gbl = (GridBagLayout) layout;
	for( Component c : header.getComponents() ) {
		GridBagConstraints cons = gbl.getConstraints( c );
		cons.insets = UIScale.scale( cons.insets );
		gbl.setConstraints( c, cons );
	}
}
 
Example #3
Source File: FlatHeaderUI.java    From FlatLaf with Apache License 2.0 4 votes vote down vote up
@Override
protected void installComponents( JXHeader header ) {
	super.installComponents( header );

	scaleLayout( header );
}