vm runs through jdialog directly to jframe
i have a jframe showing a jtable with data readed from a mysql table. now i want to prompt a jdialog for username, password for the connection to mysql. i already got the code with buttons and actionslistener for the jdialog, but the problem is that the vm is not waiting till the user has entered his name and pw, so that the jdialog and jtable are shown simultaneously. i need help, so that first the jdialog is shown and only if the connection is ok the jtable is shown. how can accomplish this?