JComboBox fails to expand in JTable TableHeader

倾然丶 夕夏残阳落幕 提交于 2019-12-01 05:39:57

This actually works exactly as expected. I think the clue is TableCellRenderer.

Renderer's are typically non-interactive components. They are usually just a "snap-shot" of the component painted on to a surface and there is typically no way for a user to interact with them.

This is the expected behavior.

In order to supply editable functionality to the table header, you're going to need to supply your implementation of a JTableHeader

Have a look at this example for some ideas

luca

Here is an example that uses a JComboBox in a JTable TableHeader.

For other types of components is easier, have a look here.

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