super straightforward: I implemented ITableListener, then called networkTableClient.addTableListener (this, true).
If you need to see connections and disconnections, implement IRemoteConnectionListener, and call networkTableClient.addTableListener(this,true).
of course, you can have different objects for your listener (so you wouldn't use
this), but hopefully you'll get the gist of it.
your valueChanged() can be a little tricky: you could get back an array or just a single variable of unknown type, and you don't know ahead of time what it will be. I had a few instance operators in there to sort stuff out. For display purposes, this worked nice:
Code:
if (o instanceof Object[]) {
for (Object o1 : (Object[]) o) {
sb.append("\t");
sb.append(o1.toString());
} else {
sb.append("\t");
sb.append(o.toString());
}
You *could* also get the type by going back to the client.getEntryStore().getEntry(name).getType(), but I didn't need it. I did grab client.getEntryStore().getEntry(name).getSequenceN umber() so I could see if we had updates that didn't get to the client (this is from our telemetry receiver).