Is it possible to have a JPanel over JTable

Posted by YuppieNetworking on Stack Overflow See other posts from Stack Overflow or by YuppieNetworking
Published on 2010-04-09T16:30:24Z Indexed on 2010/04/09 16:33 UTC
Read the original article Hit count: 400

Filed under:
|
|

Hello,

I have a JTable whose associated TableModel could be initially empty. Therefore, it currently shows a JTable with its columns and no rows.

In order to fill this JTable, I want the user to drag and drop elements from another component. The problem is that I would like to hint the user that he/she should drag elements to this table, with some message like "Drag xxx here to add a row".

I thought that I could achieve this by putting a panel over the JTable , but I don't think it is possible with any java layout.

Does anyone know how to do this? Or should I stick to a CardLayout to switch to/from the hint and the JTable?

Thanks a lot

© Stack Overflow or respective owner

Related posts about java

Related posts about swing