// Create a select box for tree options
JComboBox<String> treeSelector = new JComboBox<>(new String[]{"Tree", "Oak"});
// Add an action listener, to listen for user's selections, assign to a variable called selectedTree on selection.
treeSelector.addActionListener(e -> selectedTree = treeSelector.getSelectedItem().toString());
I was using this code, but if I choose 'Tree' the client crashes, well, the CPU goes to 100% and I have to force quit, but if I choose 'Oak' then it works perfectly fine. I added another option in front of 'Tree' and now 'Tree' works in second position but the 'Oak' options is now causing the problem.