Hi there,

I'm writing a graphical frontend in Java using QT Jambi for the gui parts.
Now I've ran into some newbie problems with updating a lable and the changing of the mouse cursor

After programm start I want the user to log in. Herefor I did a QWidget with a lineedit for Username and password, a lable for messages and a pushbutton to start the login. After the button is clicked, the following method starts:


private void login()
{
User user = new User();
ILoginClient loginClient = new RestLoginClient();
ui.labelMessage.setText("Loggin in. Please wait!");
QCursor cursor = new QCursor();
cursor.setShape(CursorShape.BusyCursor);
this.setCursor(cursor);
[...]

When the method is called I want to update the Messagelable with the new text and set the cursor to Busy. After that I go on with the login. What's happening is, that the lable and the cursor change after my login is completed.

From earlier VB-times I know there has been a DoEvents-Command to give the OS the chance to redraw the elements of a window.
Do I need something simmilar here?

Thanks for your help in advance
Michael