Insubstantial / insubstantial

Swing look-and-feel library and assorted widgets
193 stars 58 forks source link

JButton: Text is painted below icon #128

Open QStormDS opened 10 years ago

QStormDS commented 10 years ago

The text of a JButton is painted below the icon if Insubstantial LAF is set. However, the text is painted above the icon if Metal LAF is set for instance.

Example code: JButton button = new JButton(text,icon); button.setVerticalTextPosition(SwingConstants.CENTER); button.setHorizontalTextPosition(SwingConstants.CENTER);

QStormDS commented 10 years ago

I found the root cause: The text is painted before the icon in "org.pushingpixels.substance.internal.ui.SubstanceButtonUI" (line 338-347). The order is different to "javax.swing.plaf.basic.BasicButtonUI" where the text is painted after the icon.