Search in sources :

Example 6 with ButtonGroup

use of com.codename1.ui.ButtonGroup in project CodenameOne by codenameone.

the class ComponentGroup method setHorizontal.

/**
 * Indicates that the component group should be horizontal by using the BoxLayout Y
 * @param horizontal the horizontal to set
 */
public void setHorizontal(boolean horizontal) {
    if (horizontal != isHorizontal()) {
        if (horizontal) {
            setLayout(new BoxLayout(BoxLayout.X_AXIS));
            if ("GroupElement".equals(elementUIID)) {
                elementUIID = "ToggleButton";
                buttonUIID = "ToggleButton";
                updateUIIDs();
            }
        } else {
            setLayout(new BoxLayout(BoxLayout.Y_AXIS));
            if ("ToggleButton".equals(elementUIID)) {
                elementUIID = "GroupElement";
                buttonUIID = "ButtonGroup";
                updateUIIDs();
            }
        }
    }
}
Also used : BoxLayout(com.codename1.ui.layouts.BoxLayout)

Aggregations

ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 ButtonGroup (com.codename1.ui.ButtonGroup)2 Component (com.codename1.ui.Component)2 Container (com.codename1.ui.Container)2 Dimension (java.awt.Dimension)2 FontFormatException (java.awt.FontFormatException)2 Point (java.awt.Point)2 EOFException (java.io.EOFException)2 SQLException (java.sql.SQLException)2 ParseException (java.text.ParseException)2 Hashtable (java.util.Hashtable)2 Preferences (java.util.prefs.Preferences)2 BufferedInputStream (com.codename1.io.BufferedInputStream)1 BufferedOutputStream (com.codename1.io.BufferedOutputStream)1 BrowserComponent (com.codename1.ui.BrowserComponent)1 CheckBox (com.codename1.ui.CheckBox)1 Form (com.codename1.ui.Form)1 Graphics (com.codename1.ui.Graphics)1 Image (com.codename1.ui.Image)1