List of usage examples for javax.swing.table DefaultTableModel DefaultTableModel
public DefaultTableModel(Object[][] data, Object[] columnNames)
DefaultTableModel
and initializes the table by passing data
and columnNames
to the setDataVector
method. From source file:com.emr.schemas.EditMappingsForm.java
/** * Constructor//from w w w .j ava 2s . c om * @param mpiConn {@link Connection} Connection object for the MPI Database * @param emrConn {@link Connection} Connection object for the EMR Database * @param selected_columns {@link List} List of the selected source columns * @param destinationTable {@link String} The destination table * @param sourceQuery {@link String} The query for getting the data to be moved * @param sourceTables {@link List} List of source tables * @param relations {@link String} Relationships between the source tables */ public EditMappingsForm(Connection mpiConn, Connection emrConn, List selected_columns, String destinationTable, String sourceQuery, List sourceTables, String relations, DestinationTables parent) { this.mpiConn = mpiConn; this.emrConn = emrConn; this.selected_columns = selected_columns; this.destinationTable = destinationTable; this.sourceQuery = sourceQuery; this.sourceTables = sourceTables; this.relations = relations; this.parent = parent; columnsToBeMapped = new ArrayList(); query = ""; insertQuery = ""; selectQuery = ""; model = new DefaultTableModel(new Object[] { "Source", "Destination", "Apply Mappings?" }, selected_columns.size()); initComponents(); this.setClosable(true); ComboBoxTableCellEditor sourceColumns = new ComboBoxTableCellEditor(selected_columns, new JComboBox()); ComboBoxTableCellEditor destinationColumnsEditor = new ComboBoxTableCellEditor( getTableColumns(destinationTable), new JComboBox()); mappingsTable.getColumnModel().getColumn(0).setCellEditor(sourceColumns); mappingsTable.getColumnModel().getColumn(1).setCellEditor(destinationColumnsEditor); /*Action foreignKeysMap = new AbstractAction(){ @Override public void actionPerformed(ActionEvent e) { JTable table = (JTable)e.getSource(); int modelRow = Integer.valueOf( e.getActionCommand() ); String foreignKeysTable=(String)mappingsTable.getModel().getValueAt(modelRow, 0); if(foreignKeysTable==null || "".equals(foreignKeysTable)){ JOptionPane.showMessageDialog(null, "Column Mappings not defined", "Empty Column Mappings", JOptionPane.ERROR_MESSAGE); }else{ String tablename=foreignKeysTable.substring(0, foreignKeysTable.lastIndexOf(".")); String column=foreignKeysTable.substring(foreignKeysTable.lastIndexOf(".") + 1,foreignKeysTable.length()); System.out.println("Table: " + tablename + ", Column: " + column); //open form for mapping the source foreign table to the destination foreign table JDesktopPane desktopPane = getDesktopPane(); ForeignDataMover frm=new ForeignDataMover(emrConn,mpiConn,foreignKeysTable); desktopPane.add(frm); frm.setVisible(true); frm.setSize(400, 400); frm.setLocation(120,60); frm.moveToFront(); btnMoveData.setEnabled(false); frm.addInternalFrameListener(new InternalFrameListener() { @Override public void internalFrameOpened(InternalFrameEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void internalFrameClosing(InternalFrameEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void internalFrameClosed(InternalFrameEvent e) { btnMoveData.setEnabled(true); } @Override public void internalFrameIconified(InternalFrameEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void internalFrameDeiconified(InternalFrameEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void internalFrameActivated(InternalFrameEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void internalFrameDeactivated(InternalFrameEvent e) { //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }); } } }; ButtonColumn buttonColumn = new ButtonColumn(mappingsTable, foreignKeysMap, 2);*/ CheckboxColumn checkboxColumn = new CheckboxColumn(mappingsTable, 2); grp = new ButtonGroup(); grp.add(radioAppendRows); grp.add(radioDeleteRows); }
From source file:org.datacleaner.widgets.result.UniqueKeyCheckAnalyzerResultSwingRenderer.java
@Override public JComponent render(UniqueKeyCheckAnalyzerResult result) { final int nullCount = result.getNullCount(); final int nonUniqueCount = result.getNonUniqueCount(); final DefaultKeyedValues keyedValues = new DefaultKeyedValues(); keyedValues.addValue("Unique keys", result.getUniqueCount()); final List<Title> subTitles = new ArrayList<Title>(); subTitles.add(new ShortTextTitle("Row count: " + result.getRowCount())); subTitles.add(new ShortTextTitle("Unique key count: " + result.getUniqueCount())); if (nonUniqueCount > 0) { keyedValues.addValue("Non-unique keys", nonUniqueCount); subTitles.add(new ShortTextTitle("Non-unique key count: " + nonUniqueCount)); }//from w w w . j a v a 2s. co m final String title; if (nullCount == 0) { title = "Unique and non-unique keys"; } else { keyedValues.addValue(LabelUtils.NULL_LABEL, nullCount); title = "Unique, non-unique and <null> keys"; subTitles.add(new ShortTextTitle("<null> key count: " + result.getNullCount())); } final DefaultPieDataset dataset = new DefaultPieDataset(keyedValues); final JFreeChart chart = ChartFactory.createRingChart(title, dataset, true, true, false); chart.setSubtitles(subTitles); ChartUtils.applyStyles(chart); ChartPanel chartPanel = ChartUtils.createPanel(chart, false); final DCPanel leftPanel = new DCPanel(); leftPanel.setLayout(new VerticalLayout()); leftPanel.add(WidgetUtils.decorateWithShadow(chartPanel)); final Map<String, Integer> samples = result.getNonUniqueSamples(); if (samples == null || samples.isEmpty()) { return leftPanel; } final DefaultTableModel samplesTableModel = new DefaultTableModel(new String[] { "Key", "Count" }, 0); for (final Entry<String, Integer> entry : samples.entrySet()) { final String key = entry.getKey(); final Integer count = entry.getValue(); samplesTableModel.addRow(new Object[] { key, count }); } final DCTable samplesTable = new DCTable(samplesTableModel); final DCPanel rightPanel = new DCPanel(); rightPanel.setLayout(new BorderLayout()); rightPanel.add(DCLabel.dark("Sample non-unique keys:")); rightPanel.add(samplesTable.toPanel(), BorderLayout.CENTER); final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split.setOpaque(false); split.add(leftPanel); split.add(rightPanel); split.setDividerLocation(550); return split; }
From source file:com.jtk.pengelolaanujian.controller.panitiaController.PrintSoalController.java
public void viewTableListPrintSoalSeluruh(JTable tableViewListPrintSoal) { List<Soal> soalList = null; SoalFacade soalFacade = new SoalFacade(); soalList = soalFacade.findAllWhereVNVtrue(); Object[] columnsName = { "Kode Soal", "Kode MatKul", "MatKul", "Dosen Pengampu" }; DefaultTableModel dtm = new DefaultTableModel(null, columnsName) { @Override//from w w w . j a va 2s . c o m public boolean isCellEditable(int row, int column) { return false; } }; for (Soal soal : soalList) { Object[] o = new Object[4]; o[0] = soal.getSoalKode(); o[1] = soal.getMataKuliah().getMatkulKode(); o[2] = soal.getMataKuliah().getMatkulNama(); o[3] = soal.getMataKuliah().getDosen().getStafNama(); dtm.addRow(o); } tableViewListPrintSoal.setModel(dtm); }
From source file:org.eobjects.datacleaner.widgets.result.UniqueKeyCheckAnalyzerResultSwingRenderer.java
@Override public JComponent render(UniqueKeyCheckAnalyzerResult result) { final int nullCount = result.getNullCount(); final int nonUniqueCount = result.getNonUniqueCount(); final DefaultKeyedValues keyedValues = new DefaultKeyedValues(); keyedValues.addValue("Unique keys", result.getUniqueCount()); final List<Title> subTitles = new ArrayList<Title>(); subTitles.add(new ShortTextTitle("Row count: " + result.getRowCount())); subTitles.add(new ShortTextTitle("Unique key count: " + result.getUniqueCount())); if (nonUniqueCount > 0) { keyedValues.addValue("Non-unique keys", nonUniqueCount); subTitles.add(new ShortTextTitle("Non-unique key count: " + nonUniqueCount)); }/* w w w .j a v a 2 s. c o m*/ final String title; if (nullCount == 0) { title = "Unique and non-unique keys"; } else { keyedValues.addValue(LabelUtils.NULL_LABEL, nullCount); title = "Unique, non-unique and <null> keys"; subTitles.add(new ShortTextTitle("<null> key count: " + result.getNullCount())); } final DefaultPieDataset dataset = new DefaultPieDataset(keyedValues); final JFreeChart chart = ChartFactory.createRingChart(title, dataset, true, true, false); chart.setSubtitles(subTitles); ChartUtils.applyStyles(chart); ChartPanel chartPanel = new ChartPanel(chart); final DCPanel leftPanel = new DCPanel(); leftPanel.setLayout(new VerticalLayout()); leftPanel.add(WidgetUtils.decorateWithShadow(chartPanel, true, 4)); final Map<String, Integer> samples = result.getNonUniqueSamples(); if (samples == null || samples.isEmpty()) { return leftPanel; } final DefaultTableModel samplesTableModel = new DefaultTableModel(new String[] { "Key", "Count" }, 0); for (final Entry<String, Integer> entry : samples.entrySet()) { final String key = entry.getKey(); final Integer count = entry.getValue(); samplesTableModel.addRow(new Object[] { key, count }); } final DCTable samplesTable = new DCTable(samplesTableModel); final DCPanel rightPanel = new DCPanel(); rightPanel.setLayout(new BorderLayout()); rightPanel.add(DCLabel.dark("Sample non-unique keys:")); rightPanel.add(samplesTable.toPanel(), BorderLayout.CENTER); final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split.setOpaque(false); split.add(leftPanel); split.add(rightPanel); split.setDividerLocation(550); return split; }
From source file:correlation.and.regression.analysis.MainWindow.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./* w w w .j a v a2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jFileChooser1 = new javax.swing.JFileChooser(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); jSPanelChart = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTblStatistic = new javax.swing.JTable(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jScrollPane3 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jLabelDet = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabelFtest = new javax.swing.JLabel(); jLabelRes = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout jSPanelChartLayout = new javax.swing.GroupLayout(jSPanelChart); jSPanelChart.setLayout(jSPanelChartLayout); jSPanelChartLayout.setHorizontalGroup(jSPanelChartLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 607, Short.MAX_VALUE)); jSPanelChartLayout.setVerticalGroup(jSPanelChartLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 428, Short.MAX_VALUE)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSPanelChart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSPanelChart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jTabbedPane1.addTab("", jPanel1); modelStatistic = new DefaultTableModel( new Object[][] { { "Mean", "Mark", null, null }, { "", "Interval", null, null }, { "Mean square", "Mark", null, null }, { "", "Interval", null, null }, { "Coefficient asymmetry", "Mark", null, null }, { "", "Interval", null, null }, { "Coefficient excess", "Mark", null, null }, { "", "Interval", null, null } }, new String[] { "", "", "X", "Y" }); jTblStatistic.setModel(modelStatistic); jScrollPane1.setViewportView(jTblStatistic); modelCoefCorr = new DefaultTableModel(new Object[] { "", "", "?", "", "?", "." }, 4); modelCoefCorr.setValueAt(" ?. .", 0, 0); modelCoefCorr.setValueAt(". ", 1, 0); modelCoefCorr.setValueAt("-", 1, 5); modelCoefCorr.setValueAt("?. ", 2, 0); modelCoefCorr.setValueAt("-", 2, 5); modelCoefCorr.setValueAt("?. ", 3, 0); modelCoefCorr.setValueAt("-", 3, 5); jTable1.setModel(modelCoefCorr); jScrollPane2.setViewportView(jTable1); modelEstem = new DefaultTableModel(new Object[] { "", " ", "???", "?", "", "?", "." }, 2); modelEstem.setValueAt("a", 0, 0); modelEstem.setValueAt("b", 1, 0); jTable2.setModel(modelEstem); jScrollPane3.setViewportView(jTable2); jLabel1.setText("? :"); jLabel2.setText("f:"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 587, Short.MAX_VALUE) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane3) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabelDet)) .addGroup(jPanel2Layout.createSequentialGroup().addComponent(jLabel2) .addGap(18, 18, 18).addComponent(jLabelFtest).addGap(70, 70, 70) .addComponent(jLabelRes))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(jLabelDet)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(jLabelFtest).addComponent(jLabelRes)) .addContainerGap(22, Short.MAX_VALUE))); jTabbedPane1.addTab("", jPanel2); jMenu1.setText(""); jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText(""); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1)); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1)); pack(); }
From source file:de.main.sessioncreator.ReportingHelper.java
public DefaultTableModel getTableModel() { charterMap.clear();/* w w w .j a v a2 s. c om*/ getCharterBackgroundW(directory); Set<String> keys = charterMap.keySet(); String col[] = { "Charter", "Number of Testsessions" }; DefaultTableModel model = new DefaultTableModel(null, col) { @Override public boolean isCellEditable(int row, int column) { return false; } }; for (String k : keys) { model.insertRow(0, new Object[] { k, charterMap.get(k) }); } return model; }
From source file:com.plugin.UI.Windows.BiblePeopleSearchResultsDialog.java
/** * Initialize.//from www .j av a 2 s.co m * * @param _term the _term * * @throws Exception the exception */ private void initialize(String _term) throws Exception { ArrayList<String[]> arr = new ArrayList<String[]>(); for (BiblePerson bp : Global.biblePersons) { if (isSoundexCalc(bp.getName().toUpperCase(), _term)) { String[] arrin = new String[5]; arrin[0] = String.valueOf(bp.getName_id()); arrin[1] = bp.getName(); arrin[2] = bp.getFather(); arrin[3] = bp.getMother(); arrin[4] = bp.getBible_ref(); arr.add(arrin); } } String[][] arr3 = new String[arr.size()][5]; for (int i = 0; i < arr.size(); i++) arr3[i] = arr.get(i); String columns[] = new String[] { "ID", "Name", "Father", "Mother", "Reference" }; tm = new DefaultTableModel(arr3, columns) { public boolean isCellEditable(int row, int column) { return false; } }; table = new JTable(tm); table.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { int member_id = Integer.parseInt((String) tm.getValueAt(table.getSelectedRow(), 0)); BibleGenealogy.setSelectMember(member_id); if (e.getClickCount() == 2) { new BiblePersonDialog(Global._jMainFrame, member_id); } } public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub } public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); JScrollPane jsp = new JScrollPane(table); jsp.setSize(640, 260); this.getContentPane().add(jsp); this.pack(); this.setTitle("Bible People Search Results - " + _term); this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setLocationRelativeTo(null); this.setVisible(true); }
From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.chartdemo.TableJFreeChartDemo.java
private TableModel createTableModel() { final Object[][] data = new Object[12 * 5][]; final int[] votes = new int[5]; for (int i = 0; i < 12; i++) { final Integer year = new Integer(1995 + i); votes[0] = (int) (Math.random() * 200); votes[1] = (int) (Math.random() * 50); votes[2] = (int) (Math.random() * 100); votes[3] = (int) (Math.random() * 50); votes[4] = (int) (Math.random() * 100); final JFreeChart chart = createChart(year.intValue(), votes); data[i * 5] = new Object[] { year, "Java", new Integer(votes[0]), chart }; data[i * 5 + 1] = new Object[] { year, "Visual Basic", new Integer(votes[1]), chart }; data[i * 5 + 2] = new Object[] { year, "C/C++", new Integer(votes[2]), chart }; data[i * 5 + 3] = new Object[] { year, "PHP", new Integer(votes[3]), chart }; data[i * 5 + 4] = new Object[] { year, "Perl", new Integer(votes[4]), chart }; }//from ww w . jav a 2s. c om final String[] colNames = { "year", "language", "votes", "chart" }; return new DefaultTableModel(data, colNames); }
From source file:com.mirth.connect.client.ui.RegexAttachmentDialog.java
private void initInboundReplacementTable() { inboundReplacementTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); DefaultTableModel model = new DefaultTableModel(new Object[][] {}, new String[] { "Replace All", "Replace With" }) { public boolean isCellEditable(int rowIndex, int columnIndex) { return true; }/*from w w w . jav a 2s .c o m*/ @Override public void setValueAt(Object value, int row, int column) { if (!value.equals(getValueAt(row, column))) { parent.setSaveEnabled(true); } super.setValueAt(value, row, column); } }; inboundReplacementTable.setSortable(false); inboundReplacementTable.getTableHeader().setReorderingAllowed(false); inboundReplacementTable.setModel(model); inboundReplacementTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { inboundDeleteButton.setEnabled(inboundReplacementTable.getSelectedRow() != -1); } }); if (Preferences.userNodeForPackage(Mirth.class).getBoolean("highlightRows", true)) { inboundReplacementTable.setHighlighters(HighlighterFactory .createAlternateStriping(UIConstants.HIGHLIGHTER_COLOR, UIConstants.BACKGROUND_COLOR)); } inboundDeleteButton.setEnabled(false); }
From source file:com.plugin.UI.Windows.UserSearchResultsDialog.java
/** * Initialize.// ww w . j ava2s .c o m * * @param _term the _term * * @throws Exception the exception */ private void initialize(String _term) throws Exception { ArrayList<String[]> arr = new ArrayList<String[]>(); for (ChurchMembersData mem : ChurchMemberUtils.getChurchMembers()) { if (isSoundex(mem, _term.toUpperCase())) { String[] arrin = new String[5]; arrin[0] = MemberID.getTranslatedID(mem.getMember_id(), mem.getName_english()); arrin[1] = mem.getName_english() + " (" + mem.getName_otherLang() + ")"; arrin[2] = mem.getStreet(); arrin[3] = mem.getSuburb(); arrin[4] = mem.getState(); arr.add(arrin); } } String[][] arr3 = new String[arr.size()][5]; for (int i = 0; i < arr.size(); i++) arr3[i] = arr.get(i); String columns[] = new String[] { "MemberID", "Name", "Street", "Suburb", "State" }; tm = new DefaultTableModel(arr3, columns) { public boolean isCellEditable(int row, int column) { return false; } }; table = new JTable(tm); table.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { String member_id = (String) tm.getValueAt(table.getSelectedRow(), 0); ChurchMembers.setSelectMember(member_id); if (e.getClickCount() == 2) { new MemberDialog(Global.DISPLAY_CHURCH_MEMBER, MemberID.getOriginalID(member_id)); } } public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub } public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); JScrollPane jsp = new JScrollPane(table); jsp.setSize(640, 260); this.getContentPane().add(jsp); this.pack(); this.setTitle("Church Members Search Results - " + _term); this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setLocationRelativeTo(null); this.setVisible(true); }