I have a Java application that updates data at a variable speed (obtained from a fairly high speed data stream from my control, but up to 120 Kbytes / s), and I would like to display statistics such as the number of bytes / packets using the dialog box .
I look at JGoodies bindings and got something pre-working with artificial data obtained at a low speed.
What I would like to do, roughly speaking:
create a bean class something like this:
public class Statistics
{
private int bytes;
private int goodPackets;
private int badPackets;
private int totalPackets;
public int getBytes() { return bytes; }
public int getGoodPackets() { return goodPackets; }
public int getBadPackets() { return badPackets; }
public int getTotalPackets() { return totalPackets; }
public void update() { }
public Statistics() { bytes=goodPackets=badPackets=totalPackets=0; }
}
Statistics stats;
bind 4 fields to elements in my GUI
- can be called
stats.update()at any speed necessary in my main application thread, where the call to βupdateβ is what causes the listeners to change the GUI. - "" , , 5-20 , .
, , ? JGoodies DelayedReadValueModel, , .
, , , , :
- - , -
update(), , maybePropagate()maybePropagate(): - , , ;- , ,
- 4 , , GUI JAoodies BeanAdapter.
?