per riempire una jcombobox facevo così:
codice:
package operazioni_database;

import java.sql.*;
import libreria.*;

public class DoFillCBAuthor {

    public static void fillAuthor() throws SQLException, ClassNotFoundException {
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;
        conn = DoConnection.getConnection();
        stmt = conn.createStatement();
        rs = stmt.executeQuery("SELECT * FROM author");
        while (rs.next()) {
            FramePrincipale.getComboAuthor().addItem(new Author(rs.getInt("author_id"), rs.getString("author_name")));
        }
        rs.close();
        stmt.close();
    }
}
ho pensato che nn fosse la maniera migliore e ho provato con ArrayList:
codice:
package operazioni_database;

import java.sql.*;
import java.util.ArrayList;

public class FillAuthor {

    public static ArrayList fillAuthor() throws SQLException, ClassNotFoundException {
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;
        ArrayList list = new ArrayList();
        conn = DoConnection.getConnection();
        stmt = conn.createStatement();
        rs = stmt.executeQuery("SELECT * FROM author ORDER BY author_id");
        while (rs.next()) {
            list.add(new Author(rs.getInt("author_id"), rs.getString("author_name")));
        }
        rs.close();
        stmt.close();
        return list;
    }
}
nel jframe:
codice:
        ArrayList list = FillAuthor.fillAuthor();
        comboUpAuthor.addItem(list);
il problema è che nn va mai a capo.
mi fa vedere tutti gli autori su una riga invece di "spezzarli".
come posso separare i vari risultati??

ArrayList va bene per riempire la jcombobox o c'è qualcos'altro di meglio??