Many of Swing's core components follow a simple getter/setter pattern.
That is, you can "get" a property value and "set" a property value (note, not all getters have a corresponding setter though).
In the case of a boolean
property, the convention is to use "is" instead of "get", it just rolls off the tongue better.
So, in your case, all you are doing is getting the value if the selected
property, not really what you want to do.
Instead use jToggleButton1.setSelected(true)
or jToggleButton1.setSelected(false)
based on your needs
You might like to take a look at How to Use Buttons, Check Boxes, and Radio Buttons for some more details