@Override
	public void paint( Graphics g, JComponent c ) {
		g = FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c );

		AbstractButton b = (AbstractButton) c;

		// layout
		String clippedText = layout( b, b.getFontMetrics( b.getFont() ), b.getWidth(), b.getHeight() );

		// not used in FlatLaf, but invoked for compatibility with BasicButtonUI.paint()
		clearTextShiftOffset();

		// not used in FlatLaf, but invoked for compatibility with BasicButtonUI.paint()
		ButtonModel model = b.getModel();
		if( model.isArmed() && model.isPressed() )
			paintButtonPressed( g, b );

		// paint icon
		if( b.getIcon() != null )
			paintIcon( g, b, iconR );

		// paint text
		if( clippedText != null && !clippedText.isEmpty() ) {
			View view = (View) b.getClientProperty( BasicHTML.propertyKey );
			if( view != null ) {
				// update foreground color in HTML view, which is necessary
				// for selected and pressed states
				// (only for enabled buttons, because UIManager.getColor("textInactiveText")
				// is used for disabled components; see: javax.swing.text.GlyphView.paint())
				if( b.isEnabled() )
					FlatHTML.updateRendererCSSForeground( view, getForeground( b ) );

				view.paint( g, textR ); // HTML text
			} else
				paintText( g, b, textR, clippedText );
		}

		// not used in FlatLaf, but invoked for compatibility with BasicButtonUI.paint()
		if( b.isFocusPainted() && b.hasFocus() )
			paintFocus( g, b, viewR, textR, iconR );
	}
Similar to BasicButtonUI.paint(), but does not use zero insets for HTML text,
which is done in BasicButtonUI.layout() since Java 19.
See https://github.com/openjdk/jdk/pull/8407
and https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java