Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Gui Class not passing variables


    crazykid080

    Recommended Posts

    I decided to throw it into my main class and I added some more debugs

    doneButton.addActionListener(e -> {
                log("Fired");
                if (itemCB.isSelected()) {
                    log(Item);
                    utils.items.add(Item);
                }
                if (ItemBCB.isSelected()) {
                    log("ItemB");
                    utils.items.add("ItemB");
                }
                if (itemCCB.isSelected()) {
                    log("ItemC");
                    utils.items.add("ItemC");
                }
                if (itemDCB.isSelected()) {
                    log("ItemD");
                    utils.items.add("ItemD");
                }
                if (itemECB.isSelected()) {
                    log("ItemE");
                    utils.items.add("ItemE");
                }
                if (itemFCB.isSelected()) {
                    log("ItemF");
                    utils.items.add("ItemF");
                }
            });

    Oddly enough, despite having multiple options selected it only gets through one. I think the issue is the List#add call

    Link to comment
    Share on other sites

    42 minutes ago, crazykid080 said:

    Fixed it. Lesson learned: Use ArrayList, not List.

    Nice. I didn't catch that you hadn't initialized it. List = new ArrayList<>() would have worked as well.

    Link to comment
    Share on other sites

    6 minutes ago, holic said:

    Nice. I didn't catch that you hadn't initialized it. List = new ArrayList<>() would have worked as well.

    Yeah. All that suffering and confusion for something so simple. Oh well, live and learn

    Link to comment
    Share on other sites

    If you're using IntelliJ, when you hit an issue like this press F2 and it should highlight bits of code that pose potential problems or can be simplified. I think I mentioned it to you before, its good advice 98% of the time but sometimes it fucks your code and it'll be obvious when it does that.

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.