l'ho modificato in questo modo:
codice:
String[]item = null;
SQLManager sqlm = new SQLManager("com.mysql.jdbc.Driver","jdbc:mysql://localhost:3306/schedule","root","root");
String query = "select cognome from utente";
ResultSet rs= (ResultSet) sqlm.execute(query);
int i=0;
while(rs.next()){
item[i]= rs.getString("Cognome");
i++;
}
JComboBox jComboDocenti = new JComboBox(item);
PannelloBottoni.add(jComboDocenti);
jComboDocenti.setBounds(1104, 120, 145, 22);
sqlm.close();
e mi da le seguenti eccezioni:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.schedule.oggetti.InsegnamentiAdmin.leggitabell a2(InsegnamentiAdmin.java:250)
at org.schedule.pannelli.PannelloAdminStart$2.actionP erformed(PannelloAdminStart.java:140)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMous
perkè???