• 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

JTable and data binding problem [please close, found solution]

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am using NetBeans 6.8 and got some problems when I want to add something to binded data. I have created a JTable (myListTable) that is binded with LinkedList<MyItem> (myList). I have created JButton (addRowButton) that should add new MyItem to myList which (probably) should add a row with that item to myListTable... and this is where the problem occurs. Firstly I have tried this:but got error java.lang.IndexOutOfBoundsException and I could not identify what causes it (probably it is because I have increased myList but myListTable does not have enough rows). So I made a small workaround:but now after adding a row, column name changes (don't know why it happens?!)

This is how MyItem is defined:Questions:
1. I would like to know is it possible to add data to bean that is binded to component? What is correct way of doing this?
2. Is my way of biniding correct? (I made it with tutorial from official netbeans site)

NetBeans zipped project with isolated problem: http://www.fdasfdas.prv.pl/JTableBindProblem.zip

@edit
Found solution on my own here:
http://swinglabs.org/docs/presentations/2007/DesktopMatters/beans-binding-talk.pdf
reply
    Bookmark Topic Watch Topic
  • New Topic