List of usage examples for java.awt GridBagConstraints HORIZONTAL
int HORIZONTAL
To view the source code for java.awt GridBagConstraints HORIZONTAL.
Click Source Link
From source file:gov.loc.repository.bagger.ui.NewBagInPlaceFrame.java
private void layoutProfileSelectionContent(JPanel contentPane, int row) { // content/*from w w w . jav a 2 s .com*/ // profile selection JLabel bagProfileLabel = new JLabel(bagView.getPropertyMessage("Select Profile:")); bagProfileLabel.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help")); profileList = new JComboBox(bagView.getProfileStore().getProfileNames()); profileList.setName(bagView.getPropertyMessage("bag.label.projectlist")); profileList.setSelectedItem(bagView.getPropertyMessage("bag.project.noproject")); profileList.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help")); GridBagConstraints glbc = new GridBagConstraints(); JLabel spacerLabel = new JLabel(); glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); contentPane.add(bagProfileLabel, glbc); glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); contentPane.add(profileList, glbc); glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); contentPane.add(spacerLabel, glbc); }
From source file:io.github.tavernaextras.biocatalogue.ui.search_results.SOAPOperationListCellRenderer.java
/** * @return Final state of the {@link GridBagConstraints} instance * that was used to lay out components in the panel. *///from w ww . j a v a 2 s.com private GridBagConstraints arrangeLayout() { // POPULATE PANEL WITH PREPARED COMPONENTS this.setLayout(new GridBagLayout()); c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; c.weightx = 0; c.insets = new Insets(8, 6, 6, 3); this.add(jlTypeIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(8, 3, 6, 3); this.add(jlItemTitle, c); c.gridx++; c.gridheight = 7; c.weightx = 0; c.weighty = 1.0; this.add(jlItemStatus, c); c.gridx = 1; c.gridy++; c.gridheight = 1; c.weightx = 0; c.weighty = 0; this.add(jlPartOf, c); c.gridy++; this.add(jlWsdlLocation, c); c.fill = GridBagConstraints.NONE; c.gridy++; this.add(jtDescription, c); c.fill = GridBagConstraints.HORIZONTAL; c.gridy++; this.add(jlSoapInputs, c); c.fill = GridBagConstraints.HORIZONTAL; c.gridy++; this.add(jlSoapOutputs, c); return (c); }
From source file:MainProgram.MainProgram.java
private void initComponents() throws InterruptedException { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents welcomeMessage = new JLabel(); welcomeMessage2 = new JLabel(); pennIDLabel = new JLabel(); pennIDTextField = new JTextField(); pennPassLabel = new JLabel(); pennPassField = new JPasswordField(); emailLabel = new JLabel(); emailTextField = new JTextField(); emailDomainLabel = new JLabel(); emailPassLabel = new JLabel(); emailPassField = new JPasswordField(); semesterLabel = new JLabel(); semesterComboBox = new JComboBox(semestersString); credentials = new JLabel(); dropLabel = new JLabel(); dropCheckBox = new JCheckBox(); button = new JButton(); stopWatchLabel = new JLabel(); checkMail = false;/*w w w . j ava 2s . c o m*/ testConnection = false; mailCheckTimeInitializer(); StopWatchInitializer(); try { setUIFont(new javax.swing.plaf.FontUIResource("Segoe UI", Font.ROMAN_BASELINE, 12)); } catch (Exception e) { e.printStackTrace(MainProgram.errorLog); } String lcOSName = System.getProperty("os.name").toLowerCase(); boolean IS_MAC = lcOSName.startsWith("mac os x"); //======== this ======== setLayout(new GridBagLayout()); ((GridBagLayout) getLayout()).columnWidths = new int[] { 81, 5, 119, 5, 0, 0 }; if (!IS_MAC) { ((GridBagLayout) getLayout()).rowHeights = new int[] { 17, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 0, 0, 0 }; } ((GridBagLayout) getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 }; GridBagConstraints constraints = new GridBagConstraints(); constraints.gridx = 0; constraints.gridy = 0; constraints.fill = GridBagConstraints.HORIZONTAL; //---- welcomeMessage ---- welcomeMessage.setText("Course Registration"); welcomeMessage.setHorizontalAlignment(SwingConstants.CENTER); add(welcomeMessage, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- welcomeMessage2 ---- welcomeMessage2.setText("for Penn State (BETA)"); welcomeMessage2.setHorizontalAlignment(SwingConstants.CENTER); add(welcomeMessage2, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- pennIDLabel ---- pennIDLabel.setText("Penn State ID: "); pennIDLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(pennIDLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- pennIDTextField ---- pennIDTextField.setText("xxx123"); add(pennIDTextField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- pennPassLabel ---- pennPassLabel.setText("Penn State Password: "); pennPassLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(pennPassLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(pennPassField, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailLabel ---- emailLabel.setText("Email: "); emailLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(emailLabel, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailTextField ---- emailTextField.setText("myEmail"); add(emailTextField, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailDomainLabel ---- emailDomainLabel.setText("@mail.com"); add(emailDomainLabel, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailPassLabel ---- emailPassLabel.setText("Email Password: "); emailPassLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(emailPassLabel, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(emailPassField, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- Semester label ---- semesterLabel.setText("Semester/Drop Option: "); semesterLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(semesterLabel, new GridBagConstraints(0, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- Semester ComboBox ---- add(semesterComboBox, new GridBagConstraints(1, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- Drop CheckBox ---- add(dropCheckBox, new GridBagConstraints(2, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- button ---- button.setText("Start"); add(button, new GridBagConstraints(1, 16, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- stopWatchLabel ---- stopWatchLabel.setText(" " + stopWatchSplitting[0]); stopWatchLabel.setHorizontalAlignment(SwingConstants.LEFT); add(stopWatchLabel, new GridBagConstraints(2, 16, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- label11 ---- credentials.setText(" Created by Daniyar Yeralin"); credentials.setForeground(Color.gray); credentials.setHorizontalAlignment(SwingConstants.RIGHT); credentials.setFont(new Font("Cambria", Font.ITALIC, 12)); add(credentials, new GridBagConstraints(2, 17, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); /*button.registerKeyboardAction(button.getActionForKeyStroke( KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, false)), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED); button.registerKeyboardAction(button.getActionForKeyStroke( KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, true)), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true), JComponent.WHEN_FOCUSED);*/ StartButtonHandler buttonListener = new StartButtonHandler(); button.addActionListener(buttonListener); }
From source file:org.jets3t.gui.ItemPropertiesDialog.java
/** * Initialise the GUI elements to display the given item. * * @param s3Item/*from ww w . jav a2s.c o m*/ * the S3Bucket or an S3Object whose details will be displayed */ private void initGui(boolean isObjectBased) { // Initialise skins factory. skinsFactory = SkinsFactory.getInstance(applicationProperties); // Set Skinned Look and Feel. LookAndFeel lookAndFeel = skinsFactory.createSkinnedMetalTheme("SkinnedLookAndFeel"); try { UIManager.setLookAndFeel(lookAndFeel); } catch (UnsupportedLookAndFeelException e) { log.error("Unable to set skinned LookAndFeel", e); } this.setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); JPanel commonPropertiesContainer = skinsFactory.createSkinnedJPanel("ItemPropertiesCommonPanel"); commonPropertiesContainer.setLayout(new GridBagLayout()); JPanel metadataContainer = skinsFactory.createSkinnedJPanel("ItemPropertiesMetadataPanel"); metadataContainer.setLayout(new GridBagLayout()); JPanel grantsContainer = skinsFactory.createSkinnedJPanel("ItemPropertiesGrantsPanel"); grantsContainer.setLayout(new GridBagLayout()); if (!isObjectBased) { // Display bucket details. JLabel bucketNameLabel = skinsFactory.createSkinnedJHtmlLabel("BucketNameLabel"); bucketNameLabel.setText("Bucket name:"); bucketNameTextField = skinsFactory.createSkinnedJTextField("BucketNameTextField"); bucketNameTextField.setEditable(false); JLabel bucketLocationLabel = skinsFactory.createSkinnedJHtmlLabel("BucketLocationLabel"); bucketLocationLabel.setText("Location:"); bucketLocationTextField = skinsFactory.createSkinnedJTextField("BucketLocationTextField"); bucketLocationTextField.setEditable(false); JLabel bucketCreationDateLabel = skinsFactory.createSkinnedJHtmlLabel("BucketCreationDateLabel"); bucketCreationDateLabel.setText("Creation date:"); bucketCreationDateTextField = skinsFactory.createSkinnedJTextField("BucketCreationDateTextField"); bucketCreationDateTextField.setEditable(false); ownerNameLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerNameLabel"); ownerNameLabel.setText("Owner name:"); ownerNameTextField = skinsFactory.createSkinnedJTextField("OwnerNameTextField"); ownerNameTextField.setEditable(false); ownerIdLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerIdLabel"); ownerIdLabel.setText("Owner ID:"); ownerIdTextField = skinsFactory.createSkinnedJTextField("OwnerIdTextField"); ownerIdTextField.setEditable(false); bucketIsRequesterPaysLabel = skinsFactory.createSkinnedJHtmlLabel("BucketIsRequesterPaysLabel"); bucketIsRequesterPaysLabel.setText("Requester Pays?"); bucketIsRequesterPaysCheckBox = skinsFactory.createSkinnedJCheckBox("BucketIsRequesterPaysCheckBox"); bucketIsRequesterPaysCheckBox.setEnabled(false); int row = 0; commonPropertiesContainer.add(bucketNameLabel, new GridBagConstraints(0, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketNameTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketLocationLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketLocationTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketCreationDateLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketCreationDateTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketIsRequesterPaysLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketIsRequesterPaysCheckBox, new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdLabel, new GridBagConstraints(0, ++row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdTextField, new GridBagConstraints(1, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); } else { // Display object details. JLabel objectKeyLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectKeyLabel"); objectKeyLabel.setText("Object key:"); objectKeyTextField = skinsFactory.createSkinnedJTextField("ObjectKeyTextField"); objectKeyTextField.setEditable(false); JLabel objectContentTypeLabel = skinsFactory.createSkinnedJHtmlLabel("ContentTypeLabel"); objectContentTypeLabel.setText("Content type:"); objectContentTypeTextField = skinsFactory.createSkinnedJTextField("ContentTypeTextField"); objectContentTypeTextField.setEditable(false); JLabel objectContentLengthLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectContentLengthLabel"); objectContentLengthLabel.setText("Size:"); objectContentLengthTextField = skinsFactory.createSkinnedJTextField("ObjectContentLengthTextField"); objectContentLengthTextField.setEditable(false); JLabel objectLastModifiedLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectLastModifiedLabel"); objectLastModifiedLabel.setText("Last modified:"); objectLastModifiedTextField = skinsFactory.createSkinnedJTextField("ObjectLastModifiedTextField"); objectLastModifiedTextField.setEditable(false); JLabel objectETagLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectETagLabel"); objectETagLabel.setText("ETag:"); objectETagTextField = skinsFactory.createSkinnedJTextField("ObjectETagTextField"); objectETagTextField.setEditable(false); JLabel bucketNameLabel = skinsFactory.createSkinnedJHtmlLabel("BucketNameLabel"); bucketNameLabel.setText("Bucket name:"); bucketNameTextField = skinsFactory.createSkinnedJTextField("BucketNameTextField"); bucketNameTextField.setEditable(false); ownerNameLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerNameLabel"); ownerNameLabel.setText("Owner name:"); ownerNameTextField = skinsFactory.createSkinnedJTextField("OwnerNameTextField"); ownerNameTextField.setEditable(false); ownerIdLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerIdLabel"); ownerIdLabel.setText("Owner ID:"); ownerIdTextField = skinsFactory.createSkinnedJTextField("OwnerIdTextField"); ownerIdTextField.setEditable(false); commonPropertiesContainer.add(objectKeyLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectKeyTextField, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentTypeTextField, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentLengthLabel, new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectContentLengthTextField, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectLastModifiedLabel, new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectLastModifiedTextField, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectETagLabel, new GridBagConstraints(0, 4, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(objectETagTextField, new GridBagConstraints(1, 4, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketNameLabel, new GridBagConstraints(0, 5, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(bucketNameTextField, new GridBagConstraints(1, 5, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameLabel, new GridBagConstraints(0, 7, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerNameTextField, new GridBagConstraints(1, 7, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdLabel, new GridBagConstraints(0, 8, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); commonPropertiesContainer.add(ownerIdTextField, new GridBagConstraints(1, 8, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); // Build metadata table. objectMetadataTableModel = new DefaultTableModel(new Object[] { "Name", "Value" }, 0) { private static final long serialVersionUID = -3762866886166776851L; @Override public boolean isCellEditable(int row, int column) { return false; } }; TableSorter metadataTableSorter = new TableSorter(objectMetadataTableModel); JTable metadataTable = skinsFactory.createSkinnedJTable("MetadataTable"); metadataTable.setModel(metadataTableSorter); metadataTableSorter.setTableHeader(metadataTable.getTableHeader()); metadataContainer.add(new JScrollPane(metadataTable), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); } // Build grants table. grantsTableModel = new DefaultTableModel(new Object[] { "Grantee", "Permission" }, 0) { private static final long serialVersionUID = -5882427163845726770L; @Override public boolean isCellEditable(int row, int column) { return false; } }; TableSorter grantsTableSorter = new TableSorter(grantsTableModel); grantsTable = skinsFactory.createSkinnedJTable("GrantsTable"); grantsTable.setModel(grantsTableSorter); grantsTableSorter.setTableHeader(grantsTable.getTableHeader()); grantsContainer.add(new JScrollPane(grantsTable), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); // OK Button. JButton okButton = skinsFactory.createSkinnedJButton("ItemPropertiesOKButton"); okButton.setText("Finished"); okButton.setActionCommand("OK"); okButton.addActionListener(this); // Set default ENTER button. this.getRootPane().setDefaultButton(okButton); // Put it all together. int row = 0; JPanel container = skinsFactory.createSkinnedJPanel("ItemPropertiesPanel"); container.setLayout(new GridBagLayout()); container.add(commonPropertiesContainer, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); if (isObjectBased) { if (includeMetadata) { JHtmlLabel metadataLabel = skinsFactory.createSkinnedJHtmlLabel("MetadataLabel"); metadataLabel.setText("<html><b>Metadata</b></html>"); metadataLabel.setHorizontalAlignment(JLabel.CENTER); container.add(metadataLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsVerticalSpace, 0, 0)); container.add(metadataContainer, new GridBagConstraints(0, row++, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); } // Object previous and next buttons, if we have multiple objects. previousObjectButton = skinsFactory.createSkinnedJButton("ItemPropertiesPreviousButton"); previousObjectButton.setText("Previous"); previousObjectButton.addActionListener(this); previousObjectButton.setEnabled(false); nextObjectButton = skinsFactory.createSkinnedJButton("ItemPropertiesNextButton"); nextObjectButton.setText("Next"); nextObjectButton.addActionListener(this); nextObjectButton.setEnabled(false); currentObjectLabel = skinsFactory.createSkinnedJHtmlLabel("ItemPropertiesCurrentObjectLabel"); currentObjectLabel.setHorizontalAlignment(JLabel.CENTER); nextPreviousPanel = skinsFactory.createSkinnedJPanel("ItemPropertiesNextPreviousPanel"); nextPreviousPanel.setLayout(new GridBagLayout()); nextPreviousPanel.add(previousObjectButton, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0)); nextPreviousPanel.add(currentObjectLabel, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); nextPreviousPanel.add(nextObjectButton, new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsZero, 0, 0)); container.add(nextPreviousPanel, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); row++; } else { JHtmlLabel grantsLabel = skinsFactory.createSkinnedJHtmlLabel("GrantsLabel"); grantsLabel.setText("<html><b>Permissions</b></html>"); grantsLabel.setHorizontalAlignment(JLabel.CENTER); container.add(grantsLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsVerticalSpace, 0, 0)); container.add(grantsContainer, new GridBagConstraints(0, row++, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); } container.add(okButton, new GridBagConstraints(0, row++, 3, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsZero, 0, 0)); this.getContentPane().add(container); this.pack(); if (isObjectBased) { this.setSize(400, (includeMetadata ? 550 : 400)); } this.setLocationRelativeTo(this.getOwner()); }
From source file:cool.pandora.modeller.ui.jpanel.base.NewBagInPlaceFrame.java
/** * layoutProfileSelectionContent.//ww w . j av a 2s . c o m * * @param contentPane JPanel * @param row int */ private void layoutProfileSelectionContent(final JPanel contentPane, final int row) { // content // profile selection final JLabel bagProfileLabel = new JLabel(bagView.getPropertyMessage("Select Profile:")); bagProfileLabel.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help")); profileList = new JComboBox<>(bagView.getProfileStore().getProfileNames()); profileList.setName(bagView.getPropertyMessage("bag.label.projectlist")); profileList.setSelectedItem(bagView.getPropertyMessage("bag.project.noproject")); profileList.setToolTipText(bagView.getPropertyMessage("bag.projectlist.help")); GridBagConstraints glbc = new GridBagConstraints(); final JLabel spacerLabel = new JLabel(); glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); contentPane.add(bagProfileLabel, glbc); glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); contentPane.add(profileList, glbc); glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); contentPane.add(spacerLabel, glbc); }
From source file:io.github.tavernaextras.biocatalogue.ui.search_results.RESTMethodListCellRenderer.java
/** * @return Final state of the {@link GridBagConstraints} instance * that was used to lay out components in the panel. *//*from w ww . j a va2 s. com*/ private GridBagConstraints arrangeLayout() { // POPULATE PANEL WITH PREPARED COMPONENTS this.setLayout(new GridBagLayout()); c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; c.weightx = 0; c.insets = new Insets(8, 6, 6, 3); this.add(jlTypeIcon, c); c.gridx++; c.weightx = 1.0; c.insets = new Insets(8, 3, 6, 3); this.add(jlItemTitle, c); c.gridx++; c.gridheight = 8; c.weightx = 0; c.weighty = 1.0; this.add(jlItemStatus, c); c.gridx = 1; c.gridy++; c.gridheight = 1; c.weightx = 1.0; c.weighty = 0; this.add(jlPartOf, c); c.fill = GridBagConstraints.NONE; c.gridy++; this.add(jtDescription, c); c.fill = GridBagConstraints.HORIZONTAL; c.gridy++; this.add(jlMethodType, c); c.gridy++; this.add(jlUrlTemplate, c); c.gridy++; this.add(jlMethodParameters, c); c.gridy++; this.add(jlInputRepresentations, c); c.gridy++; this.add(jlOutputRepresentations, c); return (c); }
From source file:io.github.tavernaextras.biocatalogue.ui.search_results.ServiceListCellRenderer.java
protected void prepareLoadingExpandedEntry(Object itemToRender) { LoadingExpandedResource expandedResource = (LoadingExpandedResource) itemToRender; GridBagConstraints c = prepareLoadedEntry(expandedResource.getAssociatedObj(), false); if (expandedResource.isLoading()) { c.gridx = 0;/*from w w w . j av a2 s . c o m*/ c.gridy++; c.gridwidth = 3; c.anchor = GridBagConstraints.CENTER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; this.add(loaderBarAnimationOrange, c); } else { // *** additional data for this Web Service operations *** Service service = (Service) expandedResource.getAssociatedObj(); // -- categories -- int categoryCount = service.getSummary().getCategoryList().size(); String categoryString = ""; if (categoryCount > 0) { List<String> categoryNames = new ArrayList<String>(); for (ResourceLinkWithString category : service.getSummary().getCategoryList()) { categoryNames.add(category.getStringValue()); } categoryString = "<html><b>" + Util.pluraliseNoun("Category", categoryCount) + ": </b>" + StringEscapeUtils.escapeHtml(Util.join(categoryNames, ", ")) + "</html>"; } else { categoryString = "<html><b>Category: </b><font color=\"gray\">unknown</font></html>"; } c.gridy++; this.add(new JLabel(categoryString), c); // -- endpoints -- int endpointCount = service.getSummary().getEndpointList().size(); String endpointString = ""; if (endpointCount > 0) { endpointString = "<html><b>" + Util.pluraliseNoun("Endpoint", endpointCount) + ": </b>" + StringEscapeUtils.escapeHtml(Util.join(service.getSummary().getEndpointList(), ", ")) + "</html>"; } else { endpointString = "<html><b>Endpoint: </b><font color=\"gray\">unknown</font></html>"; } c.gridy++; this.add(new JLabel(endpointString), c); // -- providers -- int providerCount = service.getSummary().getProviderList().size(); String providerString = ""; if (providerCount > 0) { List<String> providerNames = new ArrayList<String>(); for (Provider serviceProvider : service.getSummary().getProviderList()) { providerNames.add(serviceProvider.getName()); } providerString = "<html><b>" + Util.pluraliseNoun("Provider", providerCount) + ": </b>" + StringEscapeUtils.escapeHtml(Util.join(providerNames, ", ")) + "</html>"; } else { providerString = "<html><b>Provider: </b><font color=\"gray\">unknown</font></html>"; } c.gridy++; this.add(new JLabel(providerString), c); // -- locations -- int locationCount = service.getSummary().getLocationList().size(); String locationString = ""; List<String> locations = new ArrayList<String>(); if (locationCount > 0) { for (Location location : service.getSummary().getLocationList()) { List<String> locationNameFragments = new ArrayList<String>(); locationNameFragments.add(location.getCity()); locationNameFragments.add(location.getCountry()); locations.add(Util.join(locationNameFragments, ", ")); } } locationString = "<html><b>" + Util.pluraliseNoun("Location", locations.size()) + ": </b>" + (locations.size() > 0 ? StringEscapeUtils.escapeHtml(Util.join(locations, "; ")) : "<font color=\"gray\">unknown</font>") + "</html>"; c.gridy++; c.insets = new Insets(3, 3, 12, 3); this.add(new JLabel(locationString), c); } }
From source file:com.intuit.tank.tools.script.ScriptFilterRunner.java
/** * @return/*from w ww . ja v a2s . c om*/ */ private Component createTopPanel() { JPanel topPanel = new JPanel(new GridBagLayout()); List<ConfiguredLanguage> configuredLanguages = ConfiguredLanguage.getConfiguredLanguages(); languageSelector = new JComboBox(configuredLanguages.toArray()); languageSelector.setSelectedIndex(0); languageSelector.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { setSyntaxStyle(); } }); currentFileLabel = new JLabel(); final JFileChooser jFileChooser = new JFileChooser(); jFileChooser.setFileFilter(new FileFilter() { @Override public String getDescription() { return "Tank XML Files"; } @Override public boolean accept(File f) { return f.isDirectory() || f.getName().toLowerCase().endsWith("_ts.xml"); } }); JButton button = new JButton("Select File..."); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { int showOpenDialog = jFileChooser.showOpenDialog(ScriptFilterRunner.this); if (showOpenDialog == JFileChooser.APPROVE_OPTION) { loadTSXml(jFileChooser.getSelectedFile()); } } }); xmlViewDialog = new XMlViewDialog(this); xmlViewDialog.setSize(new Dimension(800, 500)); showXmlBT = new JButton("Show XML"); showXmlBT.setEnabled(false); showXmlBT.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { displayXml(); } }); saveBT = new JButton("Save XML"); saveBT.setEnabled(false); saveBT.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveXml(); } }); JPanel xmlPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 10, 20)); xmlPanel.add(button); xmlPanel.add(showXmlBT); xmlPanel.add(saveBT); int y = 0; topPanel.add(new JLabel("Current Tank XML: "), getConstraints(0, y, GridBagConstraints.NONE)); topPanel.add(currentFileLabel, getConstraints(1, y++, GridBagConstraints.HORIZONTAL)); topPanel.add(new JLabel("Select Script Language: "), getConstraints(0, y, GridBagConstraints.NONE)); topPanel.add(languageSelector, getConstraints(1, y++, GridBagConstraints.HORIZONTAL)); topPanel.add(new JLabel("Select Tank XML: "), getConstraints(0, y, GridBagConstraints.NONE)); topPanel.add(xmlPanel, getConstraints(1, y++, GridBagConstraints.HORIZONTAL)); return topPanel; }
From source file:org.opendatakit.briefcase.ui.settings.SettingsPanelForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//from w w w .j av a2 s. c om */ private void $$$setupUI$$$() { createUIComponents(); container = new JPanel(); container.setLayout(new GridBagLayout()); storageLocationContainer = new JPanel(); storageLocationContainer.setLayout(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 5; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(storageLocationContainer, gbc); storageLocationLabel = new JLabel(); storageLocationLabel.setText("Storage Location"); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; storageLocationContainer.add(storageLocationLabel, gbc); storageLocationField = new JTextField(); storageLocationField.setEditable(false); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.weightx = 1.0; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; storageLocationContainer.add(storageLocationField, gbc); storageLocationButtons = new JPanel(); storageLocationButtons.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 0; gbc.fill = GridBagConstraints.BOTH; storageLocationContainer.add(storageLocationButtons, gbc); storageLocationClearButton = new JButton(); storageLocationClearButton.setText("Clear"); storageLocationClearButton.setVisible(false); storageLocationButtons.add(storageLocationClearButton); storageLocationChooseButton = new JButton(); storageLocationChooseButton.setText("Choose..."); storageLocationButtons.add(storageLocationChooseButton); final JPanel spacer1 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; storageLocationContainer.add(spacer1, gbc); pullInParallelField = new JCheckBox(); pullInParallelField.setText("Pull submissions in parallel (experimental)"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(pullInParallelField, gbc); rememberPasswordsField = new JCheckBox(); rememberPasswordsField.setText("Remember passwords (unencrypted)"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 7; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(rememberPasswordsField, gbc); sendUsageDataField = new JCheckBox(); sendUsageDataField.setText("Send usage data and crash logs to core developers"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 9; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(sendUsageDataField, gbc); useHttpProxyField = new JCheckBox(); useHttpProxyField.setText("Use HTTP Proxy"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 11; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(useHttpProxyField, gbc); final JPanel spacer2 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 12; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 0, 0, 20); container.add(spacer2, gbc); httpProxyJostLabel = new JLabel(); httpProxyJostLabel.setText("Host"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 12; gbc.anchor = GridBagConstraints.WEST; container.add(httpProxyJostLabel, gbc); httpProxyHostField = new JTextField(); httpProxyHostField.setPreferredSize(new Dimension(150, 30)); httpProxyHostField.setText("127.0.0.1"); gbc = new GridBagConstraints(); gbc.gridx = 4; gbc.gridy = 12; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(httpProxyHostField, gbc); final JPanel spacer3 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 12; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer3, gbc); httpProxyPortLabel = new JLabel(); httpProxyPortLabel.setText("Port"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 13; gbc.anchor = GridBagConstraints.WEST; container.add(httpProxyPortLabel, gbc); final JPanel spacer4 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 5; gbc.gridy = 12; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer4, gbc); httpProxyPortField.setPreferredSize(new Dimension(150, 30)); gbc = new GridBagConstraints(); gbc.gridx = 4; gbc.gridy = 13; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(httpProxyPortField, gbc); final JPanel spacer5 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 10; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer5, gbc); final JPanel spacer6 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 6; gbc.gridy = 1; gbc.gridheight = 13; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer6, gbc); final JPanel spacer7 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.gridheight = 13; gbc.fill = GridBagConstraints.HORIZONTAL; container.add(spacer7, gbc); final JPanel spacer8 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer8, gbc); final JPanel spacer9 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 14; gbc.gridwidth = 5; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer9, gbc); final JPanel spacer10 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 8; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer10, gbc); final JPanel spacer11 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer11, gbc); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridBagLayout()); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 15; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.BOTH; container.add(panel1, gbc); panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Troubleshooting")); reloadCacheButton = new JButton(); reloadCacheButton.setEnabled(false); reloadCacheButton.setText("Reload forms from storage location"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 8; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(reloadCacheButton, gbc); final JPanel spacer12 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 7; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer12, gbc); final JPanel spacer13 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 9; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer13, gbc); final JPanel spacer14 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 3; gbc.gridy = 8; gbc.weightx = 0.5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer14, gbc); final JPanel spacer15 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 8; gbc.weightx = 0.5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer15, gbc); final JLabel label1 = new JLabel(); label1.setText("The form list in Briefcase can get out of date if files are moved manually."); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; panel1.add(label1, gbc); final JLabel label2 = new JLabel(); label2.setText("This reload is always safe."); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; panel1.add(label2, gbc); final JPanel spacer16 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer16, gbc); final JPanel spacer17 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer17, gbc); final JPanel spacer18 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 4; gbc.gridy = 5; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(spacer18, gbc); final JPanel spacer19 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 4; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer19, gbc); cleanAllPullResumePointsButton = new JButton(); cleanAllPullResumePointsButton.setEnabled(false); cleanAllPullResumePointsButton.setText("Clear pull history"); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 3; gbc.fill = GridBagConstraints.HORIZONTAL; panel1.add(cleanAllPullResumePointsButton, gbc); final JLabel label3 = new JLabel(); label3.setText("Use if you wish to pull every submission, regardless of last submission pulled."); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 3; gbc.anchor = GridBagConstraints.WEST; panel1.add(label3, gbc); final JPanel spacer20 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 2; gbc.fill = GridBagConstraints.VERTICAL; panel1.add(spacer20, gbc); final JPanel spacer21 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 16; gbc.gridwidth = 6; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer21, gbc); resumeLastPullField = new JCheckBox(); resumeLastPullField.setText("Start pull from last submission pulled"); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.gridwidth = 5; gbc.anchor = GridBagConstraints.WEST; container.add(resumeLastPullField, gbc); final JPanel spacer22 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.gridwidth = 5; gbc.fill = GridBagConstraints.VERTICAL; container.add(spacer22, gbc); }
From source file:com.wet.wired.jsr.recorder.JRecorder.java
private void showWindow() { this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { closeRecorder();/*from ww w . j av a2 s . c om*/ System.exit(0); } }); setTitle("TestingOwl Recorder"); setIconImage(owl.getWelcomeIcon().getImage()); getContentPane().removeAll(); GridBagLayout gbl = new GridBagLayout(); GridBagConstraints gbc = new GridBagConstraints(); this.getContentPane().setLayout(gbl); control = new JButton("Start Recording"); control.setActionCommand("start"); control.addActionListener(this); gbc.fill = GridBagConstraints.BOTH; gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 1; gbc.weighty = 1; this.getContentPane().add(control, gbc); decorator.getButtonsAndSoundLevel(this.getContentPane(), gbc); player = new JButton("to Player"); player.setActionCommand("player"); player.addActionListener(this); gbc.fill = GridBagConstraints.BOTH; gbc.gridx = 5; gbc.gridy = 0; gbc.weightx = 1; gbc.weighty = 1; this.getContentPane().add(player, gbc); text = new JLabel("Ready to record"); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridx = 0; gbc.gridy = 1; gbc.weightx = 1; gbc.weighty = 0; gbc.gridwidth = 5; this.getContentPane().add(text, gbc); getContentPane().doLayout(); this.pack(); this.setAlwaysOnTop(true); this.setVisible(true); }