java - Print transaction status on TextArea -
i developing project following :
1.truncate temporary table t1.
2.insert thousand rows temporary table t1.
3.execute procedure has commit statements in it.
4.insert rows table t1 other identical table(with respect structure) t2
5.execute 2 more procedures.
now have made swing ui contains textarea on want print transaction status. this
reading excel file.. validating excel file.. inserting entries table t1.. , on
i have made following method update status @ each step.
public void updatestatus(string message){ string temp = this.statustext.gettext(); this.statustext.settext(temp + message + "\n"); }
calling method along statements do
log.debug(message)
job me ! complicates code design. every dao component depends on method. can suggest me better design option.
thanks in advance !
log.debug(message) job me ! complicates code design. every dao component depends on method. can suggest me better design option.
you have issue concurency in swing, wrap statustext.append(message + "\n");
invokelater
,swing single threaded, , updates visible swing gui must done on event dispatch thread
maybe can @ swingworker, nothing clear posted description, hard , long running, talking edt issue
reduce procesors consuption , use proper methods appending new
string
visiblejtextarea
, usestatustext.append(message + "\n");
instead of quite hard
.
string temp = this.statustext.gettext(); // take string jtextarea this.statustext.settext(temp + message + "\n"); // append() new line
Comments
Post a Comment