Visualizzazione dei risultati da 1 a 4 su 4

Visualizzazione discussione

  1. #2
    Qualcuno potrebbe darmi qualche dritta su quale algoritmo utilizzare?


    Questo è il metodo che avevo cominciato a scrivere. E' la strada giusta?

    codice:
    public void writeTable() {
    
            for (int row = 0; row <= main.getJTable().getRowCount(); row++) {
                for (int col = 0; col <= main.getJTable().getColumnCount(); col++) {
                    String find = (String) main.getJTable().getModel().getValueAt(row, 10).toString();
    
                    if (find.equals("testoDaCercare")) {
    
                        index = row;
                        for (int i = 0; i < this.getTable().getRowCount(); i++) {
                            if (this.getTable().getValueAt(i, 0) == null) {
                                index1 = i;
                            }
                       
                        }
     //main.getJTable() è il riferimento alla tabella origine del primo frame
           
                this.getTable().setValueAt(main.getJTable().getValueAt(index, 0), index1, 0);
                this.getTable().setValueAt(main.getJTable().getValueAt(index, 1), index1, 1);
                this.getTable().setValueAt(main.getJTable().getValueAt(index, 2), index1, 2);
                this.getTable().setValueAt(main.getJTable().getValueAt(index, 3), index1, 3);
    Grazie
    Ultima modifica di marcotto68; 30-12-2013 a 00:15

Tag per questa discussione

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.