Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6599172

Public access methods to groups for javax.swing.GroupLayout.

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      Currently the access methods to horizontal and vertical groups are private. They should be make public. When this layout manger was part of swing labs they were public.


      JUSTIFICATION :
      When constructing windows it would be useful to have public access to the groups directly from the layout manager as was when this was in swing labs.

      This way I can use creational utilities (reusable code) to help build pages faster (coding effort not runtime)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Please make these methods made public.
      ACTUAL -
      The methods are currently private.

      ---------- BEGIN SOURCE ----------
      See below for work around.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Currently I use a custom reflection utility to gain access to the methods and invoke them.

      example:

      public static GroupLayout.Group getGroup(String type, GroupLayout layoutManager)
      throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
      {
      Method method = layoutManager.getClass().getDeclaredMethod("get" + type + "Group") ;
      method.setAccessible(true) ;
      return (GroupLayout.Group) method.invoke(layoutManager) ;
      }
      }

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: