java - How to set different colors to individual items in an SWT Combo -


i have combo dropdown in swt , have been thinking of setting different colors different items in list based on conditions. i'll decide later (i.e if string has on 5 characters item should have red background otherwise should green)

i managed change background of whole combo widget have noticed no method change background individual items.

color colorgreenswt = new color(null, 0, 255, 0); combo combo = new combo(comp, swt.drop_down); string[] languages = { "i", "it", "item", "items", "more_items" }; (int = 0; < languages.length; i++)     combo.add(languages[i]); combo.setbackground(colorgreenswt); 

so there method select background color each item in part?

combo not allow that. nebula project has tablecombo widget [1] might interest you. swt has extended custom combo called ccombo might want @ [2].

[1] https://eclipse.org/nebula/widgets/tablecombo/tablecombo.php

[2] http://help.eclipse.org/luna/index.jsp?topic=%2forg.eclipse.platform.doc.isv%2freference%2fapi%2forg%2feclipse%2fswt%2fcustom%2fccombo.html


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -