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
  • JcomboBox help


    nolife33033

    Recommended Posts

    I am working with JcomboBox's for my GUI to select Locations and Type of Ore. I can not figure out how to set it up so that If Lumbridge is selected it only shows the ore's that are available at lumbridge mine to select from.

     

    P.s I use JForm Designer

    Link to comment
    Share on other sites

    Hello @nolife33033 , you wanna do something like this 
     

    LocationBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            
    switch (getFishArea()) {
        case "Lumbridge swamp":
            FishType.removeAllItems();
            FishType.addItem("Net/Bait (level 1,Small fishing net)");
            FishType.addItem("Net/Bait (level 5,Fishing rod,Fishing bait)");
            break;
    
        case "Draynor village":
            FishType.removeAllItems();
            FishType.addItem("Net/Bait (level 1,Small fishing net)");
            FishType.addItem("Net/Bait (level 5,Fishing rod,Fishing bait)");
    
            break;
    
        }
    });
    
    Link to comment
    Share on other sites

    10 minutes ago, Hosfad said:

    Hello @nolife33033 , you wanna do something like this 
     

    LocationBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            
    switch (getFishArea()) {
        case "Lumbridge swamp":
            FishType.removeAllItems();
            FishType.addItem("Net/Bait (level 1,Small fishing net)");
            FishType.addItem("Net/Bait (level 5,Fishing rod,Fishing bait)");
            break;
    
        case "Draynor village":
            FishType.removeAllItems();
            FishType.addItem("Net/Bait (level 1,Small fishing net)");
            FishType.addItem("Net/Bait (level 5,Fishing rod,Fishing bait)");
    
            break;
    
        }
    });
    

    The get fish area method is just LocationBox.getSelectedItem.toString()

    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.