JTabbedPane's tab area add a button, it can display, but it can't click

两盒软妹~` 提交于 2019-12-11 05:38:47

问题


I have a JTabbedPane with tabs on the top. To the right of the tabs, I add a button. This button is neither part of JTabbedPane nor is it a tab. Unfortunately, it cannot be clicked. I guess this button is covered by the JTabbedPane, because I moved the button down, it covered by the JTabbedPane.

Can anybody give me some suggestion, so that I can click that button?

This is the layout; I can't upload image, so I draw it like below:

|-------------------------------------|
|   tab   |  tab   |           button |
|-------------------------------------|
|                                     |
|               content               |
|                                     |
|-------------------------------------|

回答1:


I haven't tried it, but you may be able to leverage one of approaches adduced by @camickr in the article Component Border. A custom TabbedPaneUI is a (laborious) alternative.



来源:https://stackoverflow.com/questions/9937927/jtabbedpanes-tab-area-add-a-button-it-can-display-but-it-cant-click

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