Example usage for javax.swing JLabel setBounds

List of usage examples for javax.swing JLabel setBounds

Introduction

In this page you can find the example usage for javax.swing JLabel setBounds.

Prototype

public void setBounds(int x, int y, int width, int height) 

Source Link

Document

Moves and resizes this component.

Usage

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingTSecGroupIncludeAttrJPanel.java

public void doLayout() {
    JLabel label;
    JComponent compo;// w ww.  ja v a2s  . c o m
    CFJReferenceEditor reference;
    Dimension dim;
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 1024;
    Dimension jpsz = getSize();
    int usefieldwidth = jpsz.width - 215;

    label = getSwingLabelOwnerTenant();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelContainerGroup();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelParentSubGroup();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceParentSubGroup();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelTSecGroupIncludeId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorTSecGroupIncludeId();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_2.CFAstSwing.CFAstSwingSecUserAttrJPanel.java

public void doLayout() {
    JLabel label;
    JComponent compo;/*w ww.  j  a va  2s . co m*/
    CFJReferenceEditor reference;
    Dimension dim;
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 1024;
    Dimension jpsz = getSize();
    int usefieldwidth = jpsz.width - 215;

    label = getSwingLabelLookupDefDev();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceLookupDefDev();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelSecUserId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecUserId();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelLoginId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorLoginId();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelEMailAddress();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorEMailAddress();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelEMailConfirmationUuid();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorEMailConfirmationUuid();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelPasswordHash();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorPasswordHash();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelPasswordResetUuid();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorPasswordResetUuid();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstSwing.CFAstSwingSecSessionAttrJPanel.java

public void doLayout() {
    JLabel label;
    JComponent compo;//w  ww  . ja  v a 2 s.  co m
    CFJReferenceEditor reference;
    Dimension dim;
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 1024;
    Dimension jpsz = getSize();
    int usefieldwidth = jpsz.width - 215;

    label = getSwingLabelContainerSecUser();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerSecUser();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelParentSecProxy();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceParentSecProxy();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelSecSessionId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecSessionId();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelSecDevName();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecDevName();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelStart();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorStart();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

    label = getSwingLabelFinish();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFinish();
    dim = compo.getMaximumSize();
    if (dim.width < usefieldwidth) {
        compo.setBounds(fieldx, y, dim.width, height);
    } else {
        compo.setBounds(fieldx, y, fieldwidth, height);
    }
    y = y + vspacing;

}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingSecUserAttrJPanel.java

public CFInternetSwingSecUserAttrJPanel(ICFInternetSwingSchema argSchema, ICFInternetSecUserObj argFocus) {
    super();/*  w w  w .ja  v  a  2  s.co m*/
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsSecUser(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelSecUserId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecUserId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelEMailAddress();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorEMailAddress();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmSwing.CFCrmSwingServiceTypeAttrJPanel.java

public CFCrmSwingServiceTypeAttrJPanel(ICFCrmSwingSchema argSchema, ICFCrmServiceTypeObj argFocus) {
    super();//from   ww  w.j a  va2s  .  com
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsServiceType(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelServiceTypeId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorServiceTypeId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelDescription();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDescription();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSwing.CFAccSwingClusterAttrJPanel.java

public CFAccSwingClusterAttrJPanel(ICFAccSwingSchema argSchema, ICFAccClusterObj argFocus) {
    super();/*from   w  w w  . j  a v  a  2 s.c o m*/
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsCluster(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelFullDomainName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFullDomainName();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingClusterAttrJPanel.java

public CFAstSwingClusterAttrJPanel(ICFAstSwingSchema argSchema, ICFAstClusterObj argFocus) {
    super();// www  .j a  v  a 2s .c om
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsCluster(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelFullDomainName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFullDomainName();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingAuditActionAttrJPanel.java

public CFAsteriskSwingAuditActionAttrJPanel(ICFAsteriskSwingSchema argSchema,
        ICFSecurityAuditActionObj argFocus) {
    super();//from  www . jav a2s .  co m
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsAuditAction(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelAuditActionId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorAuditActionId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelDescription();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDescription();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingServiceTypeAttrJPanel.java

public CFAsteriskSwingServiceTypeAttrJPanel(ICFAsteriskSwingSchema argSchema,
        ICFSecurityServiceTypeObj argFocus) {
    super();//from  ww  w. j  a  v a  2 s .co  m
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsServiceType(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelServiceTypeId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorServiceTypeId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelDescription();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDescription();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_4.CFFreeSwitchSwing.CFFreeSwitchSwingAuditActionAttrJPanel.java

public CFFreeSwitchSwingAuditActionAttrJPanel(ICFFreeSwitchSwingSchema argSchema,
        ICFSecurityAuditActionObj argFocus) {
    super();//from ww w.  ja  va 2  s.c o  m
    JLabel label;
    JComponent compo;
    CFJReferenceEditor reference;
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    setSwingFocusAsAuditAction(argFocus);
    final int spacing = 5;
    int y = spacing;
    final int height = 25;
    final int textheight = 80;
    final int vspacing = height + spacing;
    final int textvspacing = textheight + spacing;
    final int labelx = spacing;
    final int labelwidth = 200;
    final int fieldx = labelx + labelwidth + spacing;
    final int fieldwidth = 785;
    final int panelwidth = fieldx + fieldwidth + spacing;
    // temporary -- I think you have to have a panel bigger than the coordinates initially
    setSize(panelwidth, 100000);

    label = getSwingLabelAuditActionId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorAuditActionId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelDescription();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDescription();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    // Now we can set the proper size based on the fields and references populated
    setSize(panelwidth, y);
    Dimension pfsz = new Dimension(panelwidth, y);
    setPreferredSize(pfsz);
    Dimension min = new Dimension(400, y);
    setMinimumSize(min);
    populateFields();
    adjustComponentEnableStates();
    swingIsInitializing = false;
}