• Post Reply Bookmark Topic Watch Topic
  • New Topic

design question: best way to update swing components with data

 
Edmund Castermund
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an app I'm writing that does a bunch of stuff....(selecting files, processing them with xslt/perl/dom4j, printing reports, etc)
A whole bunch of objects and processes are run during the course of a user running a job and I want the gui to provide status as to how the job is progressing.

Right now I'm using my own little mock-up of the Observer pattern, and I have my own Message class, so if the message type is "gui-hd" then it prints the data in a JLabel, and if the message is "gui-status" it puts it in a text area, if it's "error" it displays it somewhere else...you get the idea.

Anyway, is there a standard way of doing this that I don't know about? I know log4j has ways of doing this, I need to brush up on my log4j skills, but was wondering how other folks deal with that issue.
thanks,
bp
 
Samuel March
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the actual data and messages in a Map of <key,Value> pairs , java.util.Properties is the standard system for message bases.
Dynamic Properties classes can also be built, whereby , like you were saying you would have a message string and it would have current
updated information.
The same effectively but you make an instance and update the value on the Key for the job with a dynamic one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!