Empty JFrame when running code
Hi,
I'm trying to build some sort of a progress window with a progressbar and status field in it. Its supposed to update after a number of actions. And then continue with the code. Im trying to display the connection process to a MySQL server here. But when I run the code, the JFrame shows up empty. Not showing any object at all.
Immediatly after this code the window hides (code not shown)
I have narrowed down the problem to one line. This line makes the program halt for half a second or so when executing.
conn = DriverManager.getConnection(url,this.username,this.password)
when I comment out this part I get to see everything..
try{
this.lblStatus.setText("Loading driver...");
this.pgrEen.setValue(0);
Class.forName("org.gjt.mm.mysql.Driver");
this.lblStatus.setText("Connecting...");
this.pgrEen.setValue(50);
String url ="jdbc:mysql://" + this.hostname +":3306/";
conn = DriverManager.getConnection(url,this.username,this.password);
Statement c = conn.createStatement();
c.executeQuery("use `" + this.database +"`;");
this.pgrEen.setValue(100);
this.lblStatus.setText("Connected!");
main =new Main(logon,conn);
}
catch( Exception x ){
System.out.println(x.getMessage());
}

