How to disable a button in Java?

Posted on 2013-10-02
Medium Priority
Last Modified: 2013-10-07
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?
Question by:Tolgar
1 Comment

Accepted Solution

Misbah earned 2000 total points
ID: 39541186

Open in new window


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Simple Linear Regression
Suggested Courses

586 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question