Rectangle tR2 = tDialog.getBounds();
tDialog.setLocation(tRect.x + (tRect.width - tR2.width) / 2,
tRect.y + (tRect.height - tR2.height) / 2);
*/
SwingWorker tWorker;
mRS = aRS;
if(mUseTableModel) { // build table model
tWorker = new SwingWorker() {
public Object construct() {
try {
mModel = new TsqlTableModel(mRS);
} catch(SQLException e) {
System.err.println("new TableModel: " + e);
}
TsqlProgressDialog.getInstance().hide();
return null;
}
};
tWorker.start();
tDialog.show();
mAbortedQuery = tDialog.isAborted();
} else {
mModel = null;
}
tWorker = new SwingWorker() {
public Object construct() {
try {
printResultSet(mModel, mRS);
} catch(Exception e) {
System.err.println("printResultSet: " + e);
}
TsqlProgressDialog.getInstance().hide();
return null;
}
};
tDialog.setTitle("Printing Resultset");
tWorker.start();
tDialog.show();
} finally {
// enable output textarea
mInQuery = false;
_outputGui(mInQuerySB.toString());