I have a program, that whenever you type something and hit enter, it prints it out in a window (it's basically a command prompt). However, due to a few problems with a calculator function I'm trying to add, if the user input is a number, I want it to totally ignore it
input = new JTextField();
input.setEditable(true);
input.setForeground(Color.WHITE);
input.setCaretColor(Color.WHITE);
input.setOpaque(false);
input.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
String text = input.getText();
if (text.length() >= 1){
print(text + "\n", false);
doCommand(text);
scrollBottom();
input.selectAll();
}
}
});