Results 1 to 4 of 4
  1. #1
    man4ish is offline Member
    Join Date
    Dec 2009
    Posts
    14
    Rep Power
    0

    Default How check box can disabled

    Hi,

    I am developing one GUI. In which, based on some condition i need to disable Checkbox in swing. Let's take one example.

    JCheckBox jc = new JCheckBox();
    int i = 2;
    if(i<3)
    {
    disable CheckBox; // how it can be disabled.
    }

    Thanks in advance.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Look up the JCheckBox API and search on the term enabled. You will find the method in the AbstractButton section.
    Last edited by Fubarable; 01-07-2010 at 02:00 AM.

  3. #3
    man4ish is offline Member
    Join Date
    Dec 2009
    Posts
    14
    Rep Power
    0

    Default

    I got the solution.

    Thanks

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by man4ish View Post
    I got the solution.
    I'm glad that you did, but I hope that the main lesson to get from this is to always first search the API as you'll likely find the method you need much quicker that way. It's an absolutely necessary skill if one is to succeed as a Java programmer.

    Much luck!

Similar Threads

  1. tooltip should be visible when button disabled
    By Sureshgurram in forum SWT / JFace
    Replies: 1
    Last Post: 11-23-2010, 09:58 AM
  2. how to disabled button...?
    By mlibot in forum New To Java
    Replies: 0
    Last Post: 10-09-2009, 08:36 AM
  3. how to enabled, disabled radio buttons
    By mlibot in forum NetBeans
    Replies: 9
    Last Post: 09-25-2009, 07:45 AM
  4. button is not getting disabled on onload event
    By Harshada in forum Advanced Java
    Replies: 2
    Last Post: 03-08-2009, 02:03 PM
  5. How to disabled a node.
    By smartsubroto in forum New To Java
    Replies: 32
    Last Post: 07-01-2008, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •