• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ambiguity in jlist binded with database in netbeans

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..
i have a jlist binded with database.. in database i stored multiple items in single id.. it is displaying it as every item with that id..
for eg..
i selected from a jlist mouse, printer, ups and stored it with a unique id..
in database it is showing like this

hardware quantity id
mouse 1 it request8696
printer 2 it request8696
switch 34 it request8696

now i have bind this db table with another jlist which showing only id's..

i want it to show it request8696 to b shown only once.. but it is showing 3 times..
i have used netbeans bind elements to bind jlist..
please help..
thank you in advance..

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Neha Kaushik wrote: but it is showing 3 times..


Most probably you are not clearing the existing list data before appending the new one. If not post your SSCCE (please do take out time to click on SSCCE to find out what it really means) code.

GUI questions are best suitable for the GUI forum. Moving thread.
 
Neha Kaushik
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please someone provide the code for the problem as early as possible.
any help will be appreciated.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Neha Kaushik wrote:please someone provide the code for the problem as early as possible.
. . .

No
 
Neha Kaushik
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jList1 = new javax.swing.JList();

jList1.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N


org.jdesktop.swingbinding.JListBinding jListBinding = org.jdesktop.swingbinding.SwingBindings.createJListBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, requestList, jList1);
jListBinding.setDetailBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
bindingGroup.addBinding(jListBinding);

jList1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jList1MouseClicked(evt);
}
});

jScrollPane2.setViewportView(jList1);
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic