[英]JTabbedPane in Windows L&F with unremovable border
我正在使用JTabbedPane(包含JScrollPane)和Windows外觀編寫一個Swing程序。 當使用Windows L&F進行JTabbedPane渲染時,它在組件的左側放置了一個2像素的白線,並在組件的底部放置了1像素的白線(請參見下圖)。
有沒有辦法刪除這個? 添加(或刪除)邊框只能在線條外側放置一個邊框。 我已經為這個特定的組件編寫了自己的UI,但是我不確定從哪里開始(更不用說如何使用Windows L&F類了)。 我可以使用UIManager將偏移量設置為0,但這會切斷默認邊框。 我自己的理論圍繞的是Windows 7中無法呈現的某種折舊的斜角效果。還有其他想法嗎?
這是可靠的外觀。 嘗試修改TabbedPane.contentBorderInsets
UIManager
值。
例如:
UIManager.getDefaults().put("TabbedPane.contentBorderInsets", new Insets(1,1,1,1));
有關其他屬性及其默認值,請參見UIManager默認值 (@camickr提供)。
編輯:
我設法用TabbedPane.tabAreaInsets
清除了頂行:
UIManager.getDefaults().put("TabbedPane.contentBorderInsets", new Insets(0,0,0,0));
UIManager.getDefaults().put("TabbedPane.tabAreaInsets", new Insets(0,0,0,0));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.