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.CFAccSwingISOTimezoneAttrJPanel.java

public CFAccSwingISOTimezoneAttrJPanel(ICFAccSwingSchema argSchema, ICFAccISOTimezoneObj argFocus) {
    super();//w w  w .  j  a 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;
    setSwingFocusAsISOTimezone(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 = getSwingLabelISOTimezoneId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorISOTimezoneId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

    label = getSwingLabelTZMinOffset();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorTZMinOffset();
    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;

    label = getSwingLabelVisible();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorVisible();
    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.CFAstSwingConfigurationFileAttrJPanel.java

public CFAstSwingConfigurationFileAttrJPanel(ICFAstSwingSchema argSchema, ICFAstConfigurationFileObj argFocus) {
    super();/*from w  w  w . ja va2 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;
    setSwingFocusAsConfigurationFile(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 = getSwingLabelOwnerCluster();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerCluster();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelContainerHostNode();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerHostNode();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

    label = getSwingLabelFileFullName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFileFullName();
    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.CFAstSwingISOTimezoneAttrJPanel.java

public CFAstSwingISOTimezoneAttrJPanel(ICFAstSwingSchema argSchema, ICFAstISOTimezoneObj argFocus) {
    super();// ww w .j  a  va2 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;
    setSwingFocusAsISOTimezone(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 = getSwingLabelISOTimezoneId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorISOTimezoneId();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

    label = getSwingLabelTZMinOffset();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorTZMinOffset();
    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;

    label = getSwingLabelVisible();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorVisible();
    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.CFAccSwingAddressAttrJPanel.java

public void doLayout() {
    JLabel label;
    JComponent compo;//from  www  .  jav  a 2s . 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 = getSwingLabelOwnerTenant();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelAddressId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorAddressId();
    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 = getSwingLabelDescription();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDescription();
    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 = getSwingLabelAddrLine1();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorAddrLine1();
    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 = getSwingLabelAddrLine2();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorAddrLine2();
    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 = getSwingLabelCity();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorCity();
    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 = getSwingLabelState();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorState();
    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 = getSwingLabelZip();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorZip();
    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.cfacc.v2_0.CFAccSwing.CFAccSwingContactAttrJPanel.java

public void doLayout() {
    JLabel label;
    JComponent compo;//  w w  w .  ja v  a2s  .  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 = getSwingLabelOwnerTenant();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelContactId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorContactId();
    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 = getSwingLabelFullName();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFullName();
    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 = getSwingLabelLastName();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorLastName();
    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 = getSwingLabelFirstName();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFirstName();
    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 = getSwingLabelCustom();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorCustom();
    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 = getSwingLabelCustom2();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorCustom2();
    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 = getSwingLabelCustom3();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorCustom3();
    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.CFFswSwingFSSofiaAttrJPanel.java

public CFFswSwingFSSofiaAttrJPanel(ICFFswSwingSchema argSchema, ICFFswFSSofiaObj argFocus) {
    super();//from   w w w  .  j  ava 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;
    setSwingFocusAsFSSofia(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 = getSwingLabelContainerTenant();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerTenant();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

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

    label = getSwingLabelDebugPresence();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDebugPresence();
    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.CFCrmSwingMinorVersionAttrJPanel.java

public CFCrmSwingMinorVersionAttrJPanel(ICFCrmSwingSchema argSchema, ICFCrmMinorVersionObj argFocus) {
    super();/* w w  w. j  a  va2  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;
    setSwingFocusAsMinorVersion(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 = getSwingLabelOwnerTenant();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelContainerMajorVersion();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerMajorVersion();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorId();
    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;

    label = getSwingLabelName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorName();
    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.CFInternetSwingTopDomainAttrJPanel.java

public CFInternetSwingTopDomainAttrJPanel(ICFInternetSwingSchema argSchema, ICFInternetTopDomainObj argFocus) {
    super();/*from   w  w  w . j  a va 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;
    setSwingFocusAsTopDomain(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 = getSwingLabelOwnerTenant();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelContainerTLD();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerTLD();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorId();
    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;

    label = getSwingLabelName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorName();
    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.CFAsteriskSwingSubProjectAttrJPanel.java

public CFAsteriskSwingSubProjectAttrJPanel(ICFAsteriskSwingSchema argSchema,
        ICFInternetSubProjectObj argFocus) {
    super();//from  www.ja  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;
    setSwingFocusAsSubProject(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 = getSwingLabelOwnerTenant();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelContainerParentProject();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerParentProject();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorId();
    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;

    label = getSwingLabelName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorName();
    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.CFAsteriskSwingMinorVersionAttrJPanel.java

public CFAsteriskSwingMinorVersionAttrJPanel(ICFAsteriskSwingSchema argSchema,
        ICFInternetMinorVersionObj argFocus) {
    super();/* w  ww .  ja  v a  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;
    setSwingFocusAsMinorVersion(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 = getSwingLabelOwnerTenant();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceOwnerTenant();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelContainerMajorVersion();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerMajorVersion();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorId();
    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;

    label = getSwingLabelName();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorName();
    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;
}