• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use class in JCombobox?  RSS feed

 
borj bersas
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys, how can I use a class in JCombobox?

scenario:

i have a class that creats an autocomplete for jcombobox
and i want it to use in my jcombobox that i added in other JFrame using drag and drop,
these Jframe and the autocomplete/history class are on the same package.

here is the autocomplete class code:


and here is my drag and drop code with JCombobox:

how can i use the class to make the JCombobox autocomplete?
and how can i call the strings of my array?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want the code to use your AutoComplexCombo class, why is it instantiating a standard JComboBox instead?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you mean you want to add your comboBox to the netbeans palette (is that what it's called),
then be able to drag/drop it like a normal comboBox.

if so, you're better off in an IDE forum
 
borj bersas
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:If you want the code to use your AutoComplexCombo class, why is it instantiating a standard JComboBox instead?


i just found the code here webpage

and i dont know how to use it, i tried cpoy-paste it in my class but it wont run because it has no main
 
borj bersas
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:do you mean you want to add your comboBox to the netbeans palette (is that what it's called),
then be able to drag/drop it like a normal comboBox.

if so, you're better off in an IDE forum


no its not like that, i just want to use its function on my JCombobox
 
borj bersas
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any idea?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 17 of AutoJCombobox.java uses a standard JComboBox, when it should be using AutoComplexCombo instead.
 
borj bersas
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to add list of items here?
and how to use it?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!