• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

checkboxes?

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, I've done the usual search, and though it has yielded a wealth of information, I'm still a slow learner.
this is what Is want to do:
I want to allow wordwrap true/false via a checkbox.
I've created the checkbox, and have it initially selected...now I'm trying to connect this to LineWrap on a TextArea.
I've done this in Delphi, but in Java it really is different.
I was thinking that I could do something like this:

But, although this code would work in Delphi,
I don't know how to convert it over to Java...
any help? please.
[ November 26, 2002: Message edited by: Drake Silver ]
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you have to use a Listener:

chantal
 
Drake Silver
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perfect!
Thankyou Chantal.
I already had an action performed listener, but I didn't know how to access the method, selected.
Until I saw that you had .isSelected!
Boom, I was blown away. The asnwer to my problems.

thankyou. It works like a charm.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's less overhead to use the ItemStateListener than the ActionListener. - sorry that I have not mentioned it in the first mail. I didn't think of it by then. the itemstatelistener is only notified if the selection changes, while the actionlistener is notified even if the checkbox is already selected and gets clicked a second time.
chantal
 
Drake Silver
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chantal Ackermann:
it's less overhead to use the ItemStateListener than the ActionListener. - sorry that I have not mentioned it in the first mail. I didn't think of it by then. the itemstatelistener is only notified if the selection changes, while the actionlistener is notified even if the checkbox is already selected and gets clicked a second time.
chantal



oh.
Cool.
Thanks for the tip.
It's always great to get a little tip or two from a more experienced programmer.
I'll make the adjustments.
Thank you again for all of your help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic