|
Replies:
4
-
Last Post:
Jul 15, 2009 8:19 AM
by: kameit00
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
Question: Overlay on a JTable when editing a cell
Posted:
Jul 11, 2009 11:05 AM
|
|
|
Hi,
is it possible to use JXLayer to paint a button on a JTable, when the user starts to edit a cell?
Example: The user starts to edit a cell in the table. If that happens, I want to draw a button beside the edited cell.
With the examples I've found, I'm not sure if I can do this with JXLayer.
Regards Kai
|
|
|
|
|
|
|
Re: Question: Overlay on a JTable when editing a cell
Posted:
Jul 11, 2009 11:16 AM
in response to: kameit00
|
|
|
Hello Kai
I suppose if you can add a button to the JTable's renderer and edtior you also can wrap the button with JXLayer
Am I missing something here?
Thanks alexp
|
|
|
|
|
|
|
|
Re: Question: Overlay on a JTable when editing a cell
Posted:
Jul 12, 2009 7:21 AM
in response to: alexfromsun
|
|
|
Hello Alex,
if I'm wrapping the Component (cell editor of my JTable), I can add the button there. But when I tried this, the text in the textfield will be covered by the button. What I was trying to do is adding/painting the button outside of the Component returned by the cell editor, so the text will not be covered by the button. Do I have to wrap the whole JTable in a JXLayer to do this? Or what would be a good way to paint outside the "cell under edit"?
Thanks Kai
|
|
|
|
|
|
|
|
Re: Question: Overlay on a JTable when editing a cell
Posted:
Jul 13, 2009 5:24 AM
in response to: kameit00
|
|
|
Hello Kai
As far as I know, you can create a table cell editor that contains any kind of component, you can implement TableCellEditor interface and do whatever you want. I'd recommend you to find some online manuals about customizing JTable and creating custom editors/renderers.
You can also certainly wrap the whole table with JXLayer in this case you'll be able to paint on top of the entire table
Thanks alexp
|
|
|
|
|
|
|
|
Re: Question: Overlay on a JTable when editing a cell
Posted:
Jul 15, 2009 8:19 AM
in response to: alexfromsun
|
|
|
Hi Alexp,
I already tried to return a JPanel from the TableCellEditor. But as soon as I started to edit the cell, only parts of the JPanel were rendered inside the cell. It seemed, as if the JPanel was too big to fit into the cell. Also the textfield inside the panel was only half visible. I think I will try to wrap the whole JTable inside a JXLayer. I think it would be nice looking, if the button was outside of the cell... "floating" on the table 
If I manage to do this, I'll try to make a simple example and post it here.
Thank you for your support Alexp!
Regards Kai
|
|
|
|
|