Getting location of cell in JXTreeTable

前提是你 提交于 2019-12-13 14:58:04

问题


How to determine the location of a particular cell in JXTreeTable on screen?


回答1:


not sure, but merging some information gathered on topic.

  • this link shows the way to compute swing component coordinates: Getting coordinates of a component in java
  • this link shows, that JXTreeTable extends JTable: http://download.java.net/javadesktop/swinglabs/releases/0.8/docs/api/org/jdesktop/swingx/JXTreeTable.html
  • this link shows the way to retrieve coordinates of cell in JTable: http://www.java-forums.org/awt-swing/23061-jtable-cell-coordinates.html

So final solution could theoretically just calling method (from JTable API):

public Rectangle getCellRect(int row, int column, boolean includeSpacing)

And if needed then using SwingUtilities.convertRectangle get the exact screen placement.

Honestly, I'd be quite curious if it works if you give it a try :)



来源:https://stackoverflow.com/questions/12097619/getting-location-of-cell-in-jxtreetable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!