This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Multiple components in cell of a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Multiple components in cell of a JTable " Watch "Multiple components in cell of a JTable " New topic
Author

Multiple components in cell of a JTable

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

A cell in JTable contains a JPanel. This JPanel contains some other components ( a radio button, lablel . . .).
Using AbstractCellEditor ,TableCellRenderer,TableCellEditor this is achieved.
I am returning the JPanel as the Component to be set in the table cell.
But the events (mouse clicking . . .) reaches to JPanel only . . . the inner components are not effected by the mouse events . . .
How to achieve this . . .??

Thank you . . .
Andrey Kozhanov
Ranch Hand

Joined: Mar 12, 2010
Posts: 79
I believe you have to dispatch your events to component under mouse pointer manually. Using component's 'dispatchEvent' function.
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

Thank you for your response . . .
I have been waiting for a solution to achieve this task . . .
I have the same idea in my mind to dispatch events from the top container to individual inner components based on the position of the mouse . . .
I am searching for some other solution if possible . . .
 
jQuery in Action, 2nd edition
 
subject: Multiple components in cell of a JTable
 
Similar Threads
JTable(!!!)
JTable in JPanel is automatically disabled
JTable cell
Capture Mouse Events on JTable
complex JTable cell mouseover issue