public int doLayoutRetHeight() { Dimension sz = getSize(); final int itemHeight = 25; final int itemSpacing = 5; final int labelWidth = 150; final int buttonHeight = 35; final int buttonWidth = 100; int y = itemSpacing; int fieldWidth = sz.width - (itemSpacing + labelWidth + itemSpacing + itemSpacing); int fieldX = itemSpacing + labelWidth + itemSpacing; int buttonSpacing = (sz.width - (buttonWidth + buttonWidth)) / 4; labelFileName.setBounds(itemSpacing, y, labelWidth, itemHeight); textFileName.setBounds(fieldX, y, fieldWidth, itemHeight); y = y + itemHeight + itemSpacing; labelLogContents.setBounds(itemSpacing, y, labelWidth, itemHeight); int logContentsHeight = sz.height - (y + buttonHeight + itemSpacing + itemSpacing); if (logContentsHeight < 100) { logContentsHeight = 100; } textLogContents.setBounds(fieldX, y, fieldWidth, logContentsHeight); y = y + logContentsHeight + itemSpacing + itemSpacing; buttonChooseFile.setBounds(buttonSpacing, y, buttonWidth, buttonHeight); buttonImportFile.setBounds( buttonSpacing + buttonWidth + buttonSpacing, y, buttonWidth, buttonHeight); buttonClose.setBounds( buttonSpacing + buttonWidth + buttonSpacing + buttonWidth + buttonSpacing, y, buttonWidth, buttonHeight); y = y + buttonHeight + itemSpacing + itemSpacing; return (y); }
public CFSecuritySwingSecGroupFormAskDeleteJPanel( ICFSecuritySwingSchema argSchema, ICFSecuritySecGroupFormObj argFocus) { super(); 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; swingFocus = argFocus; // Construct the various objects textAreaMessage = new JTextArea("Are you sure you want to delete this Security Group Form?"); actionOk = new ActionOk(); actionCancel = new ActionCancel(); buttonOk = new JButton(actionOk); buttonCancel = new JButton(actionCancel); attrJPanel = argSchema.getSecGroupFormFactory().newAttrJPanel(argFocus); scrollPane = new CFHSlaveJScrollPane(attrJPanel); // Lay out the widgets setSize(1024, 480); Dimension min = new Dimension(480, 300); setMinimumSize(min); add(textAreaMessage); textAreaMessage.setBounds(0, 0, 1024, 50); int xparts = (768 - (2 * 125)) / 3; add(buttonOk); buttonOk.setBounds(xparts, 55, 125, 40); add(buttonCancel); buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40); add(scrollPane); scrollPane.setBounds(0, 100, 1024, 480 - 100); }
public void doLayout() { Dimension sz = getSize(); textAreaMessage.setBounds(0, 0, sz.width, 50); int xparts = (sz.width - (2 * 125)) / 3; buttonOk.setBounds(xparts, 55, 125, 40); buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40); scrollPane.setBounds(0, 100, sz.width, sz.height - 100); scrollPane.doLayout(); }
public int doLayoutRetHeight() { Dimension sz = getSize(); final int itemHeight = 25; final int itemSpacing = 5; final int labelWidth = 150; final int buttonHeight = 35; final int buttonWidth = 100; int y = itemSpacing; int fieldWidth = sz.width - (itemSpacing + labelWidth + itemSpacing + itemSpacing); int fieldX = itemSpacing + labelWidth + itemSpacing; int buttonSpacing = (sz.width - (buttonWidth + buttonWidth)) / 3; labelKeystoreName.setBounds(itemSpacing, y, labelWidth, itemHeight); textKeystoreName.setBounds(fieldX, y, fieldWidth, itemHeight); y = y + itemHeight + itemSpacing; labelKeystorePassword.setBounds(itemSpacing, y, labelWidth, itemHeight); textKeystorePassword.setBounds(fieldX, y, fieldWidth, itemHeight); y = y + itemHeight + itemSpacing + itemSpacing; buttonOk.setBounds(buttonSpacing, y, buttonWidth, buttonHeight); buttonCancel.setBounds( buttonSpacing + buttonWidth + buttonSpacing, y, buttonWidth, buttonHeight); y = y + buttonHeight + itemSpacing + itemSpacing; return (y); }
public void doLayout() { Dimension sz = getSize(); final int buttonWidth = 100; final int buttonHeight = 25; final int buttonSpacing = 10; final int spTop = buttonSpacing + buttonHeight + buttonSpacing; int buttonStart = (sz.width - ((3 * buttonWidth) + (2 * buttonSpacing))) / 2; if (buttonStart < 0) { buttonStart = 0; } int spHeight = sz.height - spTop; if (spHeight < 0) { spHeight = 0; } buttonChooseNone.setBounds(buttonStart, buttonSpacing, buttonWidth, buttonHeight); buttonChooseSelected.setBounds( buttonStart + buttonWidth + buttonSpacing, buttonSpacing, buttonWidth, buttonHeight); buttonCancel.setBounds( buttonStart + buttonWidth + buttonSpacing + buttonWidth + buttonSpacing, buttonSpacing, buttonWidth, buttonHeight); dataScrollPane.setBounds(0, spTop, sz.width, spHeight); }