Link to home
Start Free TrialLog in
Avatar of Tolgar
Tolgar

asked on

How to disable a button in Java?

I have a Java code and this code creates a GUI. In this GUI, I would like to disable a button if certain condition (let's say none of the check boxes are selected) is not satisfied.

This is how I create the button:

        item23 = new ToolItem(custToolBar22.getToolBar(), SWT.PUSH);
        item23.setImage(image_navigate_right); item23.setText("Run checks"); item23.setToolTipText("Run the checks against the files you selected");
        item23.addListener(SWT.Selection, toolBarListener); 

Open in new window



In here, I would like to set change image_navigate_right with a grayed out image and I want it to be not clickable.

How can I do it?
ASKER CERTIFIED SOLUTION
Avatar of Misbah
Misbah
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial