• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Found Bug in Java !!!!..Please Check this..

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java Geeks (Esp bartender!!!)...
Today I was messing up with Checkbox and CheckboxGroup. I was able to create 3 radio button with all three enabled!!!..
*** ALL RIGHTS ARE RESERVED... I GOT COPYRIGHTS TO TELL THIS TO SUN!!! ***

OUTPUT in my case was : 3 RADIO BUTTON ("CHICS" , "BABE" , "BLONDE" , "hot") all enabled.


[This message has been edited by maha anna (edited April 10, 2000).]
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I only saw a blank screen.
[This message has been edited by Tony Alicea (edited April 10, 2000).]
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tony, i think you're supposed to send stuff through the commandline.
Ok, psethura, i tried it, and i see your point...
The java api says this:


Exactly one check box button in a CheckboxGroup can be in the "on" state at any given time. Pushing any button sets its state to "on" and forces any other button that is in the "on" state into the "off" state.


So, i don't think it's really clear whether the one-at-a-time rule should be used always, or just when someone pushes a radiobutton. On the other hand, the radiobuttons behave quite weird when you use them at first, so perhaps something is wrong.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jasper..
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well psethura,
I tried your code. There is a learning in this I believe.
1)When you pass the CheckBoxGroup to the constructor, only the last RadioButton is checked.
2)When the checkbox is constructed, and no value for enabling the checkbox as in c[i] = new Checkbox(arr[i] ); Nothing is checked.
3) As in your case, first you have created the checkboxes. As in this case, all of them will be checked by default. So if you now have to set a checkboxgroup, I believe you have to manually take care that only one of them is checked.
[This message has been edited by Lionel (edited May 31, 2000).]
 
Ranch Hand
Posts: 458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried your code and got the same result.
I found when I clicked the radio buttons off and select them, one at a time, the check box would go off for the previously selected button, automatically. Which is the correct behavior. It seems initializing them to true interferes with this. I even tried initializing only the first one to true, but it still would not un-check automatically. Setting them all to false works fine, however, if you want a default button set on then you'll need a different approach to get the correct behavior. I haven't gotten this to work, yet.
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic