• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Checkbox items incombobox rendering

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am trying to show checkboxes in combobox i.e. each element in the combobox will be a checkbox so that user can

select multiple options in the combobox. This will be same as "AutoFilter Option in MS Excel 2007". After much

googling around, I have the following solution with only one issue pending:


When you run the above code, you will see a combo box with three elements, "Item-A", "Item-B" and "Item-C". All the

three elements are checkboxes so that user can select multiple options. However, if you will select the option which

is already selected in the combobox, its checkbox will not be rendered correctly, even though the state of the

checkbox has changed correctly.
Ex: On running the sample application, if you open the combobox and select the "Item-A", its checkbox will not be

rendered correctly. If you move the mouse over other item (with pop up already opened), you will see the state of

the "Item-A" checkbox has indeed changed but it is not showing correctly. The same thing happens whenever you select

a already selected item in the combobox. It seems there is some rendering issue.
Please help.
Thanks,
Charanjeet
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Charanjeet, welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites.
http://www.java-forums.org/awt-swing/36086-checkbox-items-combox-rendering.html

edit http://forums.oracle.com/forums/thread.jspa?threadID=2143880
 
charanjeeta singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Quite obviously, the person looking for an answer to his/her query will post his query to different forums. And will obvoiusly choose the best answer that he will get from different forums. I dont understand the fuss about it.
Different folks follow different forums so to get the best answer, person will definitely post to different forums.
I have posted this to
Oracle (http://forums.oracle.com/forums/thread.jspa?messageID=9212576&)
Java Forums: http://www.java-forums.org/awt-swing/36086-checkbox-items-combox-rendering.html
Coderanch: https://coderanch.com/t/520234/GUI/java/Checkbox-items-incombobox-rendering
Codeguru: http://www.codeguru.com/forum/showthread.php?t=506434
 
Marshal
Posts: 22457
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

charanjeeta singh wrote:Quite obviously, the person looking for an answer to his/her query will post his query to different forums. And will obvoiusly choose the best answer that he will get from different forums. I dont understand the fuss about it.
Different folks follow different forums so to get the best answer, person will definitely post to different forums.


We don't mind cross posting, as long as you tell us (and the other forum users). We might go spending quite a bit of time trying to find a solution, only to then find out that solution was already given on a different forum. It will make us feel like we wasted our time.
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

charanjeeta singh wrote:Quite obviously, the person looking for an answer to his/her query will post his query to different forums.


Nothing obvious about it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic