08/05/10 12:37
tekdu
se ho ben capito il problema credo che dovresti fare qlks del genere:
e poi per ricercare
+ o - dovrebbe funzionare...
public int findIndex(String Name) throws Exception{ for(int i=0;i<vector.size();i++){ if ((oggetto)(vector.get(i)).getName.compareTo(Name)==1) return i; } } throw new Exception("not found"); }
e poi per ricercare
this.btnSearch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { try { int i= findIndex(txtField.getText()); Jtable.setSelectedIndex(i); } catch (Exception e1) { JOptionPane.showMessageDialog(MainWindow.this, e1.getMessage(), "not found", JOptionPane.ERROR_MESSAGE); } } });
+ o - dovrebbe funzionare...
aaa
08/05/10 12:37
tekdu
se ho ben capito il problema credo che dovresti fare qlks del genere:
e poi per ricercare
+ o - dovrebbe funzionare...
public int findIndex(String Name) throws Exception{ for(int i=0;i<vector.size();i++){ if ((oggetto)(vector.get(i)).getName.compareTo(Name)==1) return i; } } throw new Exception("not found"); }
e poi per ricercare
this.btnSearch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { try { int i= findIndex(txtField.getText()); Jtable.setSelectedIndex(i); } catch (Exception e1) { JOptionPane.showMessageDialog(MainWindow.this, e1.getMessage(), "not found", JOptionPane.ERROR_MESSAGE); } } });
+ o - dovrebbe funzionare...
aaa