8043151: KSS: javax.swing.plaf.nimbus.AbstractRegionPainter#getComponentColor
Reviewed-by: alexsch, serb
This commit is contained in:
parent
17a7184b51
commit
83d661a615
@ -31,6 +31,7 @@ import javax.swing.*;
|
|||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.Painter;
|
import javax.swing.Painter;
|
||||||
import java.awt.print.PrinterGraphics;
|
import java.awt.print.PrinterGraphics;
|
||||||
|
import sun.reflect.misc.MethodUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenient base class for defining Painter instances for rendering a
|
* Convenient base class for defining Painter instances for rendering a
|
||||||
@ -445,8 +446,8 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
|
|||||||
} else {
|
} else {
|
||||||
String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
|
String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
|
||||||
try {
|
try {
|
||||||
Method method = c.getClass().getMethod(s);
|
Method method = MethodUtil.getMethod(c.getClass(), s, null);
|
||||||
color = (Color) method.invoke(c);
|
color = (Color) MethodUtil.invoke(method, c, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//don't do anything, it just didn't work, that's all.
|
//don't do anything, it just didn't work, that's all.
|
||||||
//This could be a normal occurance if you use a property
|
//This could be a normal occurance if you use a property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user