Example usage for javax.swing JComponent setBounds

List of usage examples for javax.swing JComponent setBounds

Introduction

In this page you can find the example usage for javax.swing JComponent 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.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingSecGroupFormAttrJPanel.java

public CFAsteriskSwingSecGroupFormAttrJPanel(ICFAsteriskSwingSchema argSchema,
        ICFSecuritySecGroupFormObj 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;
    setSwingFocusAsSecGroupForm(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 = getSwingLabelContainerGroup();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelSecGroupFormId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecGroupFormId();
    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.CFAccSwingSecGroupFormAttrJPanel.java

public CFAccSwingSecGroupFormAttrJPanel(ICFAccSwingSchema argSchema, ICFAccSecGroupFormObj argFocus) {
    super();/*w ww.  j ava 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;
    setSwingFocusAsSecGroupForm(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 = getSwingLabelContainerGroup();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelSecGroupFormId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecGroupFormId();
    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.CFAstSwingSecGroupFormAttrJPanel.java

public CFAstSwingSecGroupFormAttrJPanel(ICFAstSwingSchema argSchema, ICFAstSecGroupFormObj argFocus) {
    super();//from   w  w  w.j ava 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;
    setSwingFocusAsSecGroupForm(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 = getSwingLabelContainerGroup();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelSecGroupFormId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecGroupFormId();
    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.CFGCashSwingSecGroupFormAttrJPanel.java

public CFGCashSwingSecGroupFormAttrJPanel(ICFGCashSwingSchema argSchema, ICFGCashSecGroupFormObj 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;
    setSwingFocusAsSecGroupForm(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 = getSwingLabelContainerGroup();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelSecGroupFormId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecGroupFormId();
    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.cfensyntax.v2_1.CFEnSyntaxSwing.CFEnSyntaxSwingSecGroupFormAttrJPanel.java

public CFEnSyntaxSwingSecGroupFormAttrJPanel(ICFEnSyntaxSwingSchema argSchema,
        ICFEnSyntaxSecGroupFormObj 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;
    setSwingFocusAsSecGroupForm(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 = getSwingLabelContainerGroup();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelSecGroupFormId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorSecGroupFormId();
    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.CFAccSwingContactAttrJPanel.java

public CFAccSwingContactAttrJPanel(ICFAccSwingSchema argSchema, ICFAccContactObj argFocus) {
    super();//from   ww w.  j  av  a  2s .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;
    setSwingFocusAsContact(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 = getSwingLabelContainerContactList();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerContactList();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

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

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

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

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

    label = getSwingLabelCustom3();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorCustom3();
    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.CFAccSwingAccountEntryAttrJPanel.java

public void doLayout() {
    JLabel label;/*from  ww  w.j a v a 2 s . c  o  m*/
    JComponent compo;
    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 = getSwingLabelContainerAccount();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerAccount();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

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

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

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

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

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

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

    label = getSwingLabelEntryId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorEntryId();
    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 = getSwingLabelEntryStamp();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorEntryStamp();
    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 = getSwingLabelDebit();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDebit();
    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 = getSwingLabelCredit();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorCredit();
    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 = getSwingLabelConvertedAmount();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorConvertedAmount();
    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 = getSwingLabelBalance();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorBalance();
    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.CFAccSwingAccountEntryAttrJPanel.java

public CFAccSwingAccountEntryAttrJPanel(ICFAccSwingSchema argSchema, ICFAccAccountEntryObj argFocus) {
    super();//from ww w  . j  a 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;
    setSwingFocusAsAccountEntry(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 = getSwingLabelContainerAccount();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerAccount();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

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

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

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

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

    label = getSwingLabelEntryStamp();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorEntryStamp();
    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 = getSwingLabelDebit();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDebit();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

    label = getSwingLabelBalance();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorBalance();
    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.CFFreeSwitchSwingPbxIvrMenuAttrJPanel.java

public void doLayout() {
    JLabel label;/*from ww w. jav  a2  s  .  c  o m*/
    JComponent compo;
    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 = getSwingLabelContainerTenant();
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerTenant();
    reference.setBounds(fieldx, y, usefieldwidth, height);
    y = y + vspacing;

    label = getSwingLabelMenuId();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorMenuId();
    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 = getSwingLabelName();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorName();
    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 = getSwingLabelGreetLong();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorGreetLong();
    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 = getSwingLabelGreetShort();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorGreetShort();
    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 = getSwingLabelInvalidSound();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorInvalidSound();
    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 = getSwingLabelExitSound();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorExitSound();
    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 = getSwingLabelTimeout();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorTimeout();
    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 = getSwingLabelInterDigitTimeout();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorInterDigitTimeout();
    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 = getSwingLabelMaxFailures();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorMaxFailures();
    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 = getSwingLabelMaxTimeouts();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorMaxTimeouts();
    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 = getSwingLabelDigitLen();
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorDigitLen();
    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_4.CFFreeSwitchSwing.CFFreeSwitchSwingPbxIvrMenuAttrJPanel.java

public CFFreeSwitchSwingPbxIvrMenuAttrJPanel(ICFFreeSwitchSwingSchema argSchema,
        ICFFreeSwitchPbxIvrMenuObj argFocus) {
    super();//from  w  ww. j a 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;
    setSwingFocusAsPbxIvrMenu(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 = getSwingLabelMenuId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorMenuId();
    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 = getSwingLabelGreetLong();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorGreetLong();
    add(compo);
    compo.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

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

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

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

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

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