Mouse Cursor point to hand change over specific cell?

This could have been easy if there were an extension function onMouseMovedCell() on power table. Since each cell has its own event listener, the event handler exposed mouseMoved() won’t be useful so we’re forced to use another approach.
The fast solution I can think is on a client event script with a fast rate execution of 200 millis or so and dedicated thread.
The script should look like this:

def setCursorTable(jtable): 
	from java.awt import MouseInfo, Point, Cursor
	pointerLocation = MouseInfo.getPointerInfo().getLocation() 
	table = jtable.getTable()
	relativeX = pointerLocation.x-table.getLocationOnScreen().x 
	relativeY = pointerLocation.y-table.getLocationOnScreen().y 
	tablePoint = Point(relativeX,relativeY) 
	rowPointIdx = table.rowAtPoint(tablePoint)
	colPointIdx = table.columnAtPoint(tablePoint)
	if rowPointIdx != -1 and colPointIdx != -1:
		#add more column index conditions
        if colPointIdx == 0: #0 index column
			jtable.setCursorCode(Cursor.HAND_CURSOR)
		elif colPointIdx == 1: #1 index column
			jtable.setCursorCode(Cursor.DEFAULT_CURSOR)
	
windowPath = "Main Window" #your windows path where your table is located
tableName = "Power Table" #your table name component
try:
	window = system.gui.getWindow(windowPath)
	jtable = window.getRootContainer().getComponent(tableName)
	setCursorTable(jtable)
except:
	system.util.getLogger('jtableCursor').info('no window opened or not component found.')

and this in mouseEntered() event handler power table

from java.awt import Cursor
event.source.setCursorCode(Cursor.DEFAULT_CURSOR)

You should monitor the performance of the client.

1 Like