aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes ambiguity in jlist binded with database in netbeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ambiguity in jlist binded with database in netbeans" Watch "ambiguity in jlist binded with database in netbeans" New topic
Author

ambiguity in jlist binded with database in netbeans

Neha Kaushik
Greenhorn

Joined: Apr 03, 2013
Posts: 29
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..

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Neha Kaushik
Greenhorn

Joined: Apr 03, 2013
Posts: 29
please someone provide the code for the problem as early as possible.
any help will be appreciated.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Neha Kaushik wrote:please someone provide the code for the problem as early as possible.
. . .
No
Neha Kaushik
Greenhorn

Joined: Apr 03, 2013
Posts: 29

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);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ambiguity in jlist binded with database in netbeans