PDA

View Full Version : [JAVA] JCheckBox help evento


Pro7on
22-06-2007, 12:20
come fai capire se un checkBox è attivo?

andbin
22-06-2007, 12:27
come fai capire se un checkBox è attivo?Per attivo intendi che ha il focus? O che è marcato?

Pro7on
22-06-2007, 12:47
Per attivo intendi che ha il focus? O che è marcato?


focus??

si attivato cmq trovato dovrebbe essere setSelected!

andbin
22-06-2007, 12:50
focus??

si attivato cmq trovato dovrebbe essere setSelected!Una cosa è il focus e un'altra cosa è lo stato selezionato/deselezionato del checkbox.

Per il focus vedi: isFocusOwner() e addFocusListener()
Per la selezione vedi: isSelected(), setSelected(), addActionListener() / addItemListener()