I’m writing a Java Desktop utility in Java swing and have a minimal GUI part in it, most of work is done on server side i.e. backend. So, I don’t want to spend a lot of time on GUI part, learning different controls and widgets. The problem is that Swing has two controls for (to me)same tasks i.e. dropdown menu and they are JComboBox and JSpinner I don’t know the difference and I don’t want any limitation that would hinder me from completing my task after I’ve selected one.
I’ve to use dropdown to display List<String> returned from DataBase and it can have as many as thousands of values. To keep user from scrolling I’ll be taking starting alphabet as input or some category limitation will be there so, it may be that I’ll be using specific values to be displayed from List<String>. i want my program to be as efficient as it can be and spend least time on front end as there are a lot of operations on backend.
Any Help will be highly appreciated
you issue talking about AutoComplete JComboBox / JTextField
with some effort could be aplied (
AutoComplete JTextField) toJSpinnertooall above mentioned
JComponentsare based on premature array, maybe need to convertjava.util.ListtoString[]orVector(depends of your code logics)none of GUI are designated to helt the thousands of values, have look at
Paginations for Databases engineabove mentioned
AutoComplete JComboBox / JTextFieldworks without any issue up-to 2k rows on todays PCsfor searching or selections from largiest arrays you have look at
Stepped JComboBox(about two or moreJComboBoxes)1.st for reduced selection from
[0-9, A-Z]2.nd for searching in records started
with A(for example)redirect
Databaseevents to the background tasks and to useSwingWorkerorRunnable#Thread