Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of LayoutStyle.INDENT in GroupLayout



Hi

thanks that is the conclusion I came to, if that is the case is the Javadoc wrong then. This is the javadoc for Grouplayout.SequentialGroup.addPreferredGap(), it doesnt restrict the 'type'

*addPreferredGap*(int type)

   Adds an element representing the preferred gap between the nearest
   components. That is, during layout the neighboring components are
   found, and the min, pref and max of this element is set based on the
   preferred gap between the components. If no neighboring components
   are found the min, pref and max are set to 0.

*Parameters:*
|type| - the type of gap; one of the LayoutStyle constants *Returns:*
this SequentialGroup



email@hidden wrote:
Hi Paul,

GroupLayout has no direct support for indentation. You have to retrieve the indentation gap from LayoutStyle, and set it as a fixed size gap to GroupLayout.

Here is a code snippet showing how to indent a label underneath a radio button:

.add(LayoutStyle.getSharedInstance().getPreferredGap(radioButton, label, LayoutStyle.INDENT, SwingConstants.EAST, this))

Hope this helps,
Werner



On 05.07.2007, at 17:00, Paul Taylor wrote:
Im wondering if the javadoc is wrong and if INDENT is just used by LayoutStyle.getPreferredGap() to provide the value for the indent, which you then have to incorporate into your layout manually...





_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Use of LayoutStyle.INDENT in GroupLayout (From: "email@hidden" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.