List of usage examples for javax.swing BoxLayout Y_AXIS
int Y_AXIS
To view the source code for javax.swing BoxLayout Y_AXIS.
Click Source Link
From source file:gda.gui.mca.McaGUI.java
/** * Constructor//w ww .ja v a2 s . c om */ public McaGUI() { this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); Box vertBox = Box.createVerticalBox(); vertBox.add(getTimePanel()); vertBox.add(getAdcPanel()); Box horiBox = Box.createHorizontalBox(); horiBox.add(vertBox); horiBox.add(getRoiPanel()); this.add(getNamePanel()); this.add(horiBox); makePlotPanel(); this.add(plotPanel); Thread plotThread = uk.ac.gda.util.ThreadManager.getThread(new PlotUpdateWorker(), "MCA Plot Update thread"); plotThread.start(); setLabel("Fluorescence Detector Control"); }
From source file:es.emergya.ui.plugins.admin.aux1.RecursoDialog.java
public RecursoDialog(final Recurso rec, final AdminResources adminResources) { super();//from w ww . jav a 2 s .c o m setAlwaysOnTop(true); setSize(600, 400); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { super.windowClosing(e); if (cambios) { int res = JOptionPane.showConfirmDialog(RecursoDialog.this, "Existen cambios sin guardar. Seguro que desea cerrar la ventana?", "Cambios sin guardar", JOptionPane.OK_CANCEL_OPTION); if (res != JOptionPane.CANCEL_OPTION) { e.getWindow().dispose(); } } else { e.getWindow().dispose(); } } }); final Recurso r = (rec == null) ? null : RecursoConsultas.get(rec.getId()); if (r != null) { setTitle(i18n.getString("Resources.summary.titleWindow") + " " + r.getIdentificador()); } else { setTitle(i18n.getString("Resources.summary.titleWindow.new")); } setIconImage(getBasicWindow().getFrame().getIconImage()); JPanel base = new JPanel(); base.setBackground(Color.WHITE); base.setLayout(new BoxLayout(base, BoxLayout.Y_AXIS)); // Icono del titulo JPanel title = new JPanel(new FlowLayout(FlowLayout.LEADING)); title.setOpaque(false); JLabel labelTitulo = null; if (r != null) { labelTitulo = new JLabel(i18n.getString("Resources.summary"), LogicConstants.getIcon("tittleficha_icon_recurso"), JLabel.LEFT); } else { labelTitulo = new JLabel(i18n.getString("Resources.cabecera.nuevo"), LogicConstants.getIcon("tittleficha_icon_recurso"), JLabel.LEFT); } labelTitulo.setFont(LogicConstants.deriveBoldFont(12f)); title.add(labelTitulo); base.add(title); // Nombre JPanel mid = new JPanel(new SpringLayout()); mid.setOpaque(false); mid.add(new JLabel(i18n.getString("Resources.name"), JLabel.RIGHT)); final JTextField name = new JTextField(25); if (r != null) { name.setText(r.getNombre()); } name.getDocument().addDocumentListener(changeListener); name.setEditable(r == null); mid.add(name); // patrullas final JLabel labelSquads = new JLabel(i18n.getString("Resources.squad"), JLabel.RIGHT); mid.add(labelSquads); List<Patrulla> pl = PatrullaConsultas.getAll(); pl.add(0, null); final JComboBox squads = new JComboBox(pl.toArray()); squads.setPrototypeDisplayValue("XXXXXXXXXXXXXXXXXXXXXXXXX"); squads.addActionListener(changeSelectionListener); squads.setOpaque(false); labelSquads.setLabelFor(squads); if (r != null) { squads.setSelectedItem(r.getPatrullas()); } else { squads.setSelectedItem(null); } squads.setEnabled((r != null && r.getHabilitado() != null) ? r.getHabilitado() : true); mid.add(squads); // // Identificador // mid.setOpaque(false); // mid.add(new JLabel(i18n.getString("Resources.identificador"), // JLabel.RIGHT)); // final JTextField identificador = new JTextField(""); // if (r != null) { // identificador.setText(r.getIdentificador()); // } // identificador.getDocument().addDocumentListener(changeListener); // identificador.setEditable(r == null); // mid.add(identificador); // Espacio en blanco // mid.add(Box.createHorizontalGlue()); // mid.add(Box.createHorizontalGlue()); // Tipo final JLabel labelTipoRecursos = new JLabel(i18n.getString("Resources.type"), JLabel.RIGHT); mid.add(labelTipoRecursos); final JComboBox types = new JComboBox(RecursoConsultas.getTipos()); labelTipoRecursos.setLabelFor(types); types.addActionListener(changeSelectionListener); if (r != null) { types.setSelectedItem(r.getTipo()); } else { types.setSelectedItem(0); } // types.setEditable(true); types.setEnabled(true); mid.add(types); // Estado Eurocop mid.add(new JLabel(i18n.getString("Resources.status"), JLabel.RIGHT)); final JTextField status = new JTextField(); if (r != null && r.getEstadoEurocop() != null) { status.setText(r.getEstadoEurocop().getIdentificador()); } status.setEditable(false); mid.add(status); // Subflota y patrulla mid.add(new JLabel(i18n.getString("Resources.subfleet"), JLabel.RIGHT)); final JComboBox subfleets = new JComboBox(FlotaConsultas.getAllHabilitadas()); subfleets.addActionListener(changeSelectionListener); if (r != null) { subfleets.setSelectedItem(r.getFlotas()); } else { subfleets.setSelectedIndex(0); } subfleets.setEnabled(true); subfleets.setOpaque(false); mid.add(subfleets); // Referencia humana mid.add(new JLabel(i18n.getString("Resources.incidences"), JLabel.RIGHT)); final JTextField rhumana = new JTextField(); // if (r != null && r.getIncidencias() != null) { // rhumana.setText(r.getIncidencias().getReferenciaHumana()); // } rhumana.setEditable(false); mid.add(rhumana); // dispositivo mid.add(new JLabel(i18n.getString("Resources.device"), JLabel.RIGHT)); final PlainDocument plainDocument = new PlainDocument() { private static final long serialVersionUID = 4929271093724956016L; @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (this.getLength() + str.length() <= LogicConstants.LONGITUD_ISSI) { super.insertString(offs, str, a); } } }; final JTextField issi = new JTextField(plainDocument, "", LogicConstants.LONGITUD_ISSI); plainDocument.addDocumentListener(changeListener); issi.setEditable(true); mid.add(issi); mid.add(new JLabel(i18n.getString("Resources.enabled"), JLabel.RIGHT)); final JCheckBox enabled = new JCheckBox("", true); enabled.addActionListener(changeSelectionListener); enabled.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { if (enabled.isSelected()) { squads.setSelectedIndex(0); } squads.setEnabled(enabled.isSelected()); } }); enabled.setEnabled(true); enabled.setOpaque(false); if (r != null) { enabled.setSelected(r.getHabilitado()); } else { enabled.setSelected(true); } if (r != null && r.getDispositivo() != null) { issi.setText( StringUtils.leftPad(String.valueOf(r.getDispositivo()), LogicConstants.LONGITUD_ISSI, '0')); } mid.add(enabled); // Fecha ultimo gps mid.add(new JLabel(i18n.getString("Resources.lastPosition"), JLabel.RIGHT)); JTextField lastGPS = new JTextField(); final Date lastGPSDateForRecurso = HistoricoGPSConsultas.lastGPSDateForRecurso(r); if (lastGPSDateForRecurso != null) { lastGPS.setText(SimpleDateFormat.getDateTimeInstance().format(lastGPSDateForRecurso)); } lastGPS.setEditable(false); mid.add(lastGPS); // Espacio en blanco mid.add(Box.createHorizontalGlue()); mid.add(Box.createHorizontalGlue()); // informacion adicional JPanel infoPanel = new JPanel(new SpringLayout()); final JTextField info = new JTextField(25); info.getDocument().addDocumentListener(changeListener); infoPanel.add(new JLabel(i18n.getString("Resources.info"))); infoPanel.add(info); infoPanel.setOpaque(false); info.setOpaque(false); SpringUtilities.makeCompactGrid(infoPanel, 1, 2, 6, 6, 6, 18); if (r != null) { info.setText(r.getInfoAdicional()); } else { info.setText(""); } info.setEditable(true); // Espacio en blanco mid.add(Box.createHorizontalGlue()); mid.add(Box.createHorizontalGlue()); SpringUtilities.makeCompactGrid(mid, 5, 4, 6, 6, 6, 18); base.add(mid); base.add(infoPanel); JPanel buttons = new JPanel(); buttons.setOpaque(false); JButton accept = null; if (r == null) { accept = new JButton("Crear", LogicConstants.getIcon("button_crear")); } else { accept = new JButton("Guardar", LogicConstants.getIcon("button_save")); } accept.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { if (cambios || r == null || r.getId() == null) { boolean shithappens = true; if ((r == null || r.getId() == null)) { // Estamos // creando // uno nuevo if (RecursoConsultas.alreadyExists(name.getText())) { shithappens = false; JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.nombreUnico")); } else if (issi.getText() != null && issi.getText().length() > 0 && StringUtils .trimToEmpty(issi.getText()).length() != LogicConstants.LONGITUD_ISSI) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString(Locale.ROOT, "admin.recursos.popup.error.faltanCifras", LogicConstants.LONGITUD_ISSI)); shithappens = false; } else if (issi.getText() != null && issi.getText().length() > 0 && LogicConstants.isNumeric(issi.getText()) && RecursoConsultas.alreadyExists(new Integer(issi.getText()))) { shithappens = false; JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.dispositivoUnico")); } } if (shithappens) { if (name.getText().isEmpty()) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.nombreNulo")); } else if (issi.getText() != null && issi.getText().length() > 0 && StringUtils .trimToEmpty(issi.getText()).length() != LogicConstants.LONGITUD_ISSI) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString(Locale.ROOT, "admin.recursos.popup.error.faltanCifras", LogicConstants.LONGITUD_ISSI)); } else if (issi.getText() != null && issi.getText().length() > 0 && LogicConstants.isNumeric(issi.getText()) && r != null && r.getId() != null && RecursoConsultas.alreadyExists(new Integer(issi.getText()), r.getId())) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.issiUnico")); } else if (issi.getText() != null && issi.getText().length() > 0 && !LogicConstants.isNumeric(issi.getText())) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.noNumerico")); // } else if (identificador.getText().isEmpty()) // { // JOptionPane // .showMessageDialog( // RecursoDialog.this, // i18n.getString("admin.recursos.popup.error.identificadorNulo")); } else if (subfleets.getSelectedIndex() == -1) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.noSubflota")); } else if (types.getSelectedItem() == null || types.getSelectedItem().toString().trim().isEmpty()) { JOptionPane.showMessageDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.error.noTipo")); } else { int i = JOptionPane.showConfirmDialog(RecursoDialog.this, i18n.getString("admin.recursos.popup.dialogo.guardar.titulo"), i18n.getString("admin.recursos.popup.dialogo.guardar.guardar"), JOptionPane.YES_NO_CANCEL_OPTION); if (i == JOptionPane.YES_OPTION) { Recurso recurso = r; if (r == null) { recurso = new Recurso(); } recurso.setInfoAdicional(info.getText()); if (issi.getText() != null && issi.getText().length() > 0) { recurso.setDispositivo(new Integer(issi.getText())); } else { recurso.setDispositivo(null); } recurso.setFlotas(FlotaConsultas.find(subfleets.getSelectedItem().toString())); if (squads.getSelectedItem() != null && enabled.isSelected()) { recurso.setPatrullas( PatrullaConsultas.find(squads.getSelectedItem().toString())); } else { recurso.setPatrullas(null); } recurso.setNombre(name.getText()); recurso.setHabilitado(enabled.isSelected()); // recurso.setIdentificador(identificador // .getText()); recurso.setTipo(types.getSelectedItem().toString()); dispose(); RecursoAdmin.saveOrUpdate(recurso); adminResources.refresh(null); PluginEventHandler.fireChange(adminResources); } else if (i == JOptionPane.NO_OPTION) { dispose(); } } } } else { log.debug("No hay cambios"); dispose(); } } catch (Throwable t) { log.error("Error guardando un recurso", t); } } }); buttons.add(accept); JButton cancelar = new JButton("Cancelar", LogicConstants.getIcon("button_cancel")); cancelar.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (cambios) { if (JOptionPane.showConfirmDialog(RecursoDialog.this, "Existen cambios sin guardar. Seguro que desea cerrar la ventana?", "Cambios sin guardar", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.CANCEL_OPTION) { dispose(); } } else { dispose(); } } }); buttons.add(cancelar); base.add(buttons); getContentPane().add(base); setLocationRelativeTo(null); cambios = false; if (r == null) { cambios = true; } pack(); int x; int y; Container myParent = getBasicWindow().getPluginContainer().getDetachedTab(0); Point topLeft = myParent.getLocationOnScreen(); Dimension parentSize = myParent.getSize(); Dimension mySize = getSize(); if (parentSize.width > mySize.width) { x = ((parentSize.width - mySize.width) / 2) + topLeft.x; } else { x = topLeft.x; } if (parentSize.height > mySize.height) { y = ((parentSize.height - mySize.height) / 2) + topLeft.y; } else { y = topLeft.y; } setLocation(x, y); cambios = false; }
From source file:com.web.vehiclerouting.optaplanner.common.swingui.SolverAndPersistenceFrame.java
private JComponent createQuickOpenPanel(List<Action> quickOpenActionList, List<File> fileList, String title) { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); if (fileList.isEmpty()) { JLabel noneLabel = new JLabel("None"); noneLabel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); panel.add(noneLabel);/*from w w w . j a v a 2 s . c o m*/ } else { for (File file : fileList) { Action quickOpenAction = new QuickOpenAction(file); quickOpenActionList.add(quickOpenAction); JButton quickOpenButton = new JButton(quickOpenAction); quickOpenButton.setHorizontalAlignment(SwingConstants.LEFT); quickOpenButton.setMargin(new Insets(0, 0, 0, 0)); panel.add(quickOpenButton); } } JScrollPane scrollPane = new JScrollPane(panel); scrollPane.getVerticalScrollBar().setUnitIncrement(25); scrollPane.setMinimumSize(new Dimension(100, 80)); // Size fits into screen resolution 1024*768 scrollPane.setPreferredSize(new Dimension(180, 200)); JPanel titlePanel = new JPanel(new BorderLayout()); titlePanel.add(scrollPane, BorderLayout.CENTER); titlePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2), BorderFactory.createTitledBorder(title))); return titlePanel; }
From source file:netcap.JcaptureConfiguration.java
/** * ????//from w ww . java2 s .c om * @return */ private JPanel getProtocolFilterPanel() { JPanel filterPanel = ViewModules.createSimplePanel("?", Component.LEFT_ALIGNMENT, -1f, BoxLayout.Y_AXIS); JTextPane proType = ViewModules.createTextPane("???:"); proFilterField = ViewModules.createTextField(20, "tcp", true); ViewModules.createSeparator(0); JTextPane domain = ViewModules.createTextPane("???/IP:"); domainFilterField = ViewModules.createTextField(20, "", true); ViewModules.addComponent(filterPanel, proType, proFilterField, domain, domainFilterField); return filterPanel; }
From source file:be.ac.ua.comp.scarletnebula.gui.windows.LinkUnlinkWindow.java
private final JPanel getMainPanel() { final JPanel mainPanel = new JPanel(new GridBagLayout()); mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); final ServerList linkedServerList = new ServerList(linkedServerListModel); linkedServerList.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); final JScrollPane linkedServerScrollPane = new JScrollPane(linkedServerList); linkedServerScrollPane/*from w w w .j a v a 2 s. c o m*/ .setBorder(BorderFactory.createTitledBorder(new EmptyBorder(5, 20, 20, 20), "Linked Servers")); // Doesn't matter what this is set to, as long as it's the same as the // one for unlinkedServerScrollPane linkedServerScrollPane.setPreferredSize(new Dimension(10, 10)); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = 0; c.weightx = 0.5; c.weighty = 1.0; mainPanel.add(linkedServerScrollPane, c); final ServerList unlinkedServerList = new ServerList(unlinkedServerListModel); unlinkedServerList.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); final JScrollPane unlinkedServerScrollPane = new JScrollPane(unlinkedServerList); unlinkedServerScrollPane .setBorder(BorderFactory.createTitledBorder(new EmptyBorder(5, 20, 20, 20), "Unlinked Servers")); // Doesn't matter what this is set to, as long as it's the same as the // one for unlinkedServerScrollPane unlinkedServerScrollPane.setPreferredSize(new Dimension(10, 10)); final JPanel middlePanel = new JPanel(); middlePanel.setLayout(new BoxLayout(middlePanel, BoxLayout.Y_AXIS)); middlePanel.add(Box.createVerticalGlue()); final JButton linkSelectionButton = new JButton("<"); final JButton unlinkSelectionButton = new JButton(">"); linkSelectionButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { // Move selection from unlinked to linked list final int selection = unlinkedServerList.getSelectedIndex(); if (selection < 0) { return; } final Server server = unlinkedServerListModel.getVisibleServerAtIndex(selection); unlinkedServerListModel.removeServer(server); linkedServerListModel.addServer(server); } }); unlinkSelectionButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { // Move selection from linked to unlinked list final int selection = linkedServerList.getSelectedIndex(); if (selection < 0) { return; } final int answer = JOptionPane.showOptionDialog(LinkUnlinkWindow.this, "You are about to unlink a server. " + "Unlinking a server will permanently remove \nall data associated with " + "this server, but the server will keep running. " + "\n\nAre you sure you wish to continue?", "Unlink Server", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, null, null); if (answer != JOptionPane.YES_OPTION) { return; } final Server server = linkedServerListModel.getVisibleServerAtIndex(selection); linkedServerListModel.removeServer(server); unlinkedServerListModel.addServer(server); } }); middlePanel.add(unlinkSelectionButton); middlePanel.add(Box.createVerticalStrut(10)); middlePanel.add(linkSelectionButton); middlePanel.add(Box.createVerticalGlue()); c.gridx = 1; c.gridy = 0; c.weightx = 0.0; c.weighty = 0.0; mainPanel.add(middlePanel, c); c.gridx = 2; c.gridy = 0; c.weightx = 0.5; c.weighty = 1.0; mainPanel.add(unlinkedServerScrollPane, c); return mainPanel; }
From source file:sim.app.sugarscape.SugarscapeWithUIHigh.java
void addChartPanel(Controller c, Sugarscape model) { charts = new Charts(model); ChartPanel ginipanel = null;//from ww w. ja v a 2s .c o m ChartPanel wealthpanel = null; ChartPanel agentspanel = null; ChartPanel agepanel = null; ChartPanel evolutionpanel = null; ChartPanel culturetagpanel = null; ChartPanel tradepanel = null; if (model.gini_chart_on) { ginipanel = new ChartPanel(charts.createGiniChart()); } if (model.wealth_chart_on) { wealthpanel = new ChartPanel(charts.createChart4()); } if (model.population_chart_on) { agentspanel = new ChartPanel(charts.createAgentsChart()); } if (model.age_chart_on) { agepanel = new ChartPanel(charts.createAgeHistoChart()); } if (model.evolution_chart_on) { evolutionpanel = new ChartPanel(charts.createEvolution()); } if (model.culture_tag_chart_on) { culturetagpanel = new ChartPanel(charts.createCultureTagChart()); } if (model.trade_chart_on) { tradepanel = new ChartPanel(charts.createTradeChart()); } if ((!model.gini_chart_on) && (!model.wealth_chart_on) && (!model.population_chart_on) && (!model.age_chart_on) && (!model.evolution_chart_on) && (!model.culture_tag_chart_on) && (!model.trade_chart_on)) { return; } // create the chart frame chartFrame = new JFrame(); chartFrame.setResizable(true); Container cp = chartFrame.getContentPane(); cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS)); if (agepanel != null) { cp.add(agepanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } if (tradepanel != null) { cp.add(tradepanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } if (ginipanel != null) { cp.add(ginipanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } if (wealthpanel != null) { cp.add(wealthpanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } if (agentspanel != null) { cp.add(agentspanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } if (culturetagpanel != null) { cp.add(culturetagpanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } if (evolutionpanel != null) { cp.add(evolutionpanel); cp.add(Box.createRigidArea(new Dimension(0, 6))); } //cp.add(chartPanel2); //cp.add(Box.createRigidArea(new Dimension(0,6))); //cp.add(chartPanel3); chartFrame.setTitle("Live Agent Statistics"); chartFrame.pack(); // register the chartFrame so it appears in the "Display" list c.registerFrame(chartFrame); // make the frame visible chartFrame.setVisible(true); }
From source file:mergedoc.ui.PreferencePanel.java
/** * ??????/* w w w . j av a2 s. c o m*/ * @return ?? * @throws MergeDocException ???????? */ private JComponent createLowerPanel() throws MergeDocException { // ??? JPanel checkPanel = new JPanel(); checkPanel.setLayout(new BoxLayout(checkPanel, BoxLayout.Y_AXIS)); List<ReplaceEntry> list = ConfigManager.getInstance().getGlobalEntries(); for (ReplaceEntry entry : list) { EntryCheckBox cb = new EntryCheckBox(entry); cb.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { previewScrollPane.updatePreview(entryCheckList); } }); checkPanel.add(cb); entryCheckList.add(cb); } JScrollPane checkScrollPane = ComponentFactory.createScrollPane(checkPanel); checkScrollPane.getVerticalScrollBar().setUnitIncrement(10); // ? previewScrollPane = new PreviewScrollPane(); // ?? splitPane.setBorder(BorderFactory.createEmptyBorder()); splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); splitPane.setContinuousLayout(true); splitPane.setTopComponent(checkScrollPane); splitPane.setBottomComponent(previewScrollPane); JPanel splitPanel = new JPanel(); splitPanel.setLayout(new BoxLayout(splitPanel, BoxLayout.X_AXIS)); splitPanel.add(splitPane); // ?? JPanel panel = new TitledPanel(""); panel.setMaximumSize(ComponentFactory.createMaxDimension()); panel.add(splitPanel); // ??? Persister psst = Persister.getInstance(); int loc = psst.getInt(Persister.DETAIL_PANEL_HEIGHT, 88); splitPane.setDividerLocation(loc); // ??? String[] pDescs = psst.getStrings(Persister.REPLACE_DESCRIPTION_ARRAY); for (EntryCheckBox ecb : entryCheckList) { ReplaceEntry entry = ecb.getReplaceEntry(); String desc = entry.getDescription(); for (String pDesc : pDescs) { if (desc.equals(pDesc)) { ecb.setSelected(true); break; } } } previewScrollPane.updatePreview(entryCheckList); return panel; }
From source file:drusy.ui.panels.WifiStatePanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Kevin Renella headerPanel = new JPanel(); label1 = new JLabel(); mainPanel = new JPanel(); //======== this ======== setLayout(new BorderLayout()); //======== headerPanel ======== {//from w w w . java 2s . c om headerPanel.setLayout(new BorderLayout()); //---- label1 ---- label1.setText("This panel shows you the users connected on the Wi-Fi"); label1.setHorizontalAlignment(SwingConstants.CENTER); headerPanel.add(label1, BorderLayout.CENTER); } add(headerPanel, BorderLayout.NORTH); //======== mainPanel ======== { mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); } add(mainPanel, BorderLayout.CENTER); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:BRHInit.java
public void showVPSPrompt(JSONArray vps) throws Exception { vps_list = vps;/*from w ww .j a v a2 s.c o m*/ if (vps_list_window == null) { vps_list_window = new JFrame("BRH Console"); vps_list_window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel top_panel = new JPanel(); vps_list_window.getContentPane().add(top_panel); top_panel.setLayout(new BoxLayout(top_panel, BoxLayout.Y_AXIS)); top_panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); Vector values = new Vector(); for (int idx = 0; idx < vps_list.length(); ++idx) { JSONArray row = vps_list.getJSONArray(idx); values.addElement(row.getString(1)); } vps_list_box = new JList(values); top_panel.add(new JScrollPane(vps_list_box)); vps_list_box.setVisibleRowCount(10); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); JPanel col_panel = new JPanel(); p.add(col_panel); col_panel.setLayout(new BoxLayout(col_panel, BoxLayout.Y_AXIS)); col_panel.add(new JLabel("email")); col_panel.add(Box.createRigidArea(new Dimension(0, 5))); col_panel.add(new JLabel("password")); p.add(Box.createRigidArea(new Dimension(5, 0))); col_panel = new JPanel(); p.add(col_panel); col_panel.setLayout(new BoxLayout(col_panel, BoxLayout.Y_AXIS)); col_panel.add(email = new JTextField(20)); col_panel.add(Box.createRigidArea(new Dimension(0, 5))); col_panel.add(password = new JPasswordField()); top_panel.add(Box.createRigidArea(new Dimension(0, 10))); p = new JPanel(); top_panel.add(p); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(Box.createHorizontalGlue()); p.add(vps_list_ok = new JButton("OK")); p.add(Box.createRigidArea(new Dimension(5, 0))); p.add(vps_list_cancel = new JButton("Cancel")); p.add(Box.createHorizontalGlue()); vps_list_ok.addActionListener(this); vps_list_cancel.addActionListener(this); vps_list_window.pack(); } vps_list_window.setVisible(true); }
From source file:edu.harvard.mcz.imagecapture.VerbatimClassifyDialog.java
protected void init() { setTitle("Interpret verbatim data into fields."); setBounds(100, 100, 1203, 899);//from w ww .j ava2 s . com getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS)); { JPanel panelVerbatimValues = new JPanel(); contentPanel.add(panelVerbatimValues); GridBagLayout gbl_panelVerbatimValues = new GridBagLayout(); gbl_panelVerbatimValues.columnWidths = new int[] { 70, 0, 0, 0, 35, 0, 58, 0, 0, 0 }; gbl_panelVerbatimValues.rowHeights = new int[] { 15, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0 }; gbl_panelVerbatimValues.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0 }; gbl_panelVerbatimValues.rowWeights = new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; panelVerbatimValues.setLayout(gbl_panelVerbatimValues); { lblCount = new JLabel("New label"); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.gridwidth = 2; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel.anchor = GridBagConstraints.SOUTHWEST; gbc_lblNewLabel.gridx = 0; gbc_lblNewLabel.gridy = 0; panelVerbatimValues.add(lblCount, gbc_lblNewLabel); } JButton buttonFillFromLast = new JButton("Fill From Last"); GridBagConstraints gbc_buttonFillFromLast = new GridBagConstraints(); gbc_buttonFillFromLast.anchor = GridBagConstraints.SOUTH; gbc_buttonFillFromLast.insets = new Insets(0, 0, 5, 5); gbc_buttonFillFromLast.gridx = 3; gbc_buttonFillFromLast.gridy = 0; panelVerbatimValues.add(buttonFillFromLast, gbc_buttonFillFromLast); { JLabel lblNewLabel_1 = new JLabel("Field values to apply to all records."); GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints(); gbc_lblNewLabel_1.anchor = GridBagConstraints.SOUTHEAST; gbc_lblNewLabel_1.gridwidth = 4; gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_1.gridx = 4; gbc_lblNewLabel_1.gridy = 0; panelVerbatimValues.add(lblNewLabel_1, gbc_lblNewLabel_1); } { JLabel lblNewLabel_2 = new JLabel("Verbatim Locality"); 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 = 1; panelVerbatimValues.add(lblNewLabel_2, gbc_lblNewLabel_2); } { textFieldVerbLocality = new JTextArea(); textFieldVerbLocality.setEditable(false); textFieldVerbLocality.setRows(5); GridBagConstraints gbc_textField = new GridBagConstraints(); gbc_textField.gridheight = 3; gbc_textField.insets = new Insets(0, 0, 5, 5); gbc_textField.fill = GridBagConstraints.BOTH; gbc_textField.gridx = 1; gbc_textField.gridy = 1; panelVerbatimValues.add(textFieldVerbLocality, gbc_textField); textFieldVerbLocality.setColumns(30); } JLabel lblNewLabel = new JLabel("HigherGeography"); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.anchor = GridBagConstraints.EAST; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel.gridx = 3; gbc_lblNewLabel.gridy = 1; panelVerbatimValues.add(lblNewLabel, gbc_lblNewLabel); GridBagConstraints gbc_textFieldHigherGeography = new GridBagConstraints(); gbc_textFieldHigherGeography.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldHigherGeography.gridwidth = 5; gbc_textFieldHigherGeography.insets = new Insets(0, 0, 5, 5); gbc_textFieldHigherGeography.gridx = 4; gbc_textFieldHigherGeography.gridy = 1; panelVerbatimValues.add(getComboBoxHighGeog(), gbc_textFieldHigherGeography); JButton btnCopyLocality = new JButton(">"); btnCopyLocality.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (textFieldSpecificLocality.getText().isEmpty()) { textFieldSpecificLocality.setText(textFieldVerbLocality.getText().replace("\n", "").trim()); } } }); GridBagConstraints gbc_btnCopyLocality = new GridBagConstraints(); gbc_btnCopyLocality.insets = new Insets(0, 0, 5, 5); gbc_btnCopyLocality.gridx = 2; gbc_btnCopyLocality.gridy = 2; panelVerbatimValues.add(btnCopyLocality, gbc_btnCopyLocality); JLabel lblSpecificLocality = new JLabel("Specific Locality"); GridBagConstraints gbc_lblSpecificLocality = new GridBagConstraints(); gbc_lblSpecificLocality.anchor = GridBagConstraints.EAST; gbc_lblSpecificLocality.insets = new Insets(0, 0, 5, 5); gbc_lblSpecificLocality.gridx = 3; gbc_lblSpecificLocality.gridy = 2; panelVerbatimValues.add(lblSpecificLocality, gbc_lblSpecificLocality); JLabel lblElevation = new JLabel("Elevation"); GridBagConstraints gbc_lblElevation = new GridBagConstraints(); gbc_lblElevation.anchor = GridBagConstraints.EAST; gbc_lblElevation.insets = new Insets(0, 0, 5, 5); gbc_lblElevation.gridx = 3; gbc_lblElevation.gridy = 3; panelVerbatimValues.add(lblElevation, gbc_lblElevation); textFieldMinElevation = new JTextField(); textFieldMinElevation.setMinimumSize(new Dimension(60, 19)); GridBagConstraints gbc_textFieldMinElevation = new GridBagConstraints(); gbc_textFieldMinElevation.insets = new Insets(0, 0, 5, 5); gbc_textFieldMinElevation.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldMinElevation.gridx = 4; gbc_textFieldMinElevation.gridy = 3; panelVerbatimValues.add(textFieldMinElevation, gbc_textFieldMinElevation); textFieldMinElevation.setColumns(4); JLabel lblTo = new JLabel("to"); GridBagConstraints gbc_lblTo = new GridBagConstraints(); gbc_lblTo.anchor = GridBagConstraints.EAST; gbc_lblTo.insets = new Insets(0, 0, 5, 5); gbc_lblTo.gridx = 5; gbc_lblTo.gridy = 3; panelVerbatimValues.add(lblTo, gbc_lblTo); textFieldMaxElevation = new JTextField(); textFieldMaxElevation.setMinimumSize(new Dimension(60, 19)); GridBagConstraints gbc_textFieldMaxElevation = new GridBagConstraints(); gbc_textFieldMaxElevation.anchor = GridBagConstraints.WEST; gbc_textFieldMaxElevation.insets = new Insets(0, 0, 5, 5); gbc_textFieldMaxElevation.gridx = 6; gbc_textFieldMaxElevation.gridy = 3; panelVerbatimValues.add(textFieldMaxElevation, gbc_textFieldMaxElevation); textFieldMaxElevation.setColumns(5); comboBoxElevUnits = new JComboBox(); GridBagConstraints gbc_comboBoxElevUnits = new GridBagConstraints(); gbc_comboBoxElevUnits.insets = new Insets(0, 0, 5, 5); gbc_comboBoxElevUnits.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxElevUnits.gridx = 7; gbc_comboBoxElevUnits.gridy = 3; panelVerbatimValues.add(comboBoxElevUnits, gbc_comboBoxElevUnits); { JLabel lblVerbatimdate = new JLabel("VerbatimDate"); 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 = 4; panelVerbatimValues.add(lblVerbatimdate, gbc_lblVerbatimdate); } textFieldVerbDate = new JTextField(); GridBagConstraints gbc_textFieldVerbDate = new GridBagConstraints(); gbc_textFieldVerbDate.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbDate.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldVerbDate.gridx = 1; gbc_textFieldVerbDate.gridy = 4; panelVerbatimValues.add(textFieldVerbDate, gbc_textFieldVerbDate); textFieldVerbDate.setColumns(30); JButton btnCopyDate = new JButton(">"); btnCopyDate.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (textFieldISODate.getText().isEmpty()) { Map<String, String> extractResult = DateUtils .extractDateFromVerbatim(textFieldVerbDate.getText().trim()); if (extractResult.containsKey("result")) { textFieldISODate.setText(extractResult.get("result")); } if (extractResult.containsKey("resultState")) { // TODO: Report suspect etc } } } }); GridBagConstraints gbc_btnCopyDate = new GridBagConstraints(); gbc_btnCopyDate.insets = new Insets(0, 0, 5, 5); gbc_btnCopyDate.gridx = 2; gbc_btnCopyDate.gridy = 4; panelVerbatimValues.add(btnCopyDate, gbc_btnCopyDate); JLabel lblNewLabel_3 = new JLabel("ISO Date"); GridBagConstraints gbc_lblNewLabel_3 = new GridBagConstraints(); gbc_lblNewLabel_3.anchor = GridBagConstraints.EAST; gbc_lblNewLabel_3.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_3.gridx = 3; gbc_lblNewLabel_3.gridy = 4; panelVerbatimValues.add(lblNewLabel_3, gbc_lblNewLabel_3); textFieldISODate = new JTextField(); textFieldISODate.setInputVerifier( MetadataRetriever.getInputVerifier(Specimen.class, "ISODate", textFieldISODate)); textFieldISODate.setToolTipText(MetadataRetriever.getFieldHelp(Specimen.class, "ISODate")); GridBagConstraints gbc_textFieldISODate = new GridBagConstraints(); gbc_textFieldISODate.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldISODate.gridwidth = 5; gbc_textFieldISODate.insets = new Insets(0, 0, 5, 5); gbc_textFieldISODate.gridx = 4; gbc_textFieldISODate.gridy = 4; panelVerbatimValues.add(textFieldISODate, gbc_textFieldISODate); textFieldISODate.setColumns(10); textFieldSpecificLocality = new JTextField(); GridBagConstraints gbc_textFieldSpecificLocality = new GridBagConstraints(); gbc_textFieldSpecificLocality.gridwidth = 5; gbc_textFieldSpecificLocality.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldSpecificLocality.insets = new Insets(0, 0, 5, 5); gbc_textFieldSpecificLocality.gridx = 4; gbc_textFieldSpecificLocality.gridy = 2; panelVerbatimValues.add(textFieldSpecificLocality, gbc_textFieldSpecificLocality); textFieldSpecificLocality.setColumns(25); { JLabel lblVerbatimCollector = new JLabel("Verbatim Collector"); GridBagConstraints gbc_lblVerbatimCollector = new GridBagConstraints(); gbc_lblVerbatimCollector.anchor = GridBagConstraints.EAST; gbc_lblVerbatimCollector.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimCollector.gridx = 0; gbc_lblVerbatimCollector.gridy = 6; panelVerbatimValues.add(lblVerbatimCollector, gbc_lblVerbatimCollector); } textFieldVerbCollector = new JTextArea(); textFieldVerbCollector.setEditable(false); textFieldVerbCollector.setRows(3); GridBagConstraints gbc_textFieldVerbCollector = new GridBagConstraints(); gbc_textFieldVerbCollector.gridheight = 2; gbc_textFieldVerbCollector.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbCollector.fill = GridBagConstraints.BOTH; gbc_textFieldVerbCollector.gridx = 1; gbc_textFieldVerbCollector.gridy = 6; panelVerbatimValues.add(textFieldVerbCollector, gbc_textFieldVerbCollector); textFieldVerbCollector.setColumns(30); JLabel lblCollectors = new JLabel("Collector(s)"); GridBagConstraints gbc_lblCollectors = new GridBagConstraints(); gbc_lblCollectors.anchor = GridBagConstraints.EAST; gbc_lblCollectors.insets = new Insets(0, 0, 5, 5); gbc_lblCollectors.gridx = 3; gbc_lblCollectors.gridy = 6; panelVerbatimValues.add(lblCollectors, gbc_lblCollectors); JButton btnAddCollector = new JButton("+"); btnAddCollector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { ((CollectorTableModel) jTableCollectors.getModel()).addCollector(new Collector(null, "")); } }); GridBagConstraints gbc_btnAddCollector = new GridBagConstraints(); gbc_btnAddCollector.anchor = GridBagConstraints.EAST; gbc_btnAddCollector.insets = new Insets(0, 0, 5, 5); gbc_btnAddCollector.gridx = 3; gbc_btnAddCollector.gridy = 7; panelVerbatimValues.add(btnAddCollector, gbc_btnAddCollector); GridBagConstraints gbc_collectorTable = new GridBagConstraints(); gbc_collectorTable.insets = new Insets(0, 0, 5, 5); gbc_collectorTable.fill = GridBagConstraints.BOTH; gbc_collectorTable.gridx = 4; gbc_collectorTable.gridy = 6; gbc_collectorTable.gridheight = 2; gbc_collectorTable.gridwidth = 5; panelVerbatimValues.add(getJScrollPaneCollectors(), gbc_collectorTable); JLabel lblVerbatimCollection = new JLabel("Verbatim Collection"); GridBagConstraints gbc_lblVerbatimCollection = new GridBagConstraints(); gbc_lblVerbatimCollection.anchor = GridBagConstraints.EAST; gbc_lblVerbatimCollection.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimCollection.gridx = 0; gbc_lblVerbatimCollection.gridy = 8; panelVerbatimValues.add(lblVerbatimCollection, gbc_lblVerbatimCollection); textFieldVerbCollection = new JTextArea(); textFieldVerbCollection.setEditable(false); textFieldVerbCollection.setRows(3); GridBagConstraints gbc_textFieldVerbCollection = new GridBagConstraints(); gbc_textFieldVerbCollection.gridheight = 2; gbc_textFieldVerbCollection.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbCollection.fill = GridBagConstraints.BOTH; gbc_textFieldVerbCollection.gridx = 1; gbc_textFieldVerbCollection.gridy = 8; panelVerbatimValues.add(textFieldVerbCollection, gbc_textFieldVerbCollection); textFieldVerbCollection.setColumns(30); JLabel lblCollection = new JLabel("Collection"); GridBagConstraints gbc_lblCollection = new GridBagConstraints(); gbc_lblCollection.anchor = GridBagConstraints.EAST; gbc_lblCollection.insets = new Insets(0, 0, 5, 5); gbc_lblCollection.gridx = 3; gbc_lblCollection.gridy = 8; panelVerbatimValues.add(lblCollection, gbc_lblCollection); GridBagConstraints gbc_textFieldCollection = new GridBagConstraints(); gbc_textFieldCollection.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldCollection.gridwidth = 5; gbc_textFieldCollection.insets = new Insets(0, 0, 5, 5); gbc_textFieldCollection.gridx = 4; gbc_textFieldCollection.gridy = 8; panelVerbatimValues.add(getJComboBoxCollection(), gbc_textFieldCollection); JLabel lblVerbatimNumbers = new JLabel("Verbatim Numbers"); GridBagConstraints gbc_lblVerbatimNumbers = new GridBagConstraints(); gbc_lblVerbatimNumbers.anchor = GridBagConstraints.EAST; gbc_lblVerbatimNumbers.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimNumbers.gridx = 0; gbc_lblVerbatimNumbers.gridy = 10; panelVerbatimValues.add(lblVerbatimNumbers, gbc_lblVerbatimNumbers); textFieldVerbNumbers = new JTextArea(); textFieldVerbNumbers.setRows(3); textFieldVerbNumbers.setEditable(false); GridBagConstraints gbc_textFieldVerbNumbers = new GridBagConstraints(); gbc_textFieldVerbNumbers.gridheight = 2; gbc_textFieldVerbNumbers.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbNumbers.fill = GridBagConstraints.BOTH; gbc_textFieldVerbNumbers.gridx = 1; gbc_textFieldVerbNumbers.gridy = 10; panelVerbatimValues.add(textFieldVerbNumbers, gbc_textFieldVerbNumbers); textFieldVerbNumbers.setColumns(30); 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 = 3; gbc_lblNumbers.gridy = 10; panelVerbatimValues.add(lblNumbers, gbc_lblNumbers); JButton btnAddNumber = new JButton("+"); btnAddNumber.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { ((NumberTableModel) jTableNumbers.getModel()) .addNumber(new edu.harvard.mcz.imagecapture.data.Number(null, "", "")); } }); GridBagConstraints gbc_btnAddNumber = new GridBagConstraints(); gbc_btnAddNumber.anchor = GridBagConstraints.EAST; gbc_btnAddNumber.insets = new Insets(0, 0, 5, 5); gbc_btnAddNumber.gridx = 3; gbc_btnAddNumber.gridy = 11; panelVerbatimValues.add(btnAddNumber, gbc_btnAddNumber); GridBagConstraints gbc_numberTable = new GridBagConstraints(); gbc_numberTable.insets = new Insets(0, 0, 5, 5); gbc_numberTable.fill = GridBagConstraints.BOTH; gbc_numberTable.gridx = 4; gbc_numberTable.gridy = 10; gbc_numberTable.gridheight = 2; gbc_numberTable.gridwidth = 5; panelVerbatimValues.add(this.getJScrollPaneNumbers(), gbc_numberTable); JLabel lblVerbatimOtherText = new JLabel("Verbatim Other Text"); GridBagConstraints gbc_lblVerbatimOtherText = new GridBagConstraints(); gbc_lblVerbatimOtherText.anchor = GridBagConstraints.EAST; gbc_lblVerbatimOtherText.insets = new Insets(0, 0, 5, 5); gbc_lblVerbatimOtherText.gridx = 0; gbc_lblVerbatimOtherText.gridy = 12; panelVerbatimValues.add(lblVerbatimOtherText, gbc_lblVerbatimOtherText); textFieldVerbUnclassifiedText = new JTextArea(); textFieldVerbUnclassifiedText.setEditable(false); textFieldVerbUnclassifiedText.setRows(5); GridBagConstraints gbc_textFieldVerbUnclassifiedText = new GridBagConstraints(); gbc_textFieldVerbUnclassifiedText.gridheight = 3; gbc_textFieldVerbUnclassifiedText.insets = new Insets(0, 0, 5, 5); gbc_textFieldVerbUnclassifiedText.fill = GridBagConstraints.BOTH; gbc_textFieldVerbUnclassifiedText.gridx = 1; gbc_textFieldVerbUnclassifiedText.gridy = 12; panelVerbatimValues.add(textFieldVerbUnclassifiedText, gbc_textFieldVerbUnclassifiedText); textFieldVerbUnclassifiedText.setColumns(30); JLabel lblHabitat = new JLabel("Habitat"); GridBagConstraints gbc_lblHabitat = new GridBagConstraints(); gbc_lblHabitat.anchor = GridBagConstraints.EAST; gbc_lblHabitat.insets = new Insets(0, 0, 5, 5); gbc_lblHabitat.gridx = 3; gbc_lblHabitat.gridy = 12; panelVerbatimValues.add(lblHabitat, gbc_lblHabitat); textFieldHabitat = new JTextField(); GridBagConstraints gbc_textFieldHabitat = new GridBagConstraints(); gbc_textFieldHabitat.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldHabitat.gridwidth = 4; gbc_textFieldHabitat.insets = new Insets(0, 0, 5, 5); gbc_textFieldHabitat.gridx = 4; gbc_textFieldHabitat.gridy = 12; panelVerbatimValues.add(textFieldHabitat, gbc_textFieldHabitat); textFieldHabitat.setColumns(10); JLabel lblMicrohabitat = new JLabel("Microhabitat"); GridBagConstraints gbc_lblMicrohabitat = new GridBagConstraints(); gbc_lblMicrohabitat.anchor = GridBagConstraints.EAST; gbc_lblMicrohabitat.insets = new Insets(0, 0, 5, 5); gbc_lblMicrohabitat.gridx = 3; gbc_lblMicrohabitat.gridy = 13; panelVerbatimValues.add(lblMicrohabitat, gbc_lblMicrohabitat); textFieldMicrohabitat = new JTextField(); GridBagConstraints gbc_textFieldMicrohabitat = new GridBagConstraints(); gbc_textFieldMicrohabitat.fill = GridBagConstraints.HORIZONTAL; gbc_textFieldMicrohabitat.gridwidth = 4; gbc_textFieldMicrohabitat.insets = new Insets(0, 0, 5, 5); gbc_textFieldMicrohabitat.gridx = 4; gbc_textFieldMicrohabitat.gridy = 13; panelVerbatimValues.add(textFieldMicrohabitat, gbc_textFieldMicrohabitat); textFieldMicrohabitat.setColumns(10); JLabel lblNewLabel_4 = new JLabel("Workflow Status"); GridBagConstraints gbc_lblNewLabel_4 = new GridBagConstraints(); gbc_lblNewLabel_4.insets = new Insets(0, 0, 5, 5); gbc_lblNewLabel_4.gridx = 3; gbc_lblNewLabel_4.gridy = 15; panelVerbatimValues.add(lblNewLabel_4, gbc_lblNewLabel_4); comboBoxWorkflowStatus = new JComboBox(WorkFlowStatus.getVerbatimClassifiedWorkFlowStatusValues()); comboBoxWorkflowStatus.setSelectedItem(WorkFlowStatus.STAGE_CLASSIFIED); GridBagConstraints gbc_comboBoxWorkflowStatus = new GridBagConstraints(); gbc_comboBoxWorkflowStatus.gridwidth = 4; gbc_comboBoxWorkflowStatus.fill = GridBagConstraints.HORIZONTAL; gbc_comboBoxWorkflowStatus.insets = new Insets(0, 0, 5, 5); gbc_comboBoxWorkflowStatus.gridx = 4; gbc_comboBoxWorkflowStatus.gridy = 15; panelVerbatimValues.add(comboBoxWorkflowStatus, gbc_comboBoxWorkflowStatus); JButton btnApplyToAll = new JButton("Apply To All Records"); GridBagConstraints gbc_btnApplyToAll = new GridBagConstraints(); gbc_btnApplyToAll.gridwidth = 4; gbc_btnApplyToAll.insets = new Insets(0, 0, 5, 5); gbc_btnApplyToAll.gridx = 4; gbc_btnApplyToAll.gridy = 16; panelVerbatimValues.add(btnApplyToAll, gbc_btnApplyToAll); btnApplyToAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveChanges(); } }); } { JPanel panelRelatedData = new JPanel(); contentPanel.add(panelRelatedData); GridBagLayout gbl_panelRelatedData = new GridBagLayout(); gbl_panelRelatedData.maximumLayoutSize(panelRelatedData); gbl_panelRelatedData.columnWidths = new int[] { 20, 33, 1, 0 }; gbl_panelRelatedData.rowHeights = new int[] { 25, 0 }; gbl_panelRelatedData.columnWeights = new double[] { 0.0, 1.0, 0.0, Double.MIN_VALUE }; gbl_panelRelatedData.rowWeights = new double[] { 1.0, Double.MIN_VALUE }; panelRelatedData.setLayout(gbl_panelRelatedData); { JLabel lblTaxa = new JLabel("Taxa"); GridBagConstraints gbc_lblTaxa = new GridBagConstraints(); gbc_lblTaxa.anchor = GridBagConstraints.NORTHEAST; gbc_lblTaxa.insets = new Insets(0, 0, 0, 5); gbc_lblTaxa.gridx = 0; gbc_lblTaxa.gridy = 0; panelRelatedData.add(lblTaxa, gbc_lblTaxa); } JScrollPane scrollPane = new JScrollPane(); // scrollPane.setPreferredSize(new Dimension(1000,100)); GridBagConstraints gbc_scrollPane = new GridBagConstraints(); gbc_scrollPane.anchor = GridBagConstraints.NORTH; gbc_scrollPane.insets = new Insets(0, 0, 0, 5); gbc_scrollPane.fill = GridBagConstraints.BOTH; gbc_scrollPane.gridx = 1; gbc_scrollPane.gridy = 0; panelRelatedData.add(scrollPane, gbc_scrollPane); tableTaxa = new JTable(); SpecimenLifeCycle sls = new SpecimenLifeCycle(); tableTaxa.setModel(new CountValueTableModel(sls.findTaxaFromVerbatim(this.verbatimData), "Current Idenfifications for these verbatim values.")); scrollPane.setViewportView(tableTaxa); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton cancelButton = new JButton("Close"); cancelButton.setActionCommand("Close"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setVisible(false); } }); buttonPane.add(cancelButton); } } }