0

im writing a program to interface with my discord server and i want to implement a function where i can input roleID's using a JComboBox but i cant find any info on whether or not it is possible to make a java program type. code below if it helps:

        insertButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String text = (String)Discord_role_pings.getSelectedItem();
                if (text == "@DND bois"){
                    //dnd bois id
                    pingID = "<@&860555020008685599>";
                } else if (text == "@DND time"){
                    //dnd time id
                    pingID = "<@&839284552329461760>";
                } else if (text == "@DM"){
                    //DM id
                    pingID = "<@&839284419578822686>";
                }else {
                    System.out.println("Error: magic???");
                }
                //info is neat
                System.out.println(pingID);
                //Type in textbox

            }
        });
    }

just to make it clear i need to type in whatever textbox is currently selected not just one form layout

Jakye
  • 6,440
  • 3
  • 19
  • 38

0 Answers0