Sir my database contains path of images that I want my jComboBox to diaplay. I have written the following code but it does not work for comboBox but works fine when I display image on jLabel etc. Kindly tell me how should I go about this
Always use code tags; I added them for you and you can see it looks a lot better, and you have lost the ugly effect, too.
Please explain what happens; we need to know more than you have told us. What actually appears on the combo box? A combo box is intended to display text, principally.
You need to use a custom renderer to display the image. Read the JCombBox API and you will find a link to the Swing tutorial on "How to Use Combo Boxes" which explain what a renderer is and give you an example of a renderer to display an image.
posted 4 years ago
Sir nothing is displayed in the Combo Box when the above code is run.