• Post Reply Bookmark Topic Watch Topic
  • New Topic

setLabelFor  RSS feed

 
Ronnie McBob
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working through the GUI tutorials from the Sun website.

There is one example where a JLabel's setLabelFor method is used...
I have had a look in the API documentation, but don't really understand what it's for...

Can anybody give a clearer description?

Help much appreciated!

Thanks,

Ron
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / AWT / SWT / JFace forum...
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nigel Browne:
It is common that a label is used to describe another component. When this is the case, a program's accessibility can be improved by using the setLabelFor method to identify the component it is describing e.g So if the displayedMnemonic property is also set, the label will call the requestFocus method of the component specified by the labelFor property when the mnemonic is activated.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!