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.cfsecurity.v2_0.CFSecuritySwing.CFSecuritySwingTSecGroupMemberAttrJPanel.java

public CFSecuritySwingTSecGroupMemberAttrJPanel(ICFSecuritySwingSchema argSchema,
        ICFSecurityTSecGroupMemberObj argFocus) {
    super();//ww w  .  j  av 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;
    setSwingFocusAsTSecGroupMember(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 = getSwingLabelContainerGroup();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerGroup();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

    label = getSwingLabelTSecGroupMemberId();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorTSecGroupMemberId();
    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.cfsecurity.v2_1.CFSecuritySwing.CFSecuritySwingClusterAttrJPanel.java

public CFSecuritySwingClusterAttrJPanel(ICFSecuritySwingSchema argSchema, ICFSecurityClusterObj argFocus) {
    super();//w  w  w . j  av 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;
    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;

    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.cfsecurity.v2_1.CFSecuritySwing.CFSecuritySwingSecDeviceAttrJPanel.java

public CFSecuritySwingSecDeviceAttrJPanel(ICFSecuritySwingSchema argSchema, ICFSecuritySecDeviceObj argFocus) {
    super();/*from   w  w  w  .  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;
    setSwingFocusAsSecDevice(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 = getSwingLabelContainerSecUser();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerSecUser();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

    label = getSwingLabelPubKey();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorPubKey();
    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.cfsecurity.v2_1.CFSecuritySwing.CFSecuritySwingSecSessionAttrJPanel.java

public CFSecuritySwingSecSessionAttrJPanel(ICFSecuritySwingSchema argSchema,
        ICFSecuritySecSessionObj argFocus) {
    super();//from   ww w.j a  v  a2s  .  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;
    setSwingFocusAsSecSession(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 = getSwingLabelContainerSecUser();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceContainerSecUser();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

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

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

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

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

    label = getSwingLabelFinish();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    compo = getSwingEditorFinish();
    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.cfsecurity.v2_1.CFSecuritySwing.CFSecuritySwingSecUserAttrJPanel.java

public CFSecuritySwingSecUserAttrJPanel(ICFSecuritySwingSchema argSchema, ICFSecuritySecUserObj argFocus) {
    super();//from  ww  w  . ja v 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;
    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 = getSwingLabelLookupDefDev();
    add(label);
    label.setBounds(labelx, y, labelwidth, height);
    reference = getSwingReferenceLookupDefDev();
    add(reference);
    reference.setBounds(fieldx, y, fieldwidth, height);
    y = y + vspacing;

    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;

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

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

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

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

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