I'm trying to display large strings in JComboBox but this forces the JComboBox to be as large as the largest string.
I have limited the size of the JComboBox button by overloading getPrefferedSize with a constant width. This then limits the size of the drop down list box. I want to limit the size of the button but allow the list to be as wide as it likes or at least have a horizontal scroll bar.
Have you any sugesstions about how to achive this?
You can atmost attach a tool tip to each of the list item which can be of any size. See TreeCombo.java in SwingSet demo example for doing it. You need to modify getListCellRenderer and add setTooltipText
Working with files is a moderately common task in Java. For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.
However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application.
For the purposes of this article, I will be u…