java - Determine Which JTable Cell is Clicked -


when user clicks cell on jtable, how figure out row , column of clicked cell? how show information in jlabel?

the existing answer works, there alternate method may work better if you're not enabling cell selection. inside mouselistener, this:

public void mouseclicked(java.awt.event.mouseevent event) {     int row = thetable.rowatpoint(event.getpoint());     int col = thetable.columnatpoint(event.getpoint());     // ... 

Comments

Popular posts from this blog

sql server - python to mssql encoding problem -

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -