Hi ich bräucht emal wieder eure hilfe.
ich habe jetzt soweit meine Gui fertig und müsste nun wissen ob es möglich ist die Java app zu stoppen bis ich eine auswahl in der ersten combobox getroffen habe ...
konkret sieht das so aus
das problen ist halt das er die 2. combobox füllen will aber noch dicht den inex der 1. hat ->
ich habe jetzt soweit meine Gui fertig und müsste nun wissen ob es möglich ist die Java app zu stoppen bis ich eine auswahl in der ersten combobox getroffen habe ...
konkret sieht das so aus
Code:
// //////////////////////////////////////////
// ComboBox
// //////////////////////////////////////////
/////////////////////////////////////////////
// Inhalt ComboBox Host
DBHS[] DB_HN1 = new DBHS[999];
DB_HN1 = Read.read("", 0);
do {
anrX = anrX + 1;
} while (DB_HN1[anrX].hsname != "");
anrFix = anrX;
DBHS[] DB_HN2 = new DBHS[anrFix];
DB_HN2 = Read.read("", anrFix);
DB_HN1 = null;
String[] dateStrings = { pos1, pos2, pos3, pos4, pos5 };
String s[] = new String[anrFix];
anrX = 0;
do {
s[anrX] = DB_HN2[anrX].hsname;
anrX = anrX + 1;
} while (anrX < anrFix);
////////////////////////////////////////////////////////////////
final JComboBox Host = new JComboBox(s);
Host.setSelectedIndex(0);
Host.setBounds(10, 45, 90, 20);
Host.setForeground(Color.BLACK);
f.add(Host);
// Host.addActionListener(a2);
/////////////////////////////////////////////
// Inhalt ComboBox SID
i = Host.getSelectedIndex();
zwi = DB_HN2[i].hsname;
DBHS[] DB_SN1 = new DBHS[999];
DB_HN1 = Read.read(zwi, 0);
do {
anrX = anrX + 1;
} while (DB_SN1[anrX].hsname != "");
anrFix = anrX;
DBHS[] DB_SN2 = new DBHS[anrFix];
DB_HN2 = Read.read(zwi, anrFix);
DB_HN1 = null;
String s2[] = new String[anrFix];
anrX = 0;
do {
zwi = DB_SN2[anrX].hsname;
System.out.println(DB_SN2[anrX].hsname);
s2[anrX] = zwi;
anrX = anrX + 1;
} while (anrX < anrFix);
final JComboBox SID = new JComboBox(dateStrings);
SID.setSelectedIndex(4);
SID.setBounds(110, 45, 100, 20);
SID.setForeground(Color.BLACK);
f.add(SID);
Exception in thread "main" java.lang.NullPointerException
at Gui_v4.main(Gui_v4.java:198)