List of usage examples for java.awt GridBagLayout GridBagLayout
public GridBagLayout()
From source file:org.gvsig.remotesensing.profiles.gui.LineProfileOptionsPanel.java
/** * @return panel con los controles para agregar o eliminar perfiles y combo * para seleccin de banda//from w w w. j a v a 2s .c o m * */ public JPanel getControlPanel() { if (controlPanel == null) { controlPanel = new JPanel(); GridBagLayout gb = new GridBagLayout(); controlPanel.setLayout(gb); GridBagConstraints constrains = new GridBagConstraints(); constrains.insets = new java.awt.Insets(1, 5, 1, 1); constrains.gridx = 0; constrains.gridy = 0; controlPanel.add(getNewButton(), constrains); constrains.insets = new java.awt.Insets(1, 5, 1, 1); constrains.gridx = 0; constrains.gridy = 1; controlPanel.add(getDeleteButton(), constrains); constrains.insets = new java.awt.Insets(1, 5, 1, 1); constrains.gridx = 0; constrains.gridy = 2; controlPanel.add(getComboBands(), constrains); } return controlPanel; }
From source file:com.apatar.ui.JPublishToApatarDialog.java
private void createDialog() { GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); this.setLayout(gridbag); c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1.0;//from w w w .jav a2s. c o m c.weighty = 0.0; c.fill = GridBagConstraints.HORIZONTAL; //c.insets = new Insets(5, 5, 5, 5); JPanel panelLogin = new JPanel(); panelLogin.setBorder(new EmptyBorder(10, 10, 0, 10)); panelLogin.setLayout(new BoxLayout(panelLogin, BoxLayout.X_AXIS)); panelLogin.add(new JLabel("User Name")); panelLogin.add(Box.createHorizontalStrut(5)); panelLogin.add(username); username.setComponentPopupMenu(new JDefaultContextMenu(username)); panelLogin.add(Box.createHorizontalStrut(5)); panelLogin.add(new JLabel("Password")); panelLogin.add(Box.createHorizontalStrut(5)); panelLogin.add(password); JPanel panelForgotPassLink = new JPanel(); panelForgotPassLink.setBorder(new EmptyBorder(10, 10, 0, 10)); panelForgotPassLink.setLayout(new BoxLayout(panelForgotPassLink, BoxLayout.X_AXIS)); panelForgotPassLink.add(new JLabel("Lost your password? ")); panelForgotPassLink.add(Box.createHorizontalStrut(5)); panelForgotPassLink.add(forgotPassLinkLabel); forgotPassLinkLabel.setFont(UiUtils.NORMAL_SIZE_12_FONT); forgotPassLinkLabel.addMouseListener(new MouseHyperLinkEvent()); forgotPassLinkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); forgotPassLinkLabel.setText( "<html><a href='http://www.apatarforge.org/profile/lostpassword.html'>Click here to retrieve it</a></html>"); JPanel panelFile = new JPanel(); panelFile.setBorder(new EmptyBorder(10, 10, 0, 10)); panelFile.setLayout(new BoxLayout(panelFile, BoxLayout.X_AXIS)); panelFile.add(selectFromFile); panelFile.add(Box.createHorizontalStrut(5)); panelFile.add(new JLabel("New File ")); panelFile.add(Box.createHorizontalStrut(5)); panelFile.add(nameFile); panelFile.add(Box.createHorizontalStrut(5)); panelFile.add(browse); nameFile.setEnabled(false); nameFile.setComponentPopupMenu(new JDefaultContextMenu(nameFile)); browse.setEnabled(false); JPanel panelLocation = new JPanel(); panelLocation.setBorder(new EmptyBorder(10, 10, 0, 10)); panelLocation.setLayout(new BoxLayout(panelLocation, BoxLayout.X_AXIS)); panelLocation.add(new JLabel("Suggest Location:")); panelLocation.add(Box.createHorizontalStrut(5)); panelLocation.add(location); JPanel panelDMName = new JPanel(); panelDMName.setBorder(new EmptyBorder(10, 10, 0, 10)); panelDMName.setLayout(new BoxLayout(panelDMName, BoxLayout.X_AXIS)); JLabel datamapNameLabel = new JLabel("DataMap Name:"); datamapNameLabel.setBorder(new EmptyBorder(0, 0, 0, 10)); panelDMName.add(datamapNameLabel); panelDMName.add(Box.createHorizontalStrut(5)); panelDMName.add(dataMapName); dataMapName.setComponentPopupMenu(new JDefaultContextMenu(dataMapName)); JPanel panelDMDescription = new JPanel(); panelDMDescription.setBorder(new EmptyBorder(10, 10, 0, 10)); panelDMDescription.setLayout(new BoxLayout(panelDMDescription, BoxLayout.X_AXIS)); panelDMDescription.add(new JLabel("DataMap Description (16000 Chars)")); panelDMDescription.add(Box.createHorizontalStrut(5)); //JScrollPane scroll = new JScrollPane(dataMapDescription); //scroll.setSize(300, 50); dataMapDescription.setLineWrap(true); dataMapDescription.setWrapStyleWord(true); panelDMDescription.add(new JScrollPane(dataMapDescription)); JPanel panelDMShortDescription = new JPanel(); panelDMShortDescription.setBorder(new EmptyBorder(10, 10, 0, 10)); panelDMShortDescription.setLayout(new BoxLayout(panelDMShortDescription, BoxLayout.X_AXIS)); JLabel labelShort = new JLabel("Short Description:"); labelShort.setBorder(new EmptyBorder(0, 0, 0, 85)); panelDMShortDescription.add(labelShort); panelDMShortDescription.add(Box.createHorizontalStrut(5)); shortDescription.setLineWrap(true); shortDescription.setWrapStyleWord(true); panelDMShortDescription.add(new JScrollPane(shortDescription)); setEnableShortDescription(false); // ------------- JPanel panelTitleForTags = new JPanel(); panelTitleForTags.setBorder(new EmptyBorder(10, 10, 0, 10)); panelTitleForTags.setLayout(new BoxLayout(panelTitleForTags, BoxLayout.X_AXIS)); panelTitleForTags.add(new JLabel("Add tags associated with your DataMap:")); // ------------- JPanel panelListAddedTags = new JPanel(); panelListAddedTags.setBorder(new EmptyBorder(0, 10, 10, 10)); panelListAddedTags.setLayout(new BoxLayout(panelListAddedTags, BoxLayout.X_AXIS)); // -- JPanel panelFrom = new JPanel(); panelFrom.setLayout(new BoxLayout(panelFrom, BoxLayout.Y_AXIS)); JPanel panelMiddle = new JPanel(); panelMiddle.setLayout(new BoxLayout(panelMiddle, BoxLayout.X_AXIS)); JPanel panelTo = new JPanel(); panelTo.setLayout(new BoxLayout(panelTo, BoxLayout.Y_AXIS)); // -- JPanel panelAddNewTag = new JPanel(); panelAddNewTag.setLayout(new BoxLayout(panelAddNewTag, BoxLayout.X_AXIS)); panelAddNewTag.add(new JLabel("Add new tag:")); panelAddNewTag.add(Box.createHorizontalStrut(5)); textfieldAddNewTag = new JTextField(); textfieldAddNewTag.setComponentPopupMenu(new JDefaultContextMenu(textfieldAddNewTag)); panelAddNewTag.add(textfieldAddNewTag); panelAddNewTag.add(Box.createHorizontalStrut(5)); JButton buttonAddTag = new JButton("Add"); buttonAddTag.addActionListener(addNewTagMouseListener); panelAddNewTag.add(buttonAddTag); // -- JPanel panelDeleteTags = new JPanel(); panelDeleteTags.setLayout(new BoxLayout(panelDeleteTags, BoxLayout.X_AXIS)); panelDeleteTags.add(new JLabel("Delete selected tag(s):")); panelDeleteTags.add(Box.createHorizontalStrut(5)); JButton buttonDeleteTag = new JButton("Delete"); buttonDeleteTag.addActionListener(deleteTagMouseListener); panelDeleteTags.add(buttonDeleteTag); panelDeleteTags.add(new JPanel()); // -- JButton moveTag = new JButton(UiUtils.ARROW_ICON); moveTag.addActionListener(addTagsMouseListener); panelMiddle.add(moveTag); tblModelFrom = new DefaultTableModel(); tblModelTo = new DefaultTableModel(); tblModelFrom.addColumn("Tag Name"); tblModelTo.addColumn("Tag Name"); tagsTableFrom = new JTable(tblModelFrom); tagsTableTo = new JTable(tblModelTo); tagsTableFrom.setOpaque(false); tagsTableFrom.setBackground(null); tagsTableFrom.setBorder(null); tagsTableFrom.setShowGrid(false); tagsTableTo.setOpaque(false); tagsTableTo.setBackground(null); tagsTableTo.setBorder(null); tagsTableTo.setShowGrid(false); tagsTableFrom.getColumn("Tag Name").setCellEditor(new CellEditor(new JTextField())); tagsTableTo.getColumn("Tag Name").setCellEditor(new CellEditor(new JTextField())); fillTableTags(); tagsTableFrom.setComponentPopupMenu(new JDefaultContextMenu(tagsTableFrom)); tagsTableTo.setComponentPopupMenu(new JDefaultContextMenu(tagsTableTo)); JScrollPane srollPane = new JScrollPane(tagsTableFrom); srollPane.setBorder(null); JScrollPane srollPane2 = new JScrollPane(tagsTableTo); srollPane.setBorder(null); panelFrom.add(srollPane); panelFrom.add(Box.createVerticalStrut(5)); panelFrom.add(panelAddNewTag); panelTo.add(srollPane2); panelTo.add(Box.createVerticalStrut(5)); panelTo.add(panelDeleteTags); panelListAddedTags.add(panelFrom); panelListAddedTags.add(Box.createHorizontalStrut(5)); panelListAddedTags.add(panelMiddle); panelListAddedTags.add(Box.createHorizontalStrut(5)); panelListAddedTags.add(panelTo); // ------- JPanel panelButton = new JPanel(); panelButton.setLayout(new BoxLayout(panelButton, BoxLayout.X_AXIS)); panelButton.add(Box.createHorizontalGlue()); panelButton.add(bOk); panelButton.add(Box.createHorizontalStrut(5)); panelButton.add(bCancel); panelButton.add(Box.createHorizontalStrut(5)); ComponentBuilder.makeComponent(new JCommentPanel(), gridbag, c, getContentPane()); ComponentBuilder.makeComponent(panelLogin, gridbag, c, getContentPane()); ComponentBuilder.makeComponent(panelForgotPassLink, gridbag, c, getContentPane()); ComponentBuilder.makeComponent(panelFile, gridbag, c, getContentPane()); ComponentBuilder.makeComponent(panelLocation, gridbag, c, getContentPane()); ComponentBuilder.makeComponent(panelDMName, gridbag, c, getContentPane()); c.fill = GridBagConstraints.BOTH; c.weighty = 2.0; ComponentBuilder.makeComponent(panelDMDescription, gridbag, c, getContentPane()); c.weighty = 0.0; ComponentBuilder.makeComponent(autoGenerateShortDescription, gridbag, c, getContentPane()); c.weighty = 1.0; ComponentBuilder.makeComponent(panelDMShortDescription, gridbag, c, getContentPane()); c.weighty = 1.0; ComponentBuilder.makeComponent(panelTitleForTags, gridbag, c, getContentPane()); c.weighty = 3.0; ComponentBuilder.makeComponent(panelListAddedTags, gridbag, c, getContentPane()); c.weighty = 0.0; ComponentBuilder.makeComponent(new JSeparator(), gridbag, c, getContentPane()); c.weighty = 1.0; ComponentBuilder.makeComponent(panelButton, gridbag, c, getContentPane()); }
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();/*from w w w. j a v a 2 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:com.sec.ose.osi.ui.frm.main.report.JPanExportReport.java
private JPanel getJPanelDocumentExportInfo() { if (jPanelDocumentExportInfo == null) { jPanelDocumentExportInfo = new JPanel(); jPanelDocumentExportInfo.setLayout(new GridBagLayout()); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridx = 0;//from w w w . j a v a 2 s .c om gridBagConstraints1.gridy = 0; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.insets = new Insets(0, 5, 0, 5); jPanelDocumentExportInfo.add(getJTextFieldReportLocation(), gridBagConstraints1); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 1; gridBagConstraints2.gridy = 0; jPanelDocumentExportInfo.add(getJButtonCreateExplorer(), gridBagConstraints2); } return jPanelDocumentExportInfo; }
From source file:edu.harvard.mcz.imagecapture.ChangePasswordDialog.java
/** * This method initializes jContentPane/* w w w .j a va 2 s.co m*/ * * @return javax.swing.JPanel */ private JPanel getJContentPane() { if (jContentPane == null) { GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); gridBagConstraints10.gridx = 0; gridBagConstraints10.weightx = 0.0; gridBagConstraints10.weighty = 1.0; gridBagConstraints10.gridy = 6; GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); gridBagConstraints9.gridx = 0; gridBagConstraints9.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints9.gridwidth = 2; gridBagConstraints9.gridy = 4; jLabelResponse = new JLabel(); jLabelResponse.setText(""); GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); gridBagConstraints8.fill = GridBagConstraints.BOTH; gridBagConstraints8.gridy = 3; gridBagConstraints8.weightx = 1.0; gridBagConstraints8.anchor = GridBagConstraints.WEST; gridBagConstraints8.gridx = 1; GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); gridBagConstraints7.fill = GridBagConstraints.BOTH; gridBagConstraints7.gridy = 2; gridBagConstraints7.weightx = 1.0; gridBagConstraints7.anchor = GridBagConstraints.WEST; gridBagConstraints7.gridx = 1; GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.fill = GridBagConstraints.BOTH; gridBagConstraints6.gridy = 1; gridBagConstraints6.weightx = 1.0; gridBagConstraints6.anchor = GridBagConstraints.WEST; gridBagConstraints6.gridx = 1; GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.gridx = 0; gridBagConstraints5.anchor = GridBagConstraints.EAST; gridBagConstraints5.gridy = 5; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.gridx = 1; gridBagConstraints4.anchor = GridBagConstraints.CENTER; gridBagConstraints4.gridy = 5; GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.gridx = 0; gridBagConstraints3.anchor = GridBagConstraints.EAST; gridBagConstraints3.gridy = 3; jLabel3 = new JLabel(); jLabel3.setText("New Password Again"); GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.gridx = 0; gridBagConstraints2.anchor = GridBagConstraints.EAST; gridBagConstraints2.gridy = 2; jLabel2 = new JLabel(); jLabel2.setText("New Password"); GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); gridBagConstraints11.gridx = 0; gridBagConstraints11.anchor = GridBagConstraints.EAST; gridBagConstraints11.gridy = 1; jLabel1 = new JLabel(); jLabel1.setText("Old Password"); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.BOTH; gridBagConstraints1.gridy = 0; gridBagConstraints1.weightx = 1.0; gridBagConstraints1.anchor = GridBagConstraints.WEST; gridBagConstraints1.gridx = 1; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.anchor = GridBagConstraints.EAST; gridBagConstraints.gridy = 0; jLabel = new JLabel(); jLabel.setText("Change Password For:"); jContentPane = new JPanel(); jContentPane.setLayout(new GridBagLayout()); jContentPane.add(jLabel, gridBagConstraints); jContentPane.add(getJTextField(), gridBagConstraints1); jContentPane.add(jLabel1, gridBagConstraints11); jContentPane.add(jLabel2, gridBagConstraints2); jContentPane.add(jLabel3, gridBagConstraints3); jContentPane.add(getJButton(), gridBagConstraints4); jContentPane.add(getJButton1(), gridBagConstraints5); jContentPane.add(getJPasswordFieldOld(), gridBagConstraints6); jContentPane.add(getJPasswordField1(), gridBagConstraints7); jContentPane.add(getJPasswordField2(), gridBagConstraints8); jContentPane.add(jLabelResponse, gridBagConstraints9); jContentPane.add(getJPanel(), gridBagConstraints10); } return jContentPane; }
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectAdd.java
/** * This method initializes jPanelPjtList * //ww w. j a va 2 s . c o m * @return javax.swing.JPanel */ private JPanel getJPanelPjtList() { if (jPanelPjtList == null) { GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.gridy = 1; gridBagConstraints3.fill = GridBagConstraints.BOTH; gridBagConstraints3.gridwidth = 2; gridBagConstraints3.weighty = 0.1; gridBagConstraints3.insets = new Insets(0, 10, 10, 10); gridBagConstraints3.ipadx = 0; gridBagConstraints3.weightx = 0.1; gridBagConstraints3.gridx = 0; GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); gridBagConstraints2.insets = new Insets(10, 10, 10, 0); GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints1.gridy = 0; gridBagConstraints1.weightx = 0.1; gridBagConstraints1.insets = new Insets(10, 10, 10, 10); gridBagConstraints1.ipadx = 0; gridBagConstraints1.ipady = 0; gridBagConstraints1.gridx = 1; jLabelFilter = new JLabel(); jLabelFilter.setText("Filter :"); jPanelPjtList = new JPanel(); jPanelPjtList.setLayout(new GridBagLayout()); jPanelPjtList.setBorder(BorderFactory.createTitledBorder(null, "Project List", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51))); jPanelPjtList.add(jLabelFilter, gridBagConstraints2); jPanelPjtList.add(getJTextFieldFilter(), gridBagConstraints1); jPanelPjtList.add(getJScrollPanePjtList(), gridBagConstraints3); } return jPanelPjtList; }
From source file:au.org.ala.delta.intkey.ui.FindInTaxaDialog.java
public FindInTaxaDialog(Intkey intkeyApp) { super(intkeyApp.getMainFrame(), false); setResizable(false);/* ww w . ja va 2 s .co m*/ ResourceMap resourceMap = Application.getInstance().getContext().getResourceMap(FindInTaxaDialog.class); resourceMap.injectFields(this); ActionMap actionMap = Application.getInstance().getContext().getActionMap(this); _intkeyApp = intkeyApp; _numMatchedTaxa = 0; _currentMatchedTaxon = -1; _findAction = actionMap.get("findTaxa"); _nextAction = actionMap.get("nextFoundTaxon"); this.setTitle(windowTitle); getContentPane().setLayout(new BorderLayout(0, 0)); _pnlMain = new JPanel(); _pnlMain.setBorder(new EmptyBorder(20, 20, 20, 20)); getContentPane().add(_pnlMain, BorderLayout.CENTER); _pnlMain.setLayout(new BorderLayout(0, 0)); _pnlMainTop = new JPanel(); _pnlMain.add(_pnlMainTop, BorderLayout.NORTH); _pnlMainTop.setLayout(new BoxLayout(_pnlMainTop, BoxLayout.Y_AXIS)); _lblEnterSearchString = new JLabel(enterSearchStringCaption); _lblEnterSearchString.setBorder(new EmptyBorder(0, 0, 5, 0)); _lblEnterSearchString.setHorizontalAlignment(SwingConstants.LEFT); _lblEnterSearchString.setVerticalAlignment(SwingConstants.TOP); _lblEnterSearchString.setAlignmentY(Component.TOP_ALIGNMENT); _pnlMainTop.add(_lblEnterSearchString); _textField = new JTextField(); _textField.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { reset(); } @Override public void insertUpdate(DocumentEvent e) { reset(); } @Override public void changedUpdate(DocumentEvent e) { reset(); } }); _pnlMainTop.add(_textField); _textField.setColumns(10); _pnlMainMiddle = new JPanel(); _pnlMainMiddle.setBorder(new EmptyBorder(10, 0, 0, 0)); _pnlMain.add(_pnlMainMiddle, BorderLayout.CENTER); _pnlMainMiddle.setLayout(new BoxLayout(_pnlMainMiddle, BoxLayout.Y_AXIS)); _rdbtnSelectOne = new JRadioButton(selectOneCaption); _rdbtnSelectOne.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainMiddle.add(_rdbtnSelectOne); _rdbtnSelectAll = new JRadioButton(selectAllCaption); _rdbtnSelectAll.setSelected(true); _rdbtnSelectAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainMiddle.add(_rdbtnSelectAll); ButtonGroup radioButtonGroup = new ButtonGroup(); radioButtonGroup.add(_rdbtnSelectOne); radioButtonGroup.add(_rdbtnSelectAll); _pnlMainBottom = new JPanel(); _pnlMain.add(_pnlMainBottom, BorderLayout.SOUTH); _pnlMainBottom.setLayout(new BoxLayout(_pnlMainBottom, BoxLayout.Y_AXIS)); _chckbxSearchSynonyms = new JCheckBox(searchSynonymsCaption); _chckbxSearchSynonyms.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainBottom.add(_chckbxSearchSynonyms); _chckbxSearchEliminatedTaxa = new JCheckBox(searchEliminatedTaxaCaption); _chckbxSearchEliminatedTaxa.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainBottom.add(_chckbxSearchEliminatedTaxa); _pnlButtons = new JPanel(); _pnlButtons.setBorder(new EmptyBorder(20, 0, 0, 10)); getContentPane().add(_pnlButtons, BorderLayout.EAST); _pnlButtons.setLayout(new BorderLayout(0, 0)); _pnlInnerButtons = new JPanel(); _pnlButtons.add(_pnlInnerButtons, BorderLayout.NORTH); GridBagLayout gbl_pnlInnerButtons = new GridBagLayout(); gbl_pnlInnerButtons.columnWidths = new int[] { 0, 0 }; gbl_pnlInnerButtons.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_pnlInnerButtons.columnWeights = new double[] { 0.0, Double.MIN_VALUE }; gbl_pnlInnerButtons.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; _pnlInnerButtons.setLayout(gbl_pnlInnerButtons); _btnFindNext = new JButton(); _btnFindNext.setAction(_findAction); GridBagConstraints gbc_btnFind = new GridBagConstraints(); gbc_btnFind.fill = GridBagConstraints.HORIZONTAL; gbc_btnFind.insets = new Insets(0, 0, 5, 0); gbc_btnFind.gridx = 0; gbc_btnFind.gridy = 0; _pnlInnerButtons.add(_btnFindNext, gbc_btnFind); _btnPrevious = new JButton(); _btnPrevious.setAction(actionMap.get("previousFoundTaxon")); _btnPrevious.setEnabled(false); GridBagConstraints gbc_btnPrevious = new GridBagConstraints(); gbc_btnPrevious.insets = new Insets(0, 0, 5, 0); gbc_btnPrevious.gridx = 0; gbc_btnPrevious.gridy = 1; _pnlInnerButtons.add(_btnPrevious, gbc_btnPrevious); _btnDone = new JButton(); _btnDone.setAction(actionMap.get("findTaxaDone")); GridBagConstraints gbc_btnDone = new GridBagConstraints(); gbc_btnDone.fill = GridBagConstraints.HORIZONTAL; gbc_btnDone.gridx = 0; gbc_btnDone.gridy = 2; _pnlInnerButtons.add(_btnDone, gbc_btnDone); this.pack(); this.setLocationRelativeTo(_intkeyApp.getMainFrame()); }
From source file:com.vgi.mafscaling.Rescale.java
private void createControlPanel(JPanel dataPanel) { JPanel cntlPanel = new JPanel(); GridBagConstraints gbl_ctrlPanel = new GridBagConstraints(); gbl_ctrlPanel.insets = insets3;//ww w . ja va 2 s. c om gbl_ctrlPanel.anchor = GridBagConstraints.PAGE_START; gbl_ctrlPanel.fill = GridBagConstraints.HORIZONTAL; gbl_ctrlPanel.weightx = 1.0; gbl_ctrlPanel.gridx = 0; gbl_ctrlPanel.gridy = 0; dataPanel.add(cntlPanel, gbl_ctrlPanel); GridBagLayout gbl_cntlPanel = new GridBagLayout(); gbl_cntlPanel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_cntlPanel.rowHeights = new int[] { 0, 0 }; gbl_cntlPanel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; gbl_cntlPanel.rowWeights = new double[] { 0 }; cntlPanel.setLayout(gbl_cntlPanel); NumberFormat doubleFmt = NumberFormat.getNumberInstance(); doubleFmt.setGroupingUsed(false); doubleFmt.setMaximumIntegerDigits(1); doubleFmt.setMinimumIntegerDigits(1); doubleFmt.setMaximumFractionDigits(3); doubleFmt.setMinimumFractionDigits(1); doubleFmt.setRoundingMode(RoundingMode.HALF_UP); NumberFormat scaleDoubleFmt = NumberFormat.getNumberInstance(); scaleDoubleFmt.setGroupingUsed(false); scaleDoubleFmt.setMaximumIntegerDigits(1); scaleDoubleFmt.setMinimumIntegerDigits(1); scaleDoubleFmt.setMaximumFractionDigits(8); scaleDoubleFmt.setMinimumFractionDigits(1); scaleDoubleFmt.setRoundingMode(RoundingMode.HALF_UP); GridBagConstraints gbc_cntlPanelLabel = new GridBagConstraints(); gbc_cntlPanelLabel.anchor = GridBagConstraints.EAST; gbc_cntlPanelLabel.insets = new Insets(2, 3, 2, 1); gbc_cntlPanelLabel.gridx = 0; gbc_cntlPanelLabel.gridy = 0; GridBagConstraints gbc_cntlPanelInput = new GridBagConstraints(); gbc_cntlPanelInput.anchor = GridBagConstraints.WEST; gbc_cntlPanelInput.insets = new Insets(2, 1, 2, 3); gbc_cntlPanelInput.gridx = 1; gbc_cntlPanelInput.gridy = 0; cntlPanel.add(new JLabel("New Max V"), gbc_cntlPanelLabel); newMaxVFmtTextBox = new JFormattedTextField(doubleFmt); newMaxVFmtTextBox.setColumns(7); newMaxVFmtTextBox.addPropertyChangeListener("value", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Object source = e.getSource(); if (source == newMaxVFmtTextBox) updateNewMafScale(); } }); cntlPanel.add(newMaxVFmtTextBox, gbc_cntlPanelInput); gbc_cntlPanelLabel.gridx += 2; cntlPanel.add(new JLabel("Min V"), gbc_cntlPanelLabel); minVFmtTextBox = new JFormattedTextField(doubleFmt); minVFmtTextBox.setColumns(7); minVFmtTextBox.addPropertyChangeListener("value", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Object source = e.getSource(); if (source == minVFmtTextBox) updateNewMafScale(); } }); gbc_cntlPanelInput.gridx += 2; cntlPanel.add(minVFmtTextBox, gbc_cntlPanelInput); gbc_cntlPanelLabel.gridx += 2; cntlPanel.add(new JLabel("Max Unchanged"), gbc_cntlPanelLabel); maxVUnchangedFmtTextBox = new JFormattedTextField(doubleFmt); maxVUnchangedFmtTextBox.setColumns(7); maxVUnchangedFmtTextBox.addPropertyChangeListener("value", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Object source = e.getSource(); if (source == maxVUnchangedFmtTextBox) updateNewMafScale(); } }); gbc_cntlPanelInput.gridx += 2; cntlPanel.add(maxVUnchangedFmtTextBox, gbc_cntlPanelInput); gbc_cntlPanelLabel.gridx += 2; cntlPanel.add(new JLabel("Mode deltaV"), gbc_cntlPanelLabel); modeDeltaVFmtTextBox = new JFormattedTextField(scaleDoubleFmt); modeDeltaVFmtTextBox.setColumns(7); modeDeltaVFmtTextBox.setEditable(false); modeDeltaVFmtTextBox.setBackground(new Color(210, 210, 210)); gbc_cntlPanelInput.gridx += 2; cntlPanel.add(modeDeltaVFmtTextBox, gbc_cntlPanelInput); }
From source file:com.xtructure.xevolution.gui.XEvolutionGui.java
/** * Creates a new {@link XEvolutionGui}.//from w w w. j a v a 2 s . c om * * @param title * the base string for the title of the gui * @param visualizeData * the visualize data * @param dataTracker * the data tracker */ public XEvolutionGui(String title, VisualizeData visualizeData, DataTracker<?, ?> dataTracker) { this.title = title; frame = new JFrame(title); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); populationFiles = new ArrayList<File>(); menuBar = new MenuBar(this, frame, title); frame.setJMenuBar(menuBar); tabbedPane = new JTabbedPane(); tabbedPane.setPreferredSize(new Dimension(600, 400)); frame.getContentPane().add(tabbedPane); statusBar = new StatusBar(); frame.add(statusBar, BorderLayout.PAGE_END); graphPanel = new JPanel(); graphPanel.setLayout(new GridLayout(0, 1)); bufferSize = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth(); bufferCount = 3; // max,avg,min graphsMap = new HashMap<XValId<?>, Graph>(); tabbedPane.addTab("Graphs", graphPanel); generationsPanel = new JPanel(); generationsPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 0.5; c.weighty = 0.5; populationPanel = new PopulationPanel(popLock); genomePanel = new GenomePanel(); genomePanel.addSortByAttributeId(Genome.FITNESS_ATTRIBUTE_ID); genomePanel.addSortByAttributeId(Genome.COMPLEXITY_ATTRIBUTE_ID); genomePanel.getSortComboBox().setSelectedItem(Genome.FITNESS_ATTRIBUTE_ID); c.gridx = 0; c.gridy = 0; generationsPanel.add(populationPanel, c); c.gridx = 1; c.gridy = 0; generationsPanel.add(genomePanel, c); tabbedPane.addTab("Generations", generationsPanel); genealogyPanel = new GenealogyPanel(dataTracker); tabbedPane.addTab("Genealogy", genealogyPanel); addGraph(Genome.FITNESS_ATTRIBUTE_ID); addGraph(Genome.COMPLEXITY_ATTRIBUTE_ID); this.dataTracker = dataTracker; new GuiListener(populationPanel, genomePanel, genealogyPanel, visualizeData, dataTracker); frame.setResizable(true); frame.pack(); frame.setVisible(true); catchUp(); }
From source file:edu.harvard.mcz.imagecapture.VerbatimCaptureDialog.java
protected void init() { setDefaultCloseOperation(DISPOSE_ON_CLOSE); setTitle("Transcribe Verbatim Data"); setMinimumSize(new Dimension(1020, 640)); setBounds(100, 100, 1020, 640);//from w w w . j av a2 s. co m getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new BorderLayout(0, 0)); { JPanel panel = new JPanel(); contentPanel.add(panel, BorderLayout.NORTH); panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); JLabel lblVerbatimDataFor = new JLabel("Verbatim Data for:"); panel.add(lblVerbatimDataFor); lblBarcode = new JLabel("Barcode"); panel.add(lblBarcode); lblCurrentid = new JLabel("CurrentID"); panel.add(lblCurrentid); } { JPanel panel = new JPanel(); contentPanel.add(panel, BorderLayout.WEST); GridBagLayout gbl_panel = new GridBagLayout(); gbl_panel.columnWidths = new int[] { 0, 0, 0, 0 }; gbl_panel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_panel.columnWeights = new double[] { 0.0, 1.0, 1.0, Double.MIN_VALUE }; gbl_panel.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, 1.0, Double.MIN_VALUE }; panel.setLayout(gbl_panel); JLabel lblNewLabel = new JLabel("Locality"); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.anchor = GridBagConstraints.NORTHEAST; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel.gridx = 0; gbc_lblNewLabel.gridy = 0; panel.add(lblNewLabel, gbc_lblNewLabel); textFieldVerbLocality = new JTextArea(); textFieldVerbLocality.setRows(3); GridBagConstraints gbc_textFieldVerbLocality = new GridBagConstraints(); gbc_textFieldVerbLocality.gridheight = 2; gbc_textFieldVerbLocality.gridwidth = 2; gbc_textFieldVerbLocality.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbLocality.fill = GridBagConstraints.BOTH; gbc_textFieldVerbLocality.gridx = 1; gbc_textFieldVerbLocality.gridy = 0; panel.add(textFieldVerbLocality, gbc_textFieldVerbLocality); textFieldVerbLocality.setColumns(10); JLabel lblVerbatimDate = new JLabel("Date"); GridBagConstraints gbc_lblVerbatimDate = new GridBagConstraints(); gbc_lblVerbatimDate.anchor = GridBagConstraints.EAST; gbc_lblVerbatimDate.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimDate.gridx = 0; gbc_lblVerbatimDate.gridy = 2; panel.add(lblVerbatimDate, gbc_lblVerbatimDate); textFieldVerbDate = new JTextField(); GridBagConstraints gbc_textFieldVerbDate = new GridBagConstraints(); gbc_textFieldVerbDate.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbDate.gridwidth = 2; gbc_textFieldVerbDate.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbDate.gridx = 1; gbc_textFieldVerbDate.gridy = 2; panel.add(textFieldVerbDate, gbc_textFieldVerbDate); textFieldVerbDate.setColumns(10); JLabel lblCollector = new JLabel("Collector"); GridBagConstraints gbc_lblCollector = new GridBagConstraints(); gbc_lblCollector.anchor = GridBagConstraints.EAST; gbc_lblCollector.insets = new Insets(0, 0, 5, 5); gbc_lblCollector.gridx = 0; gbc_lblCollector.gridy = 3; panel.add(lblCollector, gbc_lblCollector); textFieldVerbCollector = new JTextField(); GridBagConstraints gbc_textFieldVerbCollector = new GridBagConstraints(); gbc_textFieldVerbCollector.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbCollector.gridwidth = 2; gbc_textFieldVerbCollector.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbCollector.gridx = 1; gbc_textFieldVerbCollector.gridy = 3; panel.add(textFieldVerbCollector, gbc_textFieldVerbCollector); textFieldVerbCollector.setColumns(10); JLabel lblNewLabel_1 = new JLabel("Collection"); GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints(); gbc_lblNewLabel_1.anchor = GridBagConstraints.EAST; gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_1.gridx = 0; gbc_lblNewLabel_1.gridy = 4; panel.add(lblNewLabel_1, gbc_lblNewLabel_1); textFieldVerbCollection = new JTextField(); GridBagConstraints gbc_textFieldVerbCollection = new GridBagConstraints(); gbc_textFieldVerbCollection.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbCollection.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbCollection.gridx = 2; gbc_textFieldVerbCollection.gridy = 4; panel.add(textFieldVerbCollection, gbc_textFieldVerbCollection); textFieldVerbCollection.setColumns(10); JLabel lblNumbers = new JLabel("Numbers"); GridBagConstraints gbc_lblNumbers = new GridBagConstraints(); gbc_lblNumbers.anchor = GridBagConstraints.EAST; gbc_lblNumbers.insets = new Insets(0, 0, 5, 5); gbc_lblNumbers.gridx = 0; gbc_lblNumbers.gridy = 5; panel.add(lblNumbers, gbc_lblNumbers); textFieldVerbNumbers = new JTextField(); GridBagConstraints gbc_textFieldVerbNumbers = new GridBagConstraints(); gbc_textFieldVerbNumbers.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbNumbers.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbNumbers.gridx = 2; gbc_textFieldVerbNumbers.gridy = 5; panel.add(textFieldVerbNumbers, gbc_textFieldVerbNumbers); textFieldVerbNumbers.setColumns(10); JLabel lblNewLabel_2 = new JLabel("Other Text"); GridBagConstraints gbc_lblNewLabel_2 = new GridBagConstraints(); gbc_lblNewLabel_2.anchor = GridBagConstraints.EAST; gbc_lblNewLabel_2.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_2.gridx = 0; gbc_lblNewLabel_2.gridy = 6; panel.add(lblNewLabel_2, gbc_lblNewLabel_2); textFieldVerbUnclassifiedText = new JTextArea(); textFieldVerbUnclassifiedText.setRows(3); GridBagConstraints gbc_textFieldVerbUnclassifiedText = new GridBagConstraints(); gbc_textFieldVerbUnclassifiedText.gridheight = 2; gbc_textFieldVerbUnclassifiedText.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbUnclassifiedText.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbUnclassifiedText.gridx = 2; gbc_textFieldVerbUnclassifiedText.gridy = 6; panel.add(textFieldVerbUnclassifiedText, gbc_textFieldVerbUnclassifiedText); textFieldVerbUnclassifiedText.setColumns(10); JLabel lblQuestions = new JLabel("Questions"); GridBagConstraints gbc_lblQuestions = new GridBagConstraints(); gbc_lblQuestions.anchor = GridBagConstraints.EAST; gbc_lblQuestions.insets = new Insets(0, 0, 5, 5); gbc_lblQuestions.gridx = 0; gbc_lblQuestions.gridy = 8; panel.add(lblQuestions, gbc_lblQuestions); textFieldQuestions = new JTextField(); GridBagConstraints gbc_textFieldQuestions = new GridBagConstraints(); gbc_textFieldQuestions.insets = new Insets(0, 0, 5, 5); gbc_textFieldQuestions.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldQuestions.gridx = 2; gbc_textFieldQuestions.gridy = 8; panel.add(textFieldQuestions, gbc_textFieldQuestions); textFieldQuestions.setColumns(30); JLabel lblWorkflowStatus = new JLabel("Workflow Status"); GridBagConstraints gbc_lblWorkflowStatus = new GridBagConstraints(); gbc_lblWorkflowStatus.anchor = GridBagConstraints.EAST; gbc_lblWorkflowStatus.insets = new Insets(0, 0, 5, 5); gbc_lblWorkflowStatus.gridx = 0; gbc_lblWorkflowStatus.gridy = 9; panel.add(lblWorkflowStatus, gbc_lblWorkflowStatus); comboBoxWorkflowStatus = new JComboBox<String>(WorkFlowStatus.getVerbatimWorkFlowStatusValues()); GridBagConstraints gbc_comboBoxWorkflowStatus = new GridBagConstraints(); gbc_comboBoxWorkflowStatus.insets = new Insets(0, 0, 5, 0); gbc_comboBoxWorkflowStatus.gridwidth = 2; gbc_comboBoxWorkflowStatus.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxWorkflowStatus.gridx = 2; gbc_comboBoxWorkflowStatus.gridy = 9; panel.add(comboBoxWorkflowStatus, gbc_comboBoxWorkflowStatus); JPanel panel_1 = new JPanel(); GridBagConstraints gbc_panel_1 = new GridBagConstraints(); gbc_panel_1.gridwidth = 2; gbc_panel_1.insets = new Insets(0, 0, 0, 5); gbc_panel_1.fill = GridBagConstraints.BOTH; gbc_panel_1.gridx = 2; gbc_panel_1.gridy = 11; panel.add(panel_1, gbc_panel_1); GridBagLayout gbl_panel_1 = new GridBagLayout(); gbl_panel_1.columnWidths = new int[] { 150, 143, 0 }; gbl_panel_1.rowHeights = new int[] { 25, 0, 0, 0, 0 }; gbl_panel_1.columnWeights = new double[] { 0.0, 0.0, 0.0 }; gbl_panel_1.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; panel_1.setLayout(gbl_panel_1); JButton btnPartiallyIllegible = new JButton("Partially Illegible"); btnPartiallyIllegible.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { appendToQuestions(Verbatim.PARTLY_ILLEGIBLE); } }); GridBagConstraints gbc_btnPartiallyIllegible = new GridBagConstraints(); gbc_btnPartiallyIllegible.fill = GridBagConstraints.HORIZONTAL; gbc_btnPartiallyIllegible.anchor = GridBagConstraints.NORTH; gbc_btnPartiallyIllegible.insets = new Insets(0, 0, 5, 5); gbc_btnPartiallyIllegible.gridx = 0; gbc_btnPartiallyIllegible.gridy = 0; panel_1.add(btnPartiallyIllegible, gbc_btnPartiallyIllegible); JButton btnNewButton = new JButton("No Locality Data"); btnNewButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { textFieldVerbLocality.setText(Verbatim.NO_LOCALITY_DATA); } }); GridBagConstraints gbc_btnNewButton = new GridBagConstraints(); gbc_btnNewButton.anchor = GridBagConstraints.NORTHWEST; gbc_btnNewButton.insets = new Insets(0, 0, 5, 5); gbc_btnNewButton.gridx = 1; gbc_btnNewButton.gridy = 0; panel_1.add(btnNewButton, gbc_btnNewButton); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); JButton btnNewButton_1 = new JButton("Entirely Illegible"); btnNewButton_1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { appendToQuestions(Verbatim.ENTIRELY_ILLEGIBLE); } }); GridBagConstraints gbc_btnNewButton_1 = new GridBagConstraints(); gbc_btnNewButton_1.fill = GridBagConstraints.HORIZONTAL; gbc_btnNewButton_1.anchor = GridBagConstraints.NORTH; gbc_btnNewButton_1.insets = new Insets(0, 0, 5, 5); gbc_btnNewButton_1.gridx = 0; gbc_btnNewButton_1.gridy = 1; panel_1.add(btnNewButton_1, gbc_btnNewButton_1); JButton btnNoDateData = new JButton("No Date Data"); btnNoDateData.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { textFieldVerbDate.setText("[No date data]"); } }); GridBagConstraints gbc_btnNoDateData = new GridBagConstraints(); gbc_btnNoDateData.fill = GridBagConstraints.HORIZONTAL; gbc_btnNoDateData.insets = new Insets(0, 0, 5, 5); gbc_btnNoDateData.gridx = 1; gbc_btnNoDateData.gridy = 1; panel_1.add(btnNoDateData, gbc_btnNoDateData); JButton btnLabelTruncatedIn = new JButton("Label Truncated in Image"); btnLabelTruncatedIn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { appendToQuestions(Verbatim.TRUNCATED_BY_IMAGE); } }); GridBagConstraints gbc_btnLabelTruncatedIn = new GridBagConstraints(); gbc_btnLabelTruncatedIn.insets = new Insets(0, 0, 5, 5); gbc_btnLabelTruncatedIn.anchor = GridBagConstraints.NORTHWEST; gbc_btnLabelTruncatedIn.gridx = 0; gbc_btnLabelTruncatedIn.gridy = 2; panel_1.add(btnLabelTruncatedIn, gbc_btnLabelTruncatedIn); JButton btnNoCollectorData = new JButton("No Collector Data"); btnNoCollectorData.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { textFieldVerbCollector.setText("[No collector data]"); } }); GridBagConstraints gbc_btnNoCollectorData = new GridBagConstraints(); gbc_btnNoCollectorData.insets = new Insets(0, 0, 5, 5); gbc_btnNoCollectorData.gridx = 1; gbc_btnNoCollectorData.gridy = 2; panel_1.add(btnNoCollectorData, gbc_btnNoCollectorData); JButton btnNoPinLabels = new JButton("No Pin Labels"); btnNoPinLabels.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { appendToQuestions(Verbatim.NO_PIN_LABELS); } }); GridBagConstraints gbc_btnNoPinLabels = new GridBagConstraints(); gbc_btnNoPinLabels.insets = new Insets(0, 0, 0, 5); gbc_btnNoPinLabels.gridx = 0; gbc_btnNoPinLabels.gridy = 3; panel_1.add(btnNoPinLabels, gbc_btnNoPinLabels); } { JPanel panel = new JPanel(); contentPanel.add(panel, BorderLayout.CENTER); panel.setLayout(new BorderLayout(0, 0)); panel.add(getImagePanePinLabels()); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.LEFT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); btnPrevious = new JButton("Previous"); btnPrevious.setEnabled(false); if (specimenControler != null && specimenControler.isInTable()) { btnPrevious.setEnabled(true); } btnPrevious.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { save(); if (specimenControler.previousSpecimenInTable()) { specimen = specimenControler.getSpecimen(); setValues(); } } }); buttonPane.add(btnPrevious); btnNext = new JButton("Next"); btnNext.setEnabled(false); if (specimenControler != null && specimenControler.isInTable()) { btnNext.setEnabled(true); } btnNext.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { save(); if (specimenControler.nextSpecimenInTable()) { specimen = specimenControler.getSpecimen(); setValues(); } } }); buttonPane.add(btnNext); { JButton okButton = new JButton("OK"); okButton.setActionCommand("OK"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (save()) { setVisible(false); } } }); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton("Cancel"); cancelButton.setActionCommand("Cancel"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setVisible(false); } }); buttonPane.add(cancelButton); } } }