The Artima Developer Community
Sponsored Link

Java Answers Forum
how to use checkbox list

1 reply on 1 page. Most recent reply: Jul 8, 2004 1:29 AM by Amol Brid

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
anita

Posts: 1
Nickname: minanshu
Registered: Jun, 2004

how to use checkbox list Posted: Jun 29, 2004 11:03 PM
Reply to this message Reply
Advertisement
how can i add checkboxes in jlist or checkboxlist at runtime using javva swing


Amol Brid

Posts: 43
Nickname: amolbrid
Registered: Feb, 2004

Re: how to use checkbox list Posted: Jul 8, 2004 1:29 AM
Reply to this message Reply
Hi,

You cannot add checkbox(or any other component) directly to the JList. You have to create a class which implements ListCellRenderer interface and then set the instance of this class to JList by using setCellRenderer() method.

Each row in the JList will be rendered using the cell reneder set using setCellRenderer() method.

You can find a example for this is ListCellRenderer's java doc.


Regards,
Amol Brid.

> how can i add checkboxes in jlist or checkboxlist at
> runtime using javva swing

Flat View: This topic has 1 reply on 1 page
Topic: Auto Complete Function Previous Topic   Next Topic Topic: how to modify a jsp page

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use