Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Can't seem to control the checkbox

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can't seem to control the checkbox

    my current code is

    HTML Code:
    FileInputStream input = new FileInputStream(Util.getWorkingDirectory().getAbsolutePath() + File.separator + LoadTextfield.getText() + ".txt");
                    BufferedReader a = new BufferedReader(new InputStreamReader(input));
                    for (i = 0; i < 100; i++){
                         if (i == 5){
                            PickUpBonesCheckbox.setSelected(Boolean.valueOf(a.readLine()));
                        }
    the value of a.readline() when i = 5 is true. I'm getting confused on why the checkbox isn't setting itself to true.

    It works fine when i use PickUpBonesCheckbox.setSelected(Boolean.valueOf("t rue");


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,017
    My Mood
    Mellow
    Thanks
    182
    Thanked 644 Times in 631 Posts

    Default Re: Can't seem to control the checkbox

    The purpose of the for loop is unclear. Please explain what you're doing there.

Similar Threads

  1. checkbox not working right
    By zerocool18 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: January 23rd, 2014, 04:01 AM
  2. checkbox on a JTable
    By jetjet21faja in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 1st, 2013, 08:11 AM
  3. own Tablemodel with checkbox
    By Voldimore in forum AWT / Java Swing
    Replies: 4
    Last Post: February 23rd, 2012, 05:19 AM
  4. See if checkbox is checked
    By kney in forum Java Theory & Questions
    Replies: 9
    Last Post: December 7th, 2011, 06:23 AM
  5. how to delete record based on checkbox selected checkbox
    By -_- in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: December 15th, 2009, 08:26 PM