Fonts (Changing Fonts and Color's)
I am trying to make it so that the following code changes fonts and color
Code:
if (outputBmi < 18.5) {
txtResults.setText("Underweight");
//Needs to be orange
txtResults.setFont(new Font("Serif", BOLD, 18));
} else{
if (outputBmi > 24.9){
txtResults.setText("Overweight");
//Needs to be red
} else
txtResults.setText("OK");
//needs to be green
The line Code:
txtResults.setFont(new Font("Serif", BOLD, 18));
gives me an error, it doesnt like BOLD, I thought that the import java.awt.*; contained the library for fonts so surely BOLD should not casue this problem?
I am also looking to change the colour as per comments under each statement.
Thanks in advance for any assistance