jdk/src/solaris/classes/sun/awt/X11/XCheckboxMenuItemPeer.java
changeset 13604 31089af1a447
parent 5506 202f599c92aa
child 23010 6dadb192ad81
--- a/jdk/src/solaris/classes/sun/awt/X11/XCheckboxMenuItemPeer.java	Tue Jul 31 21:01:56 2012 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCheckboxMenuItemPeer.java	Thu Aug 30 13:11:23 2012 -0700
@@ -29,27 +29,12 @@
 import java.awt.peer.*;
 import java.awt.event.*;
 
-import java.lang.reflect.Field;
-import sun.awt.SunToolkit;
+import sun.awt.AWTAccessor;
 
 class XCheckboxMenuItemPeer extends XMenuItemPeer implements CheckboxMenuItemPeer {
 
     /************************************************
      *
-     * Data members
-     *
-     ************************************************/
-
-    /*
-     * CheckboxMenuItem's fields
-     */
-    private final static Field f_state;
-    static {
-        f_state = SunToolkit.getField(CheckboxMenuItem.class, "state");
-    }
-
-    /************************************************
-     *
      * Construction
      *
      ************************************************/
@@ -74,16 +59,8 @@
      *
      ************************************************/
     boolean getTargetState() {
-        MenuItem target = getTarget();
-        if (target == null) {
-            return false;
-        }
-        try {
-            return f_state.getBoolean(target);
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        }
-        return false;
+        return AWTAccessor.getCheckboxMenuItemAccessor()
+                   .getState((CheckboxMenuItem)getTarget());
     }
 
     /************************************************