I am making a calculator and I want to make it that way that when the user's input reaches 26(inputs,so when he types 26 numbers,high unlikely but whatever) that the font of the JTextField will go from 18 to 14, so that more numbers can fit in the JTextField. Any ideas how can i achive that? I would like it to use the if-statement. As I am a beginner at programming I would like the solutionl. I saw another question almost similar but that question was about changing the font when a certain chatacter was entered so please don't mark this as duplicate.
to be simple as possible:p thank you for taking time for this!
I have this but it does not work;
private void TextFieldOutputActionPerformed(java.awt.event.ActionEvent evt) {
if (TextFieldOutput.getText().length()> 26){
Font font=new Font("Arial", Font.BOLD,12);
TextFieldOutput.setFont(font);
}
}