• Post Reply Bookmark Topic Watch Topic
  • New Topic

JGoodies Data Binding with Lists  RSS feed

I Johansson
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my first-ever post in this forum so firstly I just wanted to say hi all.

I am relatively new to programming and I am self-teaching myself Java (so far I have only read and done all the exercises of the book "Head First Java" and I have read a few articles on the internet when I needed something more specific). My question is probably quite simple but I think it will be beyond pure basics so I decided to post it here rather than on the beginners forum. I hope it's ok.

Basically, I'm trying to build a simple GUI whereby I display some live stock exchange prices. For that, I create a GUI and a client object that I run through a thread and runs a while loop continuously so as to query the server for changes in prices. For doing this, I have read a series of articles on the internet on using JGoodies for data binding, which allows the stock price values to update themselves in the gui as soon as the server sends a change event. However, this is relatively easy to do for a single price but not for an array of prices. When my client handles an array of prices, after some reading, I believe the only way of passing an array using JGoodies from the client object to the gui object is by using a list but I don't know what PropertChangeListeners and getValue()/setValue() methods I should use in the client object for the ValueModel to work in the gui object and effectively bind the two together?

All the generic examples I have found create the List and then bind it within the same object so no need to bind it so I was wondering how do you bind a list in one object to a different object with a simple gui?

(Please refer to the code in the binding article under "Lists Stuff" here. I am basically looking for a similar very simple example with the minimum code possible, just what is necessary to illustrate how to do this)

If by any chance I have missed a simpler method to bind an array from another object to an element in the gui via JGoodies or a different package, all code examples/proposals are welcome.

Thanks a lot for your help in advance.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!