Related question: is there a way to do custom scrolling in the JComboBox? It
is supposed to scroll automatically when the item is selected. I can't seem
to find this piece in the Java sourcecode. How is it done?

Thanks.

-----Original Message-----
From: Reinstein, Lenny 
Sent: Tuesday, June 11, 2002 2:50 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: [Advanced-java] JComboBox does not scroll correctly.


Hey people,

I have this weird problem with my JComboBox. 

I have the autocomplete program that displays the best match so far in a
combo box's text box, and makes a selection in a combo box. Here is how the
text box is defined.

JTextComponent jtc =
(JTextComponent)ManagedComboBox.getEditor().getEditorComponent();

So that when the user clicks on it, it scrolls to the selected item.
However, when I click on the combo box the first time, it does not seem to
scroll to the selected item, but if I scroll manually, I see the item I need
highlighted as selected. Then if I unclick and click on the combo box the
second time, it works correctly -- i.e., it scrolls and I see the selected
item without additional scrolling. Anyone has any idea about this?

Many thanks.

Lenny, New York.




_______________________________________________
Advanced-java mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to