• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checkbox items incombobox rendering

 
charanjeeta singh
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: http://www.coderanch.com/t/520234/GUI/java/Checkbox-items-incombobox-rendering
Codeguru: http://www.codeguru.com/forum/showthread.php?t=506434
 
Rob Spoor
Sheriff
Pie
Posts: 20369
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • 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: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic