Splitting the text and writing to combo box

30
June 09, 2021, at 07:10 AM

It's only writes to comboBox1. What's the problem? Why doesn't it write to other combo boxes?

JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(this);
try {
    FileReader fr = new FileReader("C:\\Users\\hatice\\Desktop\\191220009_KursadBugrahan_Yapar\\src\\lab7\\konfigurasyon.txt");
    BufferedReader br = new BufferedReader(fr);
    String line = br.readLine();
    
    while(line != null){
        String[] name = line.split("//");
        switch(name[0]){
            case "tank":
                jComboBox1.addItem(name[1]);
                break;
            case "büyücü":
                jComboBox2.addItem(name[1]);
                break;
            case "nişancı":
                jComboBox3.addItem(name[1]);
                break;
            case "suikastçi":
                jComboBox4.addItem(name[1]);
                break;
        }
        
        line = br.readLine();
    }
    
} catch (FileNotFoundException ex) {
    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
READ ALSO
Complex RegEx pattern Extractor Logic [closed]

Complex RegEx pattern Extractor Logic [closed]

Want to improve this question? Update the question so it focuses on one problem only by editing this post

62
Problem with getting JSON to android app, propably problem with url

Problem with getting JSON to android app, propably problem with url

I think i did something wrong with string named "url", but im not sure what should i change, what am i doing wrong?

47
JavaScript heap out of memory? Now I can't even use npm?

JavaScript heap out of memory? Now I can't even use npm?

UPDATE: so, tried chancing memory size, now I can't even use "npm" commands at all to download new filesEverything throws a memory issue

54
base_url () function is not working ( Code ignitor)

base_url () function is not working ( Code ignitor)

im new to php and recently im trying to load my html and css file into the code ignitorThus, my website wont load when i try to link between pages using href, id be so grateful if anyone can point out my mistakes, thankyou

58