BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with JdbComboBox

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing
View previous topic :: View next topic  
Author Message
Trufel
Guest





PostPosted: Tue Jun 06, 2006 1:23 pm    Post subject: Problem with JdbComboBox Reply with quote



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





PostPosted: Tue Jun 06, 2006 2:17 pm    Post subject: Ad: Problem with JdbComboBox Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.