Skip to main content

autocomplete issue

5 replies [Last post]
thrawn
Offline
Joined: 2006-07-23
Points: 0

Hi, i am using the a plain JComboBox and AutoCompleteDecorator.decorate(), but i found that pressing the backspace key or the del key have not the expected behaviour:
- del key is not valid (a beep sounds)
- backspace seems to work in the editor (the cursor moves back and the text after it became selected), but the popup is not refreshed. Tthis can be solved probably by changing the decorator from:
// don't popup on action keys (cursor movements, etc...)
if (keyEvent.isActionKey()) return;
...
To:
if (keyEvent.isActionKey() && keyEvent.getKeyCode()!=KeyEvent.VK_BACK_SPACE) return;

But when i tried to customize this behaviour, i found that some methods in the class are private, and in some places it makes reference to some package privated classes (AutoCompleteFocusAdapter...); so i cannot neither extends nor copy&paste the code.
Anyone knows a solution?
Maybe should I create a bug report for this?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kschaefe
Offline
Joined: 2006-06-08
Points: 0

There already is a bug report for this.

Karl

thrawn
Offline
Joined: 2006-07-23
Points: 0

Sorry i didnt see it
But i cannot found it in the list (https://swingx.dev.java.net/issues/buglist.cgi?component=swingx&subcompo...)
Could you point me to the bug report?

Thanks
--
Chipu

kschaefe
Offline
Joined: 2006-06-08
Points: 0

See [url=https://swingx.dev.java.net/issues/show_bug.cgi?id=943]Bug 943[/url].

Karl

thrawn
Offline
Joined: 2006-07-23
Points: 0

Sorry, but in my opinion this is a different issue, my problem is not an exception (I dont get any), but the back space key has not the expected behaviour (the popup is not updated)

thrawn
Offline
Joined: 2006-07-23
Points: 0

Here is a test example:

public static void main(String... args) {
JFrame frame = new JFrame("Auto Combo box testing");
frame.setSize(800, 600);

Vector list = new Vector();
list.add("");
for(int i = 100; i < 10000; i++)
list.add(Integer.toString(i));

JComboBox cBox = new JComboBox(list);
AutoCompleteDecorator.decorate(cBox);

frame.getContentPane().add(cBox, BorderLayout.NORTH);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}