txtOutput.setBackground(Color.WHITE);
double score;
String output="";
score=Double.parseDouble(txtScore.getText());
if(score>=60){
output="考试通过";
txtOutput.setBackground(Color.green);
txtOutput.setText(output);
}else{
output="考试未通过";
txtOutput.setBackground(Color.red);
txtOutput.setText(output);
}
简单判断颜色
最新推荐文章于 2024-07-31 19:38:21 发布