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.cffreeswitch.v2_4.CFFreeSwitchSwing.CFFreeSwitchSwingServiceTypeAttrJPanel.java

public CFFreeSwitchSwingServiceTypeAttrJPanel(ICFFreeSwitchSwingSchema argSchema,
        ICFSecurityServiceTypeObj argFocus) {
    super();/*from   w ww.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;
    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.cfgcash.v2_0.CFGCashSwing.CFGCashSwingClusterAttrJPanel.java

public CFGCashSwingClusterAttrJPanel(ICFGCashSwingSchema argSchema, ICFGCashClusterObj argFocus) {
    super();/*  w  ww. j  a va 2s.  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.cfinternet.v2_0.CFInternetSwing.CFInternetSwingServiceTypeAttrJPanel.java

public CFInternetSwingServiceTypeAttrJPanel(ICFInternetSwingSchema argSchema,
        ICFInternetServiceTypeObj argFocus) {
    super();/*from w ww . j  a  v  a2 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;
    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.CFAccSwingSecUserAttrJPanel.java

public CFAccSwingSecUserAttrJPanel(ICFAccSwingSchema argSchema, ICFAccSecUserObj argFocus) {
    super();/* w  w  w  . ja v a 2 s .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;
    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.cfasterisk.v2_0.CFAstSwing.CFAstSwingSecUserAttrJPanel.java

public CFAstSwingSecUserAttrJPanel(ICFAstSwingSchema argSchema, ICFAstSecUserObj argFocus) {
    super();/*  www.  j av  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;
    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.cfacc.v2_0.CFAccSwing.CFAccSwingServiceAttrJPanel.java

public void doLayout() {
    JLabel label;
    JComponent compo;//from w w  w  .  ja  v  a2 s .  c  om
    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 = getSwingLabelOwnerCluster();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerCluster();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelServiceId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorServiceId();
    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 = getSwingLabelHostPort();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorHostPort();
    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.cffreeswitch.v2_1.CFFswSwing.CFFswSwingServiceTypeAttrJPanel.java

public CFFswSwingServiceTypeAttrJPanel(ICFFswSwingSchema argSchema, ICFFswServiceTypeObj argFocus) {
    super();//from   w  w  w. j a v  a2  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.cfacc.v2_0.CFAccSwing.CFAccSwingAuditActionAttrJPanel.java

public CFAccSwingAuditActionAttrJPanel(ICFAccSwingSchema argSchema, ICFAccAuditActionObj argFocus) {
    super();//  w w w .  j a  v  a2  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;
}

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

public CFAccSwingServiceTypeAttrJPanel(ICFAccSwingSchema argSchema, ICFAccServiceTypeObj argFocus) {
    super();/*from  w ww .  j a va 2 s .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;
    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.cfasterisk.v2_0.CFAstSwing.CFAstSwingAuditActionAttrJPanel.java

public CFAstSwingAuditActionAttrJPanel(ICFAstSwingSchema argSchema, ICFAstAuditActionObj argFocus) {
    super();//from w  w w  . j a  va 2  s.  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;
    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;
}