提交 6b121ba2 编写于 作者: M malenkov

8043151: KSS: javax.swing.plaf.nimbus.AbstractRegionPainter#getComponentColor

Reviewed-by: alexsch, serb
上级 a8dc037a
......@@ -31,6 +31,7 @@ import javax.swing.*;
import javax.swing.plaf.UIResource;
import javax.swing.Painter;
import java.awt.print.PrinterGraphics;
import sun.reflect.misc.MethodUtil;
/**
* Convenient base class for defining Painter instances for rendering a
......@@ -445,8 +446,8 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
} else {
String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
try {
Method method = c.getClass().getMethod(s);
color = (Color) method.invoke(c);
Method method = MethodUtil.getMethod(c.getClass(), s, null);
color = (Color) MethodUtil.invoke(method, c, null);
} catch (Exception e) {
//don't do anything, it just didn't work, that's all.
//This could be a normal occurance if you use a property
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册