List of usage examples for javax.swing Box add
public Component add(Component comp)
From source file:de.adv_online.aaa.profiltool.ProfilDialog.java
public void initialise(Converter c, Options o, ShapeChangeResult r, String xmi) throws ShapeChangeAbortException { try {/*from www . java2s . co m*/ String msg = "Akzeptieren Sie die in der mit diesem Tool ausgelieferten Datei 'Lizenzbedingungen zur Nutzung von Softwareskripten.doc' beschriebenen Lizenzbedingungen?"; // Meldung if (msg != null) { Object[] options = { "Ja", "Nein" }; int val = JOptionPane.showOptionDialog(null, msg, "Confirmation", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]); if (val == 1) System.exit(0); } } catch (Exception e) { System.out.println("Fehler in Dialog: " + e.toString()); } options = o; File eapFile = new File(xmi); try { eap = eapFile.getCanonicalFile().getAbsolutePath(); } catch (IOException e) { eap = "ERROR.eap"; } converter = new Converter(options, r); result = r; modelTransformed = false; transformationRunning = false; StatusBoard.getStatusBoard().registerStatusReader(this); // frame setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // panel newContentPane = new JPanel(new BorderLayout()); newContentPane.setOpaque(true); setContentPane(newContentPane); newContentPane.add(createMainTab(), BorderLayout.CENTER); statusBar = new StatusBar(); Box fileBox = Box.createVerticalBox(); fileBox.add(createStartPanel()); fileBox.add(statusBar); newContentPane.add(fileBox, BorderLayout.SOUTH); int height = 610; int width = 560; pack(); Insets fI = getInsets(); setSize(width + fI.right + fI.left, height + fI.top + fI.bottom); Dimension sD = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((sD.width - width) / 2, (sD.height - height) / 2); this.setMinimumSize(new Dimension(width, height)); // frame closing WindowListener listener = new WindowAdapter() { public void windowClosing(WindowEvent w) { //JOptionPane.showMessageDialog(null, "Nein", "NO", JOptionPane.ERROR_MESSAGE); closeDialog(); } }; addWindowListener(listener); }
From source file:org.genedb.jogra.plugins.TermRationaliser.java
private Box createRationaliserPanel(final String name, final RationaliserJList rjlist) { int preferredHeight = 500; //change accordingly int preferredWidth = 500; Toolkit tk = Toolkit.getDefaultToolkit(); Dimension size = tk.getScreenSize(); int textboxHeight = 10; //change accordingly int textboxWidth = size.width; Box box = Box.createVerticalBox(); box.add(new JLabel(name)); JTextField searchField = new JTextField(20); //Search field on top /* We don't want this textfield's height to expand when * the Rationaliser is dragged to exapnd. So we set it's * height to what we want and the width to the width of * the screen //from www. ja v a 2 s . c om */ searchField.setMaximumSize(new Dimension(textboxWidth, textboxHeight)); rjlist.installJTextField(searchField); box.add(searchField); JScrollPane scrollPane = new JScrollPane(); //scroll pane scrollPane.setViewportView(rjlist); scrollPane.setPreferredSize(new Dimension(preferredWidth, preferredHeight)); box.add(scrollPane); TitledBorder sysidBorder = BorderFactory.createTitledBorder("Systematic IDs"); //systematic ID box sysidBorder.setTitleColor(Color.DARK_GRAY); final JTextArea idField = new JTextArea(1, 1); idField.setMaximumSize(new Dimension(textboxWidth, textboxHeight)); idField.setEditable(false); idField.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY)); idField.setForeground(Color.DARK_GRAY); JScrollPane scroll = new JScrollPane(idField); scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); Box sysidBox = Box.createVerticalBox(); sysidBox.add(scroll /*idField*/); sysidBox.setBorder(sysidBorder); box.add(sysidBox); rjlist.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { Term highlightedTerm = (Term) rjlist.getSelectedValue(); if (highlightedTerm != null) { /* For each list, call the relevant methods * to get the systematic IDs. Then for the * right list, add the term name in the * text box below */ if (name.equals(FROM_LIST_NAME)) { idField.setText(StringUtils.collectionToCommaDelimitedString( termService.getSystematicIDs(highlightedTerm, selectedTaxons))); } else if (name.equals(TO_LIST_NAME)) { idField.setText(StringUtils.collectionToCommaDelimitedString( termService.getSystematicIDs(highlightedTerm, null))); /* We allow the user to edit the term name */ textField.setText(highlightedTerm.getName()); } } } }); return box; }
From source file:com.orange.atk.graphAnalyser.LectureJATKResult.java
/** This method is called from within the constructor to * initialize the form.//w w w . j a v a2 s.com * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jListGraph = new JList(listModel); jComboBoxLeft = new JComboBox(comboModelLeft); jComboBoxRight = new JComboBox(comboModelRight); jListMarker = new JList(listModelMarker); jTable2 = new javax.swing.JTable(); jMenu1 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jComboBoxLeft.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBoxLeftActionPerformed(evt); } }); jComboBoxRight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBoxRightActionPerformed(evt); } }); jTable2.setModel(modeltable); jMenu1.setText("File"); JMenuItem jMenuItem1 = new JMenuItem(); jMenuItem1.setText("Open Directory"); jMenuItem1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { openDirectoryAction(evt); } }); JMenuItem jMenuItem2 = new JMenuItem(); jMenuItem2.setText("Add a reference Graph"); jMenuItem2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jMenuItemaddGraphActionPerformed(evt); } }); JMenuItem jMenuItem3 = new JMenuItem(); jMenuItem3.setText("set Graph color"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemChangecolorActionPerformed(evt); } }); JMenuItem jMenuItem4 = new JMenuItem(); jMenuItem4.setText("save config file"); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSaveConfigFileActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenu1.add(jMenuItem2); jMenu1.add(jMenuItem3); jMenu1.add(jMenuItem4); JMenuBar jMenuBar1 = new JMenuBar(); jMenuBar1.add(jMenu1); setJMenuBar(jMenuBar1); //organise JFRAME JPanel mainpanel = (JPanel) getContentPane(); mainpanel.setLayout(new BorderLayout()); mainpanel.add(chartPanel, BorderLayout.CENTER); JPanel toolPanel = new JPanel(); toolPanel.setLayout(new FlowLayout()); toolPanel.add(jComboBoxLeft); Box graphbox = Box.createVerticalBox(); graphbox.add(new JLabel("List of Graph ")); JScrollPane jspaneGraph = new JScrollPane(); jspaneGraph.setViewportView(jListGraph); jspaneGraph.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jspaneGraph.setPreferredSize(new Dimension(150, 100)); graphbox.add(jspaneGraph); // graphbox.setBorder(BorderFactory.createLineBorder(Color.black)); toolPanel.add(graphbox); Box markerbox = Box.createVerticalBox(); markerbox.add(new JLabel("List of Marker")); JScrollPane jspaneMarker = new JScrollPane(); jspaneMarker.setViewportView(jListMarker); jspaneMarker.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jspaneMarker.setPreferredSize(new Dimension(150, 100)); markerbox.add(jspaneMarker); // markerbox.setBorder(BorderFactory.createLineBorder(Color.black)); toolPanel.add(markerbox); JScrollPane jspane = new JScrollPane(); jspane.setViewportView(jTable2); jspane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jspane.setPreferredSize(new Dimension(300, 100)); toolPanel.add(jspane); toolPanel.add(jComboBoxRight); mainpanel.add(toolPanel, BorderLayout.NORTH); pack(); }
From source file:desmoj.extensions.visualization2d.engine.modelGrafic.StatisticGrafic.java
/** * Build content for animationType StatisticGrafic.ANIMATION_LastValue * @return//from w w w. j a va 2 s . com */ private JPanel buildLastValuePanel() { JPanel out = new JPanel(); out.setBackground(Grafic.COLOR_BACKGROUND); out.setOpaque(true); out.setLayout(new BorderLayout()); switch (this.statistic.getTypeIndex()) { case Statistic.INDEX_None: this.valueLabel = new JLabel(); this.valueLabel.setFont(Grafic.FONT_BIG); this.valueLabel.setForeground(Grafic.COLOR_FOREGROUND); out.add(this.valueLabel, BorderLayout.CENTER); if (this.isIntValue) out.setPreferredSize(new Dimension(80, 50)); else out.setPreferredSize(new Dimension(100, 50)); break; case Statistic.INDEX_Min_Max: this.valueLabel = new JLabel(); this.valueLabel.setFont(Grafic.FONT_BIG); this.valueLabel.setForeground(Grafic.COLOR_FOREGROUND); out.add(this.valueLabel, BorderLayout.CENTER); ; Box top = Box.createVerticalBox(); this.minLabel = new JLabel(); this.minLabel.setFont(Grafic.FONT_DEFAULT); this.minLabel.setForeground(Grafic.COLOR_FOREGROUND); top.add(this.minLabel); this.maxLabel = new JLabel(); this.maxLabel.setFont(Grafic.FONT_DEFAULT); this.maxLabel.setForeground(Grafic.COLOR_FOREGROUND); top.add(this.maxLabel); out.add(top, BorderLayout.SOUTH); if (this.isIntValue) out.setPreferredSize(new Dimension(80, 70)); else out.setPreferredSize(new Dimension(100, 70)); break; case Statistic.INDEX_Mean_StdDev: this.valueLabel = new JLabel(); this.valueLabel.setFont(Grafic.FONT_BIG); this.valueLabel.setForeground(Grafic.COLOR_FOREGROUND); out.add(this.valueLabel, BorderLayout.CENTER); ; Box bottom = Box.createVerticalBox(); this.meanLabel = new JLabel(); this.meanLabel.setFont(Grafic.FONT_DEFAULT); this.meanLabel.setForeground(Grafic.COLOR_FOREGROUND); bottom.add(this.meanLabel); this.stdDevLabel = new JLabel(); this.stdDevLabel.setFont(Grafic.FONT_DEFAULT); this.stdDevLabel.setForeground(Grafic.COLOR_FOREGROUND); bottom.add(this.stdDevLabel); out.add(bottom, BorderLayout.SOUTH); if (this.isIntValue) out.setPreferredSize(new Dimension(80, 70)); else out.setPreferredSize(new Dimension(100, 70)); break; } return out; }
From source file:com.diversityarrays.kdxplore.scatterplot.ScatterPlotPanel.java
private void addSpinners(Box hbox, JSpinner xSpinner, JSpinner ySpinner) { hbox.add(new JLabel(Msg.LABEL_X_COMMA_Y())); hbox.add(xSpinner);/* ww w .ja v a 2 s. c om*/ hbox.add(new JLabel(",")); //$NON-NLS-1$ hbox.add(ySpinner); }
From source file:greenfoot.gui.export.ExportPublishPane.java
/** * Creates the tag display with popular tags and an option to add tags *///from w w w . ja va2 s.c om private JComponent getTagDisplay() { JComponent tagPanel = new JPanel(new MiksGridLayout(3, 1, 8, 8)); { tagPanel.setBackground(background); JComponent popPanel = new JPanel(new MiksGridLayout(8, 1, 8, 0)); popPanel.setBackground(background); JLabel popLabel = new JLabel(Config.getString("export.publish.tags.popular"), SwingConstants.LEADING); popLabel.setFont(font); popPanel.add(popLabel); for (int i = 0; i < popTags.length; i++) { JCheckBox popTag = new JCheckBox(Config.getString("export.publish.tags.loading")); popTag.setBackground(background); popTag.setFont(font); popTag.setEnabled(false); popTags[i] = popTag; popPanel.add(popTag); } tagPanel.add(popPanel); Box textPanel = new Box(BoxLayout.Y_AXIS); { JLabel additionalLabel = new JLabel(Config.getString("export.publish.tags.additional1"), SwingConstants.LEADING); additionalLabel.setFont(font); textPanel.add(additionalLabel); JLabel additionalLabel2 = new JLabel(Config.getString("export.publish.tags.additional2"), SwingConstants.CENTER); additionalLabel2.setFont(font); textPanel.add(additionalLabel2); } tagPanel.add(textPanel); tagArea = new JTextArea(); tagArea.setRows(3); JScrollPane tagScroller = new JScrollPane(tagArea); tagPanel.add(tagScroller); } return tagPanel; }
From source file:com.diversityarrays.kdxplore.specgroup.SpecimenGroupEditor.java
private JComponent createTopComponent(Action extraAction) { // refreshSpecimenList.setEnabled(false); loadAction.setEnabled(true);// ww w. j ava2 s. co m Box specimenGroupControls = Box.createHorizontalBox(); specimenGroupControls.add(downloadGroupsButton); if (extraAction != null) { specimenGroupControls.add(new JButton(extraAction)); } specimenGroupControls.add(new JSeparator(JSeparator.VERTICAL)); // specimenGroupControls.add(new JButton(refreshSpecimenList)); specimenGroupControls.add(new JButton(loadAction)); specimenGroupTableModel = new SpecimenGroupTableModel(); specimenGroupTable = new JTable(specimenGroupTableModel); specimenGroupTable.setAutoCreateRowSorter(true); TableTransferHandler tth = TableTransferHandler.initialiseForCopySelectAll(specimenGroupTable, true); specimenGroupTable.setTransferHandler(tth); PromptScrollPane pane = new PromptScrollPane("No Specimen Groups Found"); pane.add(specimenGroupTable); specimenGroupTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); specimenGroupTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { List<Specimen> list = null; int vrow = specimenGroupTable.getSelectedRow(); if (vrow >= 0) { int mrow = specimenGroupTable.convertRowIndexToModel(vrow); if (mrow >= 0) { list = specimenGroupTableModel.getSpecimensAt(mrow); } } specimenTableModel.setData(list); } } }); JPanel containerPanel = new JPanel(new BorderLayout()); containerPanel.add(specimenGroupControls, BorderLayout.NORTH); containerPanel.add(new TitledTablePanel("Specimen Groups", specimenGroupTable, "No Specimen Groups Loaded"), BorderLayout.CENTER); return containerPanel; }
From source file:org.apache.jmeter.gui.MainFrame.java
/** * Create the JMeter tool bar pane containing the running indicator. * * @return a panel containing the running indicator *//* w ww . j a v a 2s . c o m*/ private Component createToolBar() { Box toolPanel = new Box(BoxLayout.X_AXIS); // add the toolbar this.toolbar = JMeterToolBar.createToolbar(true); GuiPackage guiInstance = GuiPackage.getInstance(); guiInstance.setMainToolbar(toolbar); toolPanel.add(toolbar); toolPanel.add(Box.createRigidArea(new Dimension(10, 15))); toolPanel.add(Box.createGlue()); toolPanel.add(testTimeDuration); toolPanel.add(Box.createRigidArea(new Dimension(20, 15))); toolPanel.add(errorsOrFatalsLabel); toolPanel.add(warnIndicator); toolPanel.add(Box.createRigidArea(new Dimension(20, 15))); toolPanel.add(activeThreads); toolPanel.add(new JLabel(" / ")); toolPanel.add(totalThreads); toolPanel.add(Box.createRigidArea(new Dimension(10, 15))); toolPanel.add(runningIndicator); return toolPanel; }
From source file:com.diversityarrays.kdxplore.specgroup.SpecimenGroupEditor.java
private JComponent createBottomComponent() { // =========/*from www .j a v a 2s.co m*/ specimenTableModel = new SpecimenTableModel(null); specimenTableModel.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { exportSpecimenList.setEnabled(specimenTableModel.getRowCount() > 0); } }); specimenTable = new JTable(specimenTableModel); specimenTable.setAutoCreateRowSorter(true); specimenTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { deleteSpecimenFromList.setEnabled(specimenTable.getSelectedRowCount() > 0); } } }); // specimenTableModel.addTableModelListener(new TableModelListener() { // @Override // public void tableChanged(TableModelEvent e) { // fileDropTarget.setVisible(specimenTableModel.getRowCount() > 0); // } // }); CompoundBorder border = new CompoundBorder(new LineBorder(Color.DARK_GRAY), new EmptyBorder(4, 2, 4, 2)); fileDropTarget.setBorder(border); fileDropTarget.setBackground(Color.LIGHT_GRAY); // fileDropTarget.setVisible(false); deleteSpecimenFromList.setEnabled(false); TitledTablePanel specimenTablePanel = new TitledTablePanel("Specimen", specimenTable, "Download from database,\n Drag/drop Specimens or Drag/drop CSV File above"); // saveAction.setEnabled(false); // downloadSpecimenList.setEnabled(false); exportSpecimenList.setEnabled(false); Box otherBox = Box.createHorizontalBox(); otherBox.add(downloadSpecimensButton); otherBox.add(fileDropTarget); otherBox.add(Box.createHorizontalGlue()); otherBox.add(new JButton(exportSpecimenList)); otherBox.add(Box.createHorizontalGlue()); otherBox.add(new JLabel("(local)")); otherBox.add(new JButton(deleteSpecimenFromList)); JPanel containerPanel2 = new JPanel(new BorderLayout()); containerPanel2.add(otherBox, BorderLayout.NORTH); containerPanel2.add(specimenTablePanel, BorderLayout.CENTER); fileDropTarget.setTransferHandler(flth); // TableTransferHandler tth2 = TableTransferHandler.initialiseForCopySelectAll(specimenTable, true); // ChainingTransferHandler cth = new ChainingTransferHandler(flth, genotypeTransferHandler, tth2); TransferHandler cth = genotypeTransferHandler; // ChainingTH cth = new ChainingTH(genotypeTransferHandler, tth2); specimenTablePanel.scrollPane.setTransferHandler(cth); specimenTablePanel.setTransferHandler(cth); specimenTable.setTransferHandler(cth); specimenTable.setDragEnabled(true); return containerPanel2; }
From source file:it.iit.genomics.cru.igb.bundles.mi.view.MIResultPanel.java
public MIResultPanel(IgbService service, String summary, List<MIResult> results, String label, MIQuery query) { setLayout(new BorderLayout()); this.label = label; igbLogger = IGBLogger.getInstance(label); colorer = TaxonColorer.getColorer(query.getTaxid()); Box menuBox = new Box(BoxLayout.X_AXIS); Box buttonBox = new Box(BoxLayout.Y_AXIS); Box buttonBox1 = new Box(BoxLayout.X_AXIS); Box buttonBox3 = new Box(BoxLayout.X_AXIS); buttonBox.add(buttonBox1); buttonBox.add(buttonBox3);// w w w . ja v a2s . c o m JTextPane querySummary = new JTextPane(); querySummary.setContentType("text/html"); querySummary.setEditable(false); querySummary.setText(summary); menuBox.add(querySummary); menuBox.add(buttonBox); final JFrame logFrame = new JFrame("MI Bundle Log"); logFrame.setVisible(false); Dimension preferredSize = new Dimension(800, 500); logFrame.setPreferredSize(preferredSize); logFrame.setMinimumSize(preferredSize); logFrame.add(new LogPanel(igbLogger)); JButton log = new JButton(); if (igbLogger.hasError()) { log.setBackground(Color.red); } log.setIcon(CommonUtils.getInstance().getIcon("16x16/actions/console.png")); log.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logFrame.setVisible(true); } }); buttonBox1.add(log); JButton networkButton = new JButton(""); networkButton.setIcon(new ImageIcon(getClass().getResource("/network.jpg"))); networkButton.addActionListener(new DisplayNetworkActionListener()); buttonBox1.add(networkButton); buttonBox1.add(new JSeparator(JSeparator.VERTICAL)); buttonBox1.add(new JLabel("Save: ")); JButton exportButton = new JButton("text"); exportButton.setIcon(CommonUtils.getInstance().getIcon("16x16/actions/save.png")); exportButton.addActionListener(new ExportActionListener()); if (false == MICommons.testVersion) { buttonBox1.add(exportButton); } JButton exportXgmmlButton = new JButton("xgmml"); exportXgmmlButton.setIcon(CommonUtils.getInstance().getIcon("16x16/actions/save.png")); exportXgmmlButton.addActionListener(new ExportXgmmlActionListener()); if (false == MICommons.testVersion) { buttonBox1.add(exportXgmmlButton); } buttonBox1.add(new JSeparator(JSeparator.VERTICAL)); buttonBox1.add(new JLabel("View structure: ")); structures = new StructuresPanel(service, label); buttonBox1.add(structures.getJmolButton()); buttonBox1.add(structures.getLinkButton()); // Filters ButtonGroup scoreGroup = new ButtonGroup(); JRadioButton scoreButton0 = new JRadioButton("<html>" + HTML_SCORE_0 + "</html>"); JRadioButton scoreButton1 = new JRadioButton("<html>" + HTML_SCORE_1 + "</html>"); JRadioButton scoreButton2 = new JRadioButton("<html>" + HTML_SCORE_2 + "</html>"); JRadioButton scoreButton3 = new JRadioButton("<html>" + HTML_SCORE_3 + "</html>"); scoreButton0.setSelected(true); ScoreListener scoreListener = new ScoreListener(); scoreButton0.addActionListener(scoreListener); scoreButton1.addActionListener(scoreListener); scoreButton2.addActionListener(scoreListener); scoreButton3.addActionListener(scoreListener); scoreGroup.add(scoreButton0); scoreGroup.add(scoreButton1); scoreGroup.add(scoreButton2); scoreGroup.add(scoreButton3); buttonBox1.add(new JSeparator(JSeparator.VERTICAL)); buttonBox1.add(new JLabel("Score: ")); buttonBox1.add(scoreButton0); buttonBox1.add(scoreButton1); buttonBox1.add(scoreButton2); buttonBox1.add(scoreButton3); buttonBox3.add(new JLabel("Interaction type: ")); JCheckBox EvidencePhysicalButton = new JCheckBox(HTML_CHECKBOX_PHYSICAL); JCheckBox EvidenceAssociationButton = new JCheckBox(HTML_CHECKBOX_ASSOCIATION); JCheckBox EvidenceEnzymaticButton = new JCheckBox(HTML_CHECKBOX_ENZYMATIC); JCheckBox EvidenceOtherButton = new JCheckBox(HTML_CHECKBOX_OTHER); JCheckBox EvidenceUnspecifiedButton = new JCheckBox(HTML_CHECKBOX_UNSPECIFIED); JCheckBox EvidenceStructureButton = new JCheckBox(HTML_CHECKBOX_STRUCTURE); EvidencePhysicalButton.setSelected(true); EvidenceAssociationButton.setSelected(true); EvidenceEnzymaticButton.setSelected(true); EvidenceOtherButton.setSelected(true); EvidenceUnspecifiedButton.setSelected(true); EvidenceStructureButton.setSelected(true); buttonBox3.add(EvidencePhysicalButton); buttonBox3.add(EvidenceAssociationButton); buttonBox3.add(EvidenceEnzymaticButton); buttonBox3.add(EvidenceOtherButton); buttonBox3.add(EvidenceUnspecifiedButton); buttonBox3.add(EvidenceStructureButton); EvidenceTypeListener evidenceListener = new EvidenceTypeListener(); EvidencePhysicalButton.addActionListener(evidenceListener); EvidenceAssociationButton.addActionListener(evidenceListener); EvidenceEnzymaticButton.addActionListener(evidenceListener); EvidenceOtherButton.addActionListener(evidenceListener); EvidenceUnspecifiedButton.addActionListener(evidenceListener); EvidenceStructureButton.addActionListener(evidenceListener); Box tableBox = new Box(BoxLayout.Y_AXIS); MITableModel model = new MITableModel(results); miTable = new MITable(model, service, query); miTable.setFillsViewportHeight(true); miTable.setStructuresPanel(structures); tableBox.add(miTable.getTableHeader()); tableBox.add(miTable); JScrollPane tableScroll = new JScrollPane(tableBox); tableScroll.setMinimumSize(new Dimension(800, 50)); tableScroll.setPreferredSize(new Dimension(800, 50)); tableScroll.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)); structures.setMinimumSize(new Dimension(200, 500)); structures.setPreferredSize(new Dimension(200, 500)); structures.setMaximumSize(new Dimension(200, Short.MAX_VALUE)); resultBox = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tableScroll, structures); resultBox.setOneTouchExpandable(true); add(menuBox, BorderLayout.NORTH); add(resultBox, BorderLayout.CENTER); }