• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

how to use class in JCombobox?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want the code to use your AutoComplexCombo class, why is it instantiating a standard JComboBox instead?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any idea?
 
Ulf Dittmer
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to add list of items here?
and how to use it?
reply
    Bookmark Topic Watch Topic
  • New Topic