Tuesday April 28, 2009
Removing the Three-Sided Border of TopComponents
This is a follow up to my blog entry from June 08, 2006, entitled Farewell to Space Consuming Weird Tabs. In the comments, someone appropriately named "Cynic" writes:
Yeah, write about it again when you get rid of that ugly ass three sided border and top separator.
Since Cynic is obviously a person of remarkably refined upbringing, his heart's desire has been uppermost on my mind all these years. This morning someone commented to that blog entry, solving the puzzle in a very simple way. I thought I'd share this insight with Cynic, who must surely be hanging out there somewhere, sipping a sherry while sucking ponderously on his astutely chiseled pipe. Perhaps he's flipping through a thick philosophical treatise at the same time, all the while discussing the mind/body dichotomy with his equally refined offspring.
Here's before:
And here's after:
And here's how:
import javax.swing.BorderFactory;
import javax.swing.UIManager;
import org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI;
import org.openide.modules.ModuleInstall;
public class Installer extends ModuleInstall {
@Override
public void restored() {
UIManager.put(DefaultTabbedContainerUI.KEY_EDITOR_CONTENT_BORDER,BorderFactory.createEmptyBorder());
}
}
The above requires a dependency on the "Tab Control" module.
Much more is possible, as the screenshot below shows, via code completion:
Thanks very much Michael b, for this tip!
Apr 28 2009, 12:02:51 AM PDT Permalink


