Re: how do I veto a setSelected() on JCheckBox



"Steve W. Jackson" <stevewjackson@xxxxxxxxxxx> writes:

In article <1140794158.846456.212720@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"rob" <rfwalker@xxxxxxxxxxx> wrote:

Hello all, I am confused as to how to do this?
I would like the change to veto a setSelected
when the event happens but not sure how to go about this
....
On the other hand, you might also consider simply not enabling the
checkbox if your conditions won't allow its state to change. If it's
not enabled, a user can't very well click it to change its checked state.

That was what I thought of as well.
It has the additional beneficial property of being pro-active and
visible. That means that the user isn't but in the situation of trying
to do something only to have the system then tell him it can't be done.
It is better to make this explicit and visible up front. It will save
the user time and aggravation, so I would consider it to be a much
superior solution. It isn't as if the user can enter something
arbitrary and unpredictable, so just have the code do the work in advance.

--
Thomas A. Russ, USC/Information Sciences Institute
.



Relevant Pages

  • Re: how do I veto a setSelected() on JCheckBox
    ... I would like the change to veto a setSelected ... I was thinking I would have define my own checkbox like ... MyVetoableCheckBox extends JCheckBox ... VetoableChangeListener. ...
    (comp.lang.java.gui)
  • Re: FindControl
    ... > You code below assigns the checkbox to a variable. ... >> not it's checked state. ... I'm creating the control in a placeholder and ... >> events for that control and if so, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Checkboxes
    ... If you want to use a checkbox in your ... app, and don't want to be bothered about reflecting the checked state of ...
    (microsoft.public.pocketpc.developer)
  • Re: Can you cancel the click of a checkbox?
    ... If you want, you can create a derived CheckBox class and override the OnClick method, provide a new cancellable event that you call from your OnClick method, and only call the base OnClick method if the event is not cancelled. ... I suppose I could short-circuit the CheckedChanged event to flip the checked state back and skip the code, using a Boolean flag to skip the second call to CheckedChanged when I change the state back, but that's ugly. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • web Datagrid checkbox column postback problem
    ... checkbox column that is not bound to the grid, ... DataGrid or some other array or collection. ... Where cb is a column name of the database query. ... the Checkboxes are never in the Checked state. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)