combobox'a veri eklemeye çalışırken non-static variable jComboBox1 cannot be referenced from a static context hatası alıyorum
private static String readUrl(String urlString) throws Exception { BufferedReader reader = null; try { URL url = new URL(urlString); reader = new BufferedReader(new InputStreamReader(url.openStream())); StringBuffer buffer = new StringBuffer(); int read; char[] chars = new char[1024]; while ((read = reader.read(chars)) != -1) buffer.append(chars, 0, read);
return buffer.toString(); } finally { if (reader != null) reader.close(); } } public static class MySQLEntry { public String id; public static String ad; public String latitude; public String longitude; public String speed; public String hour; public String day; public String adres; public String resimyol;
public String getId() { return id; } public static String getName() { return ad; } public String getlat() { return latitude; } public String getlon() { return longitude; } public String getspeed() { return speed; } public String gethour() { return hour; } public String getday() { return day; } public String getadres() { return adres; } public String getresim() { return resimyol; }
}
public static void main(String args[]) {
/* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details seehttp://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(KonumGoster.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(KonumGoster.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(KonumGoster.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(KonumGoster.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold>
/* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new KonumGoster().setVisible(true);
DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.
Üye Ol Şimdi DeğilÜye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.