mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
TextArea: fixed background if explicit color is set
This commit is contained in:
@@ -21,6 +21,7 @@ import java.awt.Graphics;
|
|||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.plaf.basic.BasicTextAreaUI;
|
import javax.swing.plaf.basic.BasicTextAreaUI;
|
||||||
import javax.swing.text.JTextComponent;
|
import javax.swing.text.JTextComponent;
|
||||||
|
|
||||||
@@ -56,9 +57,12 @@ public class FlatTextAreaUI
|
|||||||
protected void paintBackground( Graphics g ) {
|
protected void paintBackground( Graphics g ) {
|
||||||
JTextComponent c = getComponent();
|
JTextComponent c = getComponent();
|
||||||
|
|
||||||
g.setColor( !c.isEnabled()
|
Color background = c.getBackground();
|
||||||
? disabledBackground
|
g.setColor( !(background instanceof UIResource)
|
||||||
: (!c.isEditable() ? inactiveBackground : c.getBackground()) );
|
? background
|
||||||
|
: (!c.isEnabled()
|
||||||
|
? disabledBackground
|
||||||
|
: (!c.isEditable() ? inactiveBackground : background)) );
|
||||||
g.fillRect( 0, 0, c.getWidth(), c.getHeight() );
|
g.fillRect( 0, 0, c.getWidth(), c.getHeight() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user