B4J Question Mouse Cursor Delay in Changing

melliott

Member
Licensed User
Hello,

Just before performing a timely operation I am setting the mouse cursor to WAIT as so:

MainFrom.RootPane.MouseCursor = fx.Cursors.WAIT

When I add the code for my long running process after the above line (which connects to a database) the cursor does not change. I tried putting a huge for-loop before it and also using a timer. Still, my mouse cursor changes after my process.

What can you recommend to get the MouseCursor to be visible as fx.Cursors.WAIT before my process runs?

Thanks,

Michael
 

melliott

Member
Licensed User
>> Can you provide more information about the timely operation? Why is it slow?

I am using jSQL to connect to multiple databases to get stats. I would not say it is slow - just takes about 5-15 seconds to connect to the databases and get the values. It works fine. I'd like to simply change to cursor to an hour glass before the process starts then change it back after the process.

In tests I have no issue changing the cursor to an hour glass via: MainFrom.RootPane.MouseCursor = fx.Cursors.WAIT

For some reason issue that code then attempting to connect to multiple databases via jSQL inhibits that cursor from changing.

conn.InitializeAsync("conn", "oracle.jdbc.driver.OracleDriver", _
"jdbc:racle:thin://DB01:1521/MyDB","SCOTT","tiger")

<<add values to TableView1 from ResultSet >>

conn.InitializeAsync("conn", "oracle.jdbc.driver.OracleDriver", _
"jdbc:racle:thin://DB02:1521/MyDB","SCOTT","tiger")

<<add values to TableView1 from ResultSet >>

conn.InitializeAsync("conn", "oracle.jdbc.driver.OracleDriver", _
"jdbc:racle:thin://DB03:1521/MyDB","SCOTT","tiger")

<<add values to TableView1 from ResultSet >>

MainFrom.RootPane.MouseCursor = fx.Cursors.DEFAULT





What can you recommend?
 
Last edited:

melliott

Member
Licensed User
Sub conn_Ready (Success As Boolean)
If Success = False Then
Log(LastException)
Return
End If
End Sub
 
Top