List of usage examples for java.awt GridBagConstraints WEST
int WEST
To view the source code for java.awt GridBagConstraints WEST.
Click Source Link
From source file:de.tor.tribes.ui.views.DSWorkbenchWatchtowerFrame.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from w ww. j av a 2 s. c om */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jXPanel1 = new org.jdesktop.swingx.JXPanel(); infoPanel = new org.jdesktop.swingx.JXCollapsiblePane(); jXLabel1 = new org.jdesktop.swingx.JXLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jWatchtowerPanel = new org.jdesktop.swingx.JXPanel(); jWatchtowerFrameAlwaysOnTop = new javax.swing.JCheckBox(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jXPanel1.setLayout(new java.awt.BorderLayout()); infoPanel.setCollapsed(true); infoPanel.setInheritAlpha(false); jXLabel1.setText("Keine Meldung"); jXLabel1.setOpaque(true); jXLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jXLabel1fireHideInfoEvent(evt); } }); infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER); jXPanel1.add(infoPanel, java.awt.BorderLayout.SOUTH); jWatchtowerTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane2.setViewportView(jWatchtowerTable); jXPanel1.add(jScrollPane2, java.awt.BorderLayout.CENTER); setTitle("Wachtrme"); getContentPane().setLayout(new java.awt.GridBagLayout()); jWatchtowerPanel.setBackground(new java.awt.Color(239, 235, 223)); jWatchtowerPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 500; gridBagConstraints.ipady = 300; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jWatchtowerPanel, gridBagConstraints); jWatchtowerFrameAlwaysOnTop.setText("Immer im Vordergrund"); jWatchtowerFrameAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fireWatchtowerFrameOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jWatchtowerFrameAlwaysOnTop, gridBagConstraints); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setPastable(false); capabilityInfoPanel1.setSearchable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); getAccessibleContext().setAccessibleName("Wachtrme"); pack(); }
From source file:org.jivesoftware.sparkimpl.updater.CheckUpdates.java
public void downloadUpdate(final File downloadedFile, final SparkVersion version) { final java.util.Timer timer = new java.util.Timer(); // Prepare HTTP post final GetMethod post = new GetMethod(version.getDownloadURL()); // Get HTTP client Protocol.registerProtocol("https", new Protocol("https", new EasySSLProtocolSocketFactory(), 443)); final HttpClient httpclient = new HttpClient(); String proxyHost = System.getProperty("http.proxyHost"); String proxyPort = System.getProperty("http.proxyPort"); if (ModelUtil.hasLength(proxyHost) && ModelUtil.hasLength(proxyPort)) { try {//from w ww. j a va 2 s .co m httpclient.getHostConfiguration().setProxy(proxyHost, Integer.parseInt(proxyPort)); } catch (NumberFormatException e) { Log.error(e); } } // Execute request try { int result = httpclient.executeMethod(post); if (result != 200) { return; } long length = post.getResponseContentLength(); int contentLength = (int) length; bar = new JProgressBar(0, contentLength); } catch (IOException e) { Log.error(e); } final JFrame frame = new JFrame(Res.getString("title.downloading.im.client")); frame.setIconImage(SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE).getImage()); titlePanel = new TitlePanel(Res.getString("title.upgrading.client"), Res.getString("message.version", version.getVersion()), SparkRes.getImageIcon(SparkRes.SEND_FILE_24x24), true); final Thread thread = new Thread(new Runnable() { public void run() { try { InputStream stream = post.getResponseBodyAsStream(); long size = post.getResponseContentLength(); ByteFormat formater = new ByteFormat(); sizeText = formater.format(size); titlePanel.setDescription(Res.getString("message.version", version.getVersion()) + " \n" + Res.getString("message.file.size", sizeText)); downloadedFile.getParentFile().mkdirs(); FileOutputStream out = new FileOutputStream(downloadedFile); copy(stream, out); out.close(); if (!cancel) { downloadComplete = true; promptForInstallation(downloadedFile, Res.getString("title.download.complete"), Res.getString("message.restart.spark")); } else { out.close(); downloadedFile.delete(); } UPDATING = false; frame.dispose(); } catch (Exception ex) { // Nothing to do } finally { timer.cancel(); // Release current connection to the connection pool once you are done post.releaseConnection(); } } }); frame.getContentPane().setLayout(new GridBagLayout()); frame.getContentPane().add(titlePanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); frame.getContentPane().add(bar, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); JEditorPane pane = new JEditorPane(); boolean displayContentPane = version.getChangeLogURL() != null || version.getDisplayMessage() != null; try { pane.setEditable(false); if (version.getChangeLogURL() != null) { pane.setEditorKit(new HTMLEditorKit()); pane.setPage(version.getChangeLogURL()); } else if (version.getDisplayMessage() != null) { pane.setText(version.getDisplayMessage()); } if (displayContentPane) { frame.getContentPane().add(new JScrollPane(pane), new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); } } catch (IOException e) { Log.error(e); } frame.getContentPane().setBackground(Color.WHITE); frame.pack(); if (displayContentPane) { frame.setSize(600, 400); } else { frame.setSize(400, 100); } frame.setLocationRelativeTo(SparkManager.getMainWindow()); GraphicUtils.centerWindowOnScreen(frame); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent windowEvent) { thread.interrupt(); cancel = true; UPDATING = false; if (!downloadComplete) { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), Res.getString("message.updating.cancelled"), Res.getString("title.cancelled"), JOptionPane.ERROR_MESSAGE); } } }); frame.setVisible(true); thread.start(); timer.scheduleAtFixedRate(new TimerTask() { int seconds = 1; public void run() { ByteFormat formatter = new ByteFormat(); long value = bar.getValue(); long average = value / seconds; String text = formatter.format(average) + "/Sec"; String total = formatter.format(value); titlePanel.setDescription(Res.getString("message.version", version.getVersion()) + " \n" + Res.getString("message.file.size", sizeText) + "\n" + Res.getString("message.transfer.rate") + ": " + text + "\n" + Res.getString("message.total.downloaded") + ": " + total); seconds++; } }, 1000, 1000); }
From source file:burp.BurpExtender.java
private void createTitle(String text, Container cont) { JLabel title = new JLabel(text); title.setForeground(new Color(229, 137, 0)); Font f = title.getFont();// www .j a v a2 s .c o m title.setFont(new Font(f.getName(), Font.BOLD, f.getSize() + 2)); callbacks.customizeUiComponent(title); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = 0; gbc.gridx = 0; gbc.insets = new Insets(8, 10, 0, 0); gbc.anchor = GridBagConstraints.WEST; cont.add(title, gbc); }
From source file:com.frostwire.gui.bittorrent.PartialFilesDialog.java
private void setupTextFilter() { GridBagConstraints c;/* w ww.ja v a2s. com*/ _filter = new LabeledTextField("Filter files", 30); _filter.setMinimumSize(_filter.getPreferredSize()); // fix odd behavior textBasedFilter = new RowFilterExtension(_filter, 2); _filter.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (_filter.getText() == null || _filter.getText().equals("")) { _table.setRowSorter(null); return; } _checkBoxToggleAll.setSelected(false); TableRowSorter<TorrentTableModel> sorter = new TableRowSorter<TorrentTableModel>(_model); sorter.setRowFilter(textBasedFilter); _table.setRowSorter(sorter); } }); c = new GridBagConstraints(); c.gridx = 0; c.gridy = 1; c.gridwidth = 2; c.gridheight = 1; c.anchor = GridBagConstraints.WEST; c.weightx = 1.0; c.insets = new Insets(5, 5, 5, 5); panel.add(_filter, c); }
From source file:edu.harvard.mcz.imagecapture.PositionTemplateEditor.java
/** * This method initializes jPanel /* w ww. j ava2 s .co m*/ * * @return javax.swing.JPanel */ private JPanel getJPanel() { if (jPanel == null) { GridBagConstraints gridBagConstraints24 = new GridBagConstraints(); gridBagConstraints24.fill = GridBagConstraints.BOTH; gridBagConstraints24.gridy = 10; gridBagConstraints24.weightx = 1.0; gridBagConstraints24.anchor = GridBagConstraints.WEST; gridBagConstraints24.gridx = 1; GridBagConstraints gridBagConstraints113 = new GridBagConstraints(); gridBagConstraints113.gridx = 0; gridBagConstraints113.anchor = GridBagConstraints.EAST; gridBagConstraints113.gridy = 10; jLabel9 = new JLabel(); jLabel9.setText("Taxon Name Barcode"); GridBagConstraints gridBagConstraints23 = new GridBagConstraints(); gridBagConstraints23.fill = GridBagConstraints.BOTH; gridBagConstraints23.gridy = 13; gridBagConstraints23.weightx = 1.0; gridBagConstraints23.anchor = GridBagConstraints.WEST; gridBagConstraints23.gridx = 1; GridBagConstraints gridBagConstraints112 = new GridBagConstraints(); gridBagConstraints112.gridx = 0; gridBagConstraints112.gridy = 13; GridBagConstraints gridBagConstraints22 = new GridBagConstraints(); gridBagConstraints22.fill = GridBagConstraints.BOTH; gridBagConstraints22.gridy = 12; gridBagConstraints22.weightx = 1.0; gridBagConstraints22.anchor = GridBagConstraints.WEST; gridBagConstraints22.gridx = 1; GridBagConstraints gridBagConstraints111 = new GridBagConstraints(); gridBagConstraints111.gridx = 0; gridBagConstraints111.gridy = 12; GridBagConstraints gridBagConstraints110 = new GridBagConstraints(); gridBagConstraints110.gridx = 1; gridBagConstraints110.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints110.gridwidth = 1; gridBagConstraints110.anchor = GridBagConstraints.NORTH; gridBagConstraints110.gridy = 14; jLabelFeedback = new JLabel(); jLabelFeedback.setText(" "); GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); gridBagConstraints21.fill = GridBagConstraints.BOTH; gridBagConstraints21.gridy = 0; gridBagConstraints21.weightx = 2.0; gridBagConstraints21.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints21.gridx = 1; GridBagConstraints gridBagConstraints13 = new GridBagConstraints(); gridBagConstraints13.gridx = 0; gridBagConstraints13.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints13.gridy = 0; jLabel8 = new JLabel(); jLabel8.setText("ImageFile"); GridBagConstraints gridBagConstraints18 = new GridBagConstraints(); gridBagConstraints18.fill = GridBagConstraints.BOTH; gridBagConstraints18.gridy = 9; gridBagConstraints18.weightx = 1.0; gridBagConstraints18.anchor = GridBagConstraints.WEST; gridBagConstraints18.gridx = 1; GridBagConstraints gridBagConstraints17 = new GridBagConstraints(); gridBagConstraints17.fill = GridBagConstraints.BOTH; gridBagConstraints17.gridy = 8; gridBagConstraints17.weightx = 1.0; gridBagConstraints17.anchor = GridBagConstraints.WEST; gridBagConstraints17.gridx = 1; GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); gridBagConstraints16.fill = GridBagConstraints.BOTH; gridBagConstraints16.gridy = 7; gridBagConstraints16.weightx = 1.0; gridBagConstraints16.anchor = GridBagConstraints.WEST; gridBagConstraints16.gridx = 1; GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); gridBagConstraints15.fill = GridBagConstraints.BOTH; gridBagConstraints15.gridy = 6; gridBagConstraints15.weightx = 1.0; gridBagConstraints15.anchor = GridBagConstraints.WEST; gridBagConstraints15.gridx = 1; GridBagConstraints gridBagConstraints14 = new GridBagConstraints(); gridBagConstraints14.fill = GridBagConstraints.BOTH; gridBagConstraints14.gridy = 5; gridBagConstraints14.weightx = 1.0; gridBagConstraints14.anchor = GridBagConstraints.WEST; gridBagConstraints14.gridx = 1; GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); gridBagConstraints12.fill = GridBagConstraints.BOTH; gridBagConstraints12.gridy = 3; gridBagConstraints12.weightx = 1.0; gridBagConstraints12.anchor = GridBagConstraints.WEST; gridBagConstraints12.gridx = 1; GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridx = 0; gridBagConstraints11.anchor = GridBagConstraints.EAST; gridBagConstraints11.gridy = 9; jLabel7 = new JLabel(); jLabel7.setText("Specimen"); jLabel7.setForeground(Color.ORANGE); GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); gridBagConstraints10.gridx = 0; gridBagConstraints10.anchor = GridBagConstraints.EAST; gridBagConstraints10.gridy = 8; jLabel6 = new JLabel(); jLabel6.setText("Tray Labels"); jLabel6.setForeground(Color.CYAN); GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.gridx = 0; gridBagConstraints9.anchor = GridBagConstraints.EAST; gridBagConstraints9.gridy = 7; jLabel5 = new JLabel(); jLabel5.setText("Pin Labels"); jLabel5.setForeground(Color.MAGENTA); GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); gridBagConstraints8.gridx = 0; gridBagConstraints8.anchor = GridBagConstraints.EAST; gridBagConstraints8.insets = new Insets(0, 3, 0, 0); gridBagConstraints8.gridy = 6; jLabel4 = new JLabel(); jLabel4.setText("Taxon Name Label"); jLabel4.setForeground(Color.BLUE); GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.gridx = 0; gridBagConstraints7.anchor = GridBagConstraints.EAST; gridBagConstraints7.gridy = 5; jLabel3 = new JLabel(); jLabel3.setText("Barcode"); jLabel3.setForeground(Color.RED); GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.gridx = 0; gridBagConstraints6.anchor = GridBagConstraints.EAST; gridBagConstraints6.gridy = 3; jLabel2 = new JLabel(); jLabel2.setText("Image Size"); GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.fill = GridBagConstraints.BOTH; gridBagConstraints5.gridy = 2; gridBagConstraints5.weightx = 1.0; gridBagConstraints5.anchor = GridBagConstraints.WEST; gridBagConstraints5.gridx = 1; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.fill = GridBagConstraints.BOTH; gridBagConstraints4.gridy = 1; gridBagConstraints4.weightx = 1.0; gridBagConstraints4.anchor = GridBagConstraints.WEST; gridBagConstraints4.gridx = 1; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 0; gridBagConstraints2.anchor = GridBagConstraints.EAST; gridBagConstraints2.gridy = 2; jLabel1 = new JLabel(); jLabel1.setText("Name"); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.anchor = GridBagConstraints.EAST; gridBagConstraints1.gridy = 1; jLabel = new JLabel(); jLabel.setText("Template ID"); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 11; jPanel = new JPanel(); jPanel.setLayout(new GridBagLayout()); jPanel.add(getJButtonSave(), gridBagConstraints); jPanel.add(jLabel, gridBagConstraints1); jPanel.add(jLabel1, gridBagConstraints2); jPanel.add(getJTextFieldTemplateId(), gridBagConstraints4); jPanel.add(getJTextFieldName(), gridBagConstraints5); jPanel.add(jLabel2, gridBagConstraints6); jPanel.add(jLabel3, gridBagConstraints7); jPanel.add(jLabel4, gridBagConstraints8); jPanel.add(jLabel5, gridBagConstraints9); jPanel.add(jLabel6, gridBagConstraints10); jPanel.add(jLabel7, gridBagConstraints11); jPanel.add(getJTextField2(), gridBagConstraints12); jPanel.add(getJTextField3(), gridBagConstraints14); jPanel.add(getJTextField4(), gridBagConstraints15); jPanel.add(getJTextField5(), gridBagConstraints16); jPanel.add(getJTextField6(), gridBagConstraints17); jPanel.add(getJTextField7(), gridBagConstraints18); jPanel.add(jLabel8, gridBagConstraints13); jPanel.add(getJTextField8(), gridBagConstraints21); jPanel.add(jLabelFeedback, gridBagConstraints110); jPanel.add(getJButton(), gridBagConstraints111); jPanel.add(getJTextFieldBarcodeScan(), gridBagConstraints22); jPanel.add(getJButton1(), gridBagConstraints112); jPanel.add(getJTextField(), gridBagConstraints23); jPanel.add(jLabel9, gridBagConstraints113); jPanel.add(getJTextField9(), gridBagConstraints24); } return jPanel; }
From source file:gdsc.utils.HSB_Picker.java
private void add(Component comp, int x, int width) { c.gridx = x;//w w w . j ava 2s .c o m c.gridy = row; c.gridwidth = width; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; mainGrid.setConstraints(comp, c); add(comp); }
From source file:com.sec.ose.osi.ui.frm.main.identification.patternmatch.JPanPatternMatchMain.java
/** * This method initializes jPanel /*from w w w . j ava2s.c om*/ * * @return javax.swing.JPanel */ public JPanel getJPanelBottom() { if (jPanelBottom == null) { GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); gridBagConstraints8.anchor = GridBagConstraints.NORTHWEST; gridBagConstraints8.insets = new Insets(10, 0, 0, 0); gridBagConstraints8.gridx = 1; gridBagConstraints8.gridy = 2; gridBagConstraints8.weightx = 1.0; gridBagConstraints8.weighty = 1.0; gridBagConstraints8.fill = GridBagConstraints.NONE; GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.anchor = GridBagConstraints.WEST; gridBagConstraints7.insets = new Insets(10, 0, 0, 0); gridBagConstraints7.gridx = 1; gridBagConstraints7.gridy = 1; gridBagConstraints7.weightx = 0.0; gridBagConstraints7.fill = GridBagConstraints.VERTICAL; GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.anchor = GridBagConstraints.WEST; gridBagConstraints6.insets = new Insets(10, 0, 0, 15); gridBagConstraints6.gridx = 1; gridBagConstraints6.gridy = 0; gridBagConstraints6.fill = GridBagConstraints.NONE; GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.anchor = GridBagConstraints.NORTHEAST; gridBagConstraints5.gridx = 0; gridBagConstraints5.gridy = 2; gridBagConstraints5.weightx = 0.0; gridBagConstraints5.weighty = 0.0; gridBagConstraints5.insets = new Insets(13, 0, 0, 5); GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.anchor = GridBagConstraints.EAST; gridBagConstraints4.gridx = 0; gridBagConstraints4.gridy = 1; gridBagConstraints4.insets = new Insets(10, 0, 0, 5); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.anchor = GridBagConstraints.EAST; gridBagConstraints1.gridx = -1; gridBagConstraints1.gridy = -1; gridBagConstraints1.insets = new Insets(10, 15, 0, 5); jPanelBottom = new JPanel(); jPanelBottom.setLayout(new GridBagLayout()); jPanelBottom.add(jLabelBinding, gridBagConstraints1); jPanelBottom.add(jLabelComponent, gridBagConstraints4); jPanelBottom.add(jLabelLicense, gridBagConstraints5); jPanelBottom.add(getJComboBoxBinding(), gridBagConstraints6); jPanelBottom.add(getJComboBoxComponentForOpt3(), gridBagConstraints7); jPanelBottom.add(getJComboBoxLicenseForOpt3(), gridBagConstraints8); } return jPanelBottom; }
From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.dialogs.RepositoryTreeDialog.java
/** * @noinspection ReuseOfLocalVariable/*www . java2 s . c o m*/ */ protected Component createContentPane() { final JScrollPane treeView = new JScrollPane(repositoryBrowser); final JPanel newFolderButtonPanel = new JPanel(new BorderLayout()); final JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); if (addNewButtonPanel) { final JButton newFolder = new JButton(new NewFolderAction()); newFolder.setBorder(BorderFactory.createEmptyBorder()); final JLabel label = new JLabel( Messages.getInstance().getString("SolutionRepositoryTreeDialog.SelectLocation")); label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 80)); newFolderButtonPanel.add(label, BorderLayout.CENTER); newFolderButtonPanel.add(newFolder, BorderLayout.EAST); c.insets = new Insets(2, 10, 0, 10); c.anchor = GridBagConstraints.WEST; c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.HORIZONTAL; panel.add(newFolderButtonPanel, c); } c = new GridBagConstraints(); c.insets = new Insets(0, 10, 5, 10); c.gridx = 0; c.gridy = 1; c.fill = GridBagConstraints.BOTH; c.weightx = 1.0; c.weighty = 1.0; panel.add(treeView, c); c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; c.insets = new Insets(0, 10, 5, 10); c.gridx = 0; c.gridy = 2; c.fill = GridBagConstraints.HORIZONTAL; panel.add(new JCheckBox(new ShowHiddenFilesAction())); return panel; }
From source file:gov.loc.repository.bagger.ui.NewBagInPlaceFrame.java
private void layoutAddKeepFilesToEmptyCheckBox(JPanel contentPane, int row) { // Delete Empty Folder(s) JLabel addKeepFilesToEmptyFoldersCheckBoxLabel = new JLabel( bagView.getPropertyMessage("bag.label.addkeepfilestoemptyfolders")); addKeepFilesToEmptyFoldersCheckBoxLabel .setToolTipText(bagView.getPropertyMessage("bag.addkeepfilestoemptyfolders.help")); addKeepFilesToEmptyFoldersCheckBox = new JCheckBox(bagView.getPropertyMessage("")); addKeepFilesToEmptyFoldersCheckBox.setSelected(bag.isAddKeepFilesToEmptyFolders()); addKeepFilesToEmptyFoldersCheckBox.addActionListener(new AddKeepFilesToEmptyFoldersHandler()); GridBagConstraints glbc = new GridBagConstraints(); JLabel spacerLabel = new JLabel(); glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); contentPane.add(addKeepFilesToEmptyFoldersCheckBoxLabel, glbc); glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); contentPane.add(addKeepFilesToEmptyFoldersCheckBox, glbc); glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); contentPane.add(spacerLabel, glbc);// w ww.j a v a 2 s .c o m }
From source file:be.agiv.security.demo.Main.java
private void secConvIssueToken() { GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints gridBagConstraints = new GridBagConstraints(); JPanel contentPanel = new JPanel(gridBagLayout); JLabel urlLabel = new JLabel("URL:"); gridBagConstraints.gridx = 0;/*from ww w . jav a 2s. c om*/ gridBagConstraints.gridy = 0; gridBagConstraints.anchor = GridBagConstraints.WEST; gridBagConstraints.ipadx = 5; gridBagLayout.setConstraints(urlLabel, gridBagConstraints); contentPanel.add(urlLabel); JTextField urlTextField = new JTextField(ClaimsAwareServiceFactory.SERVICE_SC_LOCATION, 60); gridBagConstraints.gridx++; gridBagLayout.setConstraints(urlTextField, gridBagConstraints); contentPanel.add(urlTextField); JLabel warningLabel = new JLabel( "This operation can fail if the web service does not support WS-SecurityConversation."); gridBagConstraints.gridx = 0; gridBagConstraints.gridy++; gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER; gridBagLayout.setConstraints(warningLabel, gridBagConstraints); contentPanel.add(warningLabel); int result = JOptionPane.showConfirmDialog(this, contentPanel, "Secure Conversation Issue Token", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.CANCEL_OPTION) { return; } String location = urlTextField.getText(); SecureConversationClient secConvClient = new SecureConversationClient(location); try { this.secConvSecurityToken = secConvClient.getSecureConversationToken(this.rStsSecurityToken); this.secConvViewMenuItem.setEnabled(true); this.secConvCancelMenuItem.setEnabled(true); secConvViewToken(); } catch (Exception e) { showException(e); } }