sparafucile17
Programmer
Ok, I have a class that extends a JPanel, that is pretty much my primary GUI interface. I have a JFrame that adds this inherited JPanel and uses it as the GUI display. The problem is that I have a JLabel: connStatus in the JPanel that needs to be updated depending on the remote connection status.
What I have is a method called setConnection Status that looks like this:
public void setConnectionStatus(String s)
{
connStatus.setText("Status: "+s);
}
So here's the problem: The text will not change (i.e. be redrawn) until the main thread finishes processing some database data. What I'm really looking for here is a method that will force the JPanel to redraw. I know in VC++ there was a function called update() for forcing the GUI to redraw.
Does anyone know of a Java equivalent for this? Also, keep in mind I'm really only looking for a single-threaded solutions. At this point I'm not looking to over-complicate things just so a Label will activate at the right time.
Regards,
Jeff
What I have is a method called setConnection Status that looks like this:
public void setConnectionStatus(String s)
{
connStatus.setText("Status: "+s);
}
So here's the problem: The text will not change (i.e. be redrawn) until the main thread finishes processing some database data. What I'm really looking for here is a method that will force the JPanel to redraw. I know in VC++ there was a function called update() for forcing the GUI to redraw.
Does anyone know of a Java equivalent for this? Also, keep in mind I'm really only looking for a single-threaded solutions. At this point I'm not looking to over-complicate things just so a Label will activate at the right time.
Regards,
Jeff