List of usage examples for java.awt GridBagConstraints NONE
int NONE
To view the source code for java.awt GridBagConstraints NONE.
Click Source Link
From source file:cool.pandora.modeller.ui.jpanel.iiif.PatchManifestFrame.java
private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands();/*from w w w. j ava 2s. c o m*/ final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("PatchManifestFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Patch Manifest"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); final DefaultBag bag = bagView.getBag(); if (bag != null) { map = bag.getInfo().getFieldMap(); } final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); final JTextField urlField = new JTextField(""); final URI uri = IIIFObjectURI.getManifestResource(map); try { urlField.setText(uri != null ? uri.toString() : null); } catch (final Exception e) { log.error("Failed to set url label", e); } final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:cool.pandora.modeller.ui.jpanel.iiif.CreateXmlFilesFrame.java
private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands();// ww w.jav a2 s .c o m final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("CreateXmlFilesFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Create Xml Files " + "in:"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); final DefaultBag bag = bagView.getBag(); if (bag != null) { map = bag.getInfo().getFieldMap(); } final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); final JTextField urlField = new JTextField(""); final URI uri = IIIFObjectURI.getResourceContainerURI(map); try { urlField.setText(uri != null ? uri.toString() : null); } catch (final Exception e) { log.error("Failed to set url label", e); } final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:cool.pandora.modeller.ui.jpanel.iiif.PatchResourceFrame.java
private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands();// w w w. jav a 2 s. co m final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("PatchResourceFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Patch Resources"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); final DefaultBag bag = bagView.getBag(); if (bag != null) { map = bag.getInfo().getFieldMap(); } final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); final JTextField urlField = new JTextField(""); final URI uri = IIIFObjectURI.getResourceContainerURI(map); try { urlField.setText(uri != null ? uri.toString() : null); } catch (final Exception e) { log.error("Failed to set url label", e); } final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:cool.pandora.modeller.ui.jpanel.iiif.CreateCanvasesFrame.java
/** * createComponents./*from w ww . ja v a2s. c om*/ * * @return pageControl */ private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands(); final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("CreateCanvasesFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Create Canvases in:"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); final DefaultBag bag = bagView.getBag(); if (bag != null) { map = bag.getInfo().getFieldMap(); } final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); final JTextField urlField = new JTextField(""); final URI uri = IIIFObjectURI.getCanvasContainerURI(map); try { urlField.setText(uri != null ? uri.toString() : null); } catch (Exception e) { log.error("Failed to set url label", e); } final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:edu.harvard.mcz.imagecapture.LoginDialog.java
/** * This method initializes jPanel //w w w.jav a 2 s .c om * * @return javax.swing.JPanel */ private JPanel getJPanel() { if (jPanel == null) { GridBagConstraints gridBagConstraints17 = new GridBagConstraints(); gridBagConstraints17.gridx = 1; gridBagConstraints17.anchor = GridBagConstraints.WEST; gridBagConstraints17.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints17.gridy = 16; jLabel6 = new JLabel(); jLabel6.setText(""); GridBagConstraints gridBagConstraints62 = new GridBagConstraints(); gridBagConstraints62.gridx = 0; gridBagConstraints62.gridwidth = 2; gridBagConstraints62.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints62.anchor = GridBagConstraints.WEST; gridBagConstraints62.gridy = 6; GridBagConstraints gridBagConstraints51 = new GridBagConstraints(); gridBagConstraints51.gridx = 0; gridBagConstraints51.gridy = 4; GridBagConstraints gridBagConstraints41 = new GridBagConstraints(); gridBagConstraints41.fill = GridBagConstraints.BOTH; gridBagConstraints41.gridy = 3; gridBagConstraints41.weightx = 1.0; gridBagConstraints41.anchor = GridBagConstraints.WEST; gridBagConstraints41.gridx = 1; GridBagConstraints gridBagConstraints31 = new GridBagConstraints(); gridBagConstraints31.gridx = 0; gridBagConstraints31.anchor = GridBagConstraints.EAST; gridBagConstraints31.gridy = 3; jLabel9 = new JLabel(); jLabel9.setText("Password"); GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); gridBagConstraints21.gridx = 0; gridBagConstraints21.anchor = GridBagConstraints.EAST; gridBagConstraints21.gridy = 2; jLabel8 = new JLabel(); jLabel8.setText("email"); GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); gridBagConstraints16.fill = GridBagConstraints.BOTH; gridBagConstraints16.gridy = 2; gridBagConstraints16.weightx = 1.0; gridBagConstraints16.anchor = GridBagConstraints.WEST; gridBagConstraints16.gridx = 1; GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); gridBagConstraints15.gridx = 1; gridBagConstraints15.gridy = 12; GridBagConstraints gridBagConstraints61 = new GridBagConstraints(); gridBagConstraints61.gridx = 0; gridBagConstraints61.gridwidth = 1; gridBagConstraints61.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints61.gridheight = 4; gridBagConstraints61.fill = GridBagConstraints.NONE; gridBagConstraints61.weighty = 1.0; gridBagConstraints61.insets = new Insets(0, 0, 0, 0); gridBagConstraints61.gridy = 10; jLabel7 = new JLabel(); URL iconFile = this.getClass().getResource("/edu/harvard/mcz/imagecapture/resources/key_small.png"); try { //this.setIconImage(new ImageIcon(iconFile).getImage()); jLabel7.setIcon(new ImageIcon(iconFile)); } catch (Exception e) { System.out.println("Can't open icon file: " + iconFile); } jLabel7.setText(" "); GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.gridx = 1; gridBagConstraints12.anchor = GridBagConstraints.NORTH; gridBagConstraints12.fill = GridBagConstraints.NONE; gridBagConstraints12.gridy = 1; jLabel5 = new JLabel(); jLabel5.setText("Connect to Database"); jLabel4 = new JLabel(); jLabel4.setText("Dialect"); jLabel3 = new JLabel(); jLabel3.setText("Connection"); jLabel2 = new JLabel(); jLabel2.setText("Driver"); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 0; gridBagConstraints2.gridy = 2; jLabel1 = new JLabel(); jLabel1.setText("DBPassword"); jLabel = new JLabel(); jLabel.setText("Schema"); jPanel = new JPanel(); jPanel.setLayout(new GridBagLayout()); jPanel.add(jLabel5, gridBagConstraints12); jPanel.add(jLabel7, gridBagConstraints61); jPanel.add(getJPanel1(), gridBagConstraints15); jPanel.add(getJTextFieldEmail(), gridBagConstraints16); jPanel.add(jLabel8, gridBagConstraints21); jPanel.add(jLabel9, gridBagConstraints31); jPanel.add(getJPasswordFieldUser(), gridBagConstraints41); jPanel.add(getJButton2(), gridBagConstraints51); jPanel.add(getJPanelAdvanced(), gridBagConstraints62); jPanel.add(jLabel6, gridBagConstraints17); } return jPanel; }
From source file:cool.pandora.modeller.ui.jpanel.iiif.UploadBagFrame.java
private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands();// w w w . j av a 2 s.co m final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("UploadBagFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Upload Resources " + "to:"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); final DefaultBag bag = bagView.getBag(); if (bag != null) { map = bag.getInfo().getFieldMap(); } final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); final JTextField urlField = new JTextField(""); final URI uri = IIIFObjectURI.getResourceContainerURI(map); try { urlField.setText(uri != null ? uri.toString() : null); } catch (Exception e) { log.error("Failed to set url label", e); } urlField.setEnabled(false); //only if bag is not null if (bag != null) { urlLabel.setEnabled(true); } final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectCreate.java
/** * This method initializes jPanelPjtName * /*from w w w. j av a2 s . c o m*/ * @return javax.swing.JPanel */ private JPanel getJPanelPjtName() { if (jPanelPjtName == null) { GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.insets = new Insets(10, 10, 0, 0); gridBagConstraints.ipadx = 4; gridBagConstraints.gridy = 0; jLabelNewProjectName = new JLabel(); jLabelNewProjectName.setText("New Project Name :"); GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.anchor = GridBagConstraints.CENTER; gridBagConstraints7.insets = new Insets(10, 10, 10, 0); gridBagConstraints7.gridwidth = 1; gridBagConstraints7.gridx = 1; gridBagConstraints7.gridy = 1; gridBagConstraints7.weightx = 0.1; gridBagConstraints7.fill = GridBagConstraints.HORIZONTAL; GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.anchor = GridBagConstraints.EAST; gridBagConstraints6.gridx = 0; gridBagConstraints6.gridy = 1; gridBagConstraints6.ipadx = 0; gridBagConstraints6.insets = new Insets(10, 10, 10, 0); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 2; gridBagConstraints2.insets = new Insets(10, 10, 0, 10); gridBagConstraints2.fill = GridBagConstraints.NONE; gridBagConstraints2.gridy = 0; GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridy = 0; gridBagConstraints1.weightx = 0.1; gridBagConstraints1.gridwidth = 1; gridBagConstraints1.insets = new Insets(10, 10, 0, 0); gridBagConstraints1.gridx = 1; jPanelPjtName = new JPanel(); jPanelPjtName.setLayout(new GridBagLayout()); jPanelPjtName.setPreferredSize(new Dimension(500, 200)); jPanelPjtName.setBorder(BorderFactory.createTitledBorder(null, "Project Name", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51))); jPanelPjtName.add(getJTextFieldNewProjectName(), gridBagConstraints1); jPanelPjtName.add(getJButtonCheck(), gridBagConstraints2); jPanelPjtName.add(getJCheckBoxClonedFrom(), gridBagConstraints6); jPanelPjtName.add(getJComboBoxClonedFrom(), gridBagConstraints7); jPanelPjtName.add(jLabelNewProjectName, gridBagConstraints); } return jPanelPjtName; }
From source file:us.paulevans.basicxslt.TransformParametersFrame.java
/** * Builds the add/remove panel/*from ww w.jav a 2s .c o m*/ * @return */ private JPanel buildAddRemovePanel() { int row; GridBagLayout layout; GridBagConstraints constraints; JPanel buttons; row = 0; layout = new GridBagLayout(); constraints = new GridBagConstraints(); buttons = new JPanel(new FlowLayout(FlowLayout.LEFT)); buttons.add( addParamBtn = new JButton(stringFactory.getString(LabelStringFactory.PARAMS_FRAME_ADD_PARAMETER))); buttons.add(removeCheckedBtn = new JButton( stringFactory.getString(LabelStringFactory.PARAMS_FRAME_REMOVE_CHECKED))); addParamBtn.addActionListener(this); removeCheckedBtn.addActionListener(this); JPanel addRemovePanel = new JPanel(layout); GUIUtils.add(addRemovePanel, buttons, layout, constraints, row++, 0, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS); GUIUtils.add(addRemovePanel, new JSeparator(), layout, constraints, row++, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, GUIUtils.SMALL_INSETS); return addRemovePanel; }
From source file:cool.pandora.modeller.ui.jpanel.iiif.CreateSequencesFrame.java
private JPanel createComponents() { final Border border = new EmptyBorder(5, 5, 5, 5); final TitlePane titlePane = new TitlePane(); initStandardCommands();//ww w.j a va2 s .c om final JPanel pageControl = new JPanel(new BorderLayout()); final JPanel titlePaneContainer = new JPanel(new BorderLayout()); titlePane.setTitle(bagView.getPropertyMessage("CreateSequencesFrame.title")); titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Create Sequence in:"))); titlePaneContainer.add(titlePane.getControl()); titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH); pageControl.add(titlePaneContainer, BorderLayout.NORTH); final JPanel contentPane = new JPanel(); final DefaultBag bag = bagView.getBag(); if (bag != null) { map = bag.getInfo().getFieldMap(); } final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label")); urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description")); final JTextField urlField = new JTextField(""); final URI uri = IIIFObjectURI.getSequenceContainerURI(map); try { urlField.setText(uri != null ? uri.toString() : null); } catch (final Exception e) { log.error("Failed to set url label", e); } final JLabel sequenceIDLabel = new JLabel(bagView.getPropertyMessage("sequenceID.label")); sequenceIDLabel.setToolTipText(bagView.getPropertyMessage("sequenceID.description")); sequenceIDField = new JTextField("normal"); final GridBagLayout layout = new GridBagLayout(); final GridBagConstraints glbc = new GridBagConstraints(); final JPanel panel = new JPanel(layout); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); int row = 0; row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(urlLabel, glbc); panel.add(urlLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(urlField, glbc); panel.add(urlField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); layout.setConstraints(sequenceIDLabel, glbc); panel.add(sequenceIDLabel); buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); layout.setConstraints(sequenceIDField, glbc); panel.add(sequenceIDField); row++; buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST); buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); GuiStandardUtils.attachDialogBorder(contentPane); pageControl.add(panel); final JComponent buttonBar = createButtonBar(); pageControl.add(buttonBar, BorderLayout.SOUTH); this.pack(); return pageControl; }
From source file:tufts.vue.EditLibraryPanel.java
private void layoutConfig() { if (DEBUG.BOXES) { cui.setBorder(BorderFactory.createLineBorder(Color.green)); this.setBorder(BorderFactory.createLineBorder(Color.red)); }/* w w w . ja v a 2 s .c o m*/ final GridBagConstraints gbc = new GridBagConstraints(); final GridBagLayout gridbag = new GridBagLayout(); setLayout(gridbag); // Set up common GBC config: gbc.insets = (Insets) tufts.vue.gui.GUI.WidgetInsets.clone(); gbc.insets.bottom = 0; gbc.weightx = 1; gbc.weighty = 0; //------------------------------------------------------- // Add ConfigurationUI //------------------------------------------------------- gbc.anchor = GridBagConstraints.NORTH; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.gridy = 0; add(cui, gbc); //------------------------------------------------------- // Add Save button //------------------------------------------------------- gbc.gridwidth = 1; gbc.gridy = 1; gbc.ipadx = 15; // this actually makes the button wider gbc.anchor = GridBagConstraints.NORTHEAST; gbc.fill = GridBagConstraints.NONE; add(updateButton, gbc); //------------------------------------------------------- // Add a default vertical expander so above content // will float to top. //------------------------------------------------------- gbc.ipadx = 0; gbc.gridy = 2; gbc.weighty = 1; // this is the key for the expander to work (non-zero y-weight) gbc.fill = GridBagConstraints.BOTH; gbc.gridheight = GridBagConstraints.REMAINDER; gbc.gridwidth = 0; final JComponent fill; if (DEBUG.BOXES) { fill = new JLabel(VueResources.getString("jlabel.fill"), JLabel.CENTER); fill.setBackground(Color.gray); fill.setOpaque(true); } else { fill = new JPanel(); } add(fill, gbc); }