• Post Reply Bookmark Topic Watch Topic
  • New Topic

Checkbox Verification  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having difficulty finding the code implemented by java.swing which would check the status of a checkbox (i.e. checked or unchecked)

The program I am writing is supposed to change the text size dependant on the state of the checkbox... here is the code...

if (size._____________()) {
message.setFont(new Font("Serif", Font.PLAIN, 36));
}
else {
message.setFont(new Font("Serif", Font.PLAIN, 12));
}
 
Sheriff
Posts: 57834
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Have you been through the API and found JCheckBox? Go through it (possibly with ctrl-F for "selected") and look which methods might show whether the box is selected.
 
We're all out of roofs. But we still have tiny ads:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!