 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Trufel Guest
|
Posted: Tue Jun 06, 2006 1:23 pm Post subject: Problem with JdbComboBox |
|
|
Hello,
I have interesting problem with JdbComboBox. When drop-down list is
long enough to be painted outside the form, after using it, I close and
re-open form - after then drop-down list ignores mouse motion (but
mouse wheel and keyboard work). Combo field is ok, only drop-down list
is not working properly.
Is there some bug in JdbComboBox?
I populate items into JdbComboBox in following code:
public static void populateCombo(JdbComboBox cb, Vector values){
cb.removeAllItems();
int maxWidth = 5;
cb.setMaximumRowCount(20);
int cnt=cb.getItemCount();
String oldValue="???";
if (cnt>0) {
oldValue = cb.getSelectedItem().toString();
}
for (int i=0; i<values.size() ;i++){
cb.addItem(values.get(i));
if (values.get(i).toString().length() > maxWidth)
maxWidth = values.get(i).toString().length();
}
cb.setDropDownWidth((int)(maxWidth * cb.getFont().getSize() / 2 +
20));
for (int i=0;i<cb.getItemCount();i++)
if (cb.getItemAt(i).toString().compareTo(oldValue)==0){
cb.setSelectedIndex(i);
return;
}
} |
|
| Back to top |
|
 |
Trufel Guest
|
Posted: Tue Jun 06, 2006 2:17 pm Post subject: Ad: Problem with JdbComboBox |
|
|
Oh, my form class extends JDialog and it is child for another JFrame.
When I change JdbCombo to normal swing JComboBox - everything is ok.
It happened on jre 1.4.2 and 1.5.
thanks...
T. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|