There is a form:
Next, the context menu of the “AND” button is called (for each button), then Events – Action – ActionPerformed selected Events – Action – ActionPerformed 
Why fields are underlined?
In this scope, the b1 and b2 fields do not exist.
Make them global, that is, declare inside a class, not methods. However, inside the methods you can switch field values depending on the state of the switches on the form.
class Class { boolean b1 = false, b2 = false; } Personal recommendation: make associative, mnemonic names.
Source: https://ru.stackoverflow.com/questions/520199/
All Articles