Default Highlight Borders

I am trying to remove the default highlighting that occurs on objects. When I add a JTabbedPane, JButton, or any other object to my application, a border is created on the outside edges. I am hoping to stop them from appearing, maybe by setting the colors to match my interface. Any help would be greatly appreciated!!

[325 byte] By [mtnkid420a] at [2007-9-27 7:32:15]
# 1
Did you try : setBorder(null);
noah.wa at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 2

Yes, the setBorder(null); is not solving my problem. I am talking about the very edge of the component. The top/left sides get a light highlight and the right/bottom sides get a dark one. I am trying to remove that outer edge line, keep it from being drawn, or make it the same color as my application to "hide" it.

mtnkid420a at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 3
What you have there sounds suspiciously like a SoftBevelBorder..are you sure you haven't a border like that ?Are you using setBorder(null) for the correct component ?
sanjeevdga at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 4
http://www.instaprint.com/images/borderhelp.gifHere is an image of what I am speaking about. I have tried the setBorder(null); on the JTabbedPane, JPanel, JTable, JScrollBar, ect. It all compiles but the border remains?
mtnkid420a at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 5

Yeah, I see what u mean.

The left-hand side has been set to a BevelBorder.RAISED

and the right hand side set to BevelBorder.LOWERED.

Just look for the component to which you are adding the JTable..say x..

Either remove the border or set an empty border like this...

x.setBorder(new EmptyBorder(5,5,5,5));

Similarly look for the component to which you are adding the tabbed pane.

And repeat the same.

Oh, in case you are inheriting from another custom-class just make sure you

aren't specifying the border behaviour in that class. Know what i mean ?

All the best.

sanjeevdga at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 6
button.setBorderPainted(false) should do the trick.
fromage1a at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 7

For the other objects like the JTabbedPane, you may have to do something sort of involved like override certain paint methods in the BasicTabbedPaneUI class. Specifically, you may want to override the paintContentBorder method (make it do nothing).

http://java.sun.com/j2se/1.3/docs/api/javax/swing/plaf/basic/BasicTabbedPaneUI.html

This technique should work if setBorder(null) doesn't work.

fromage1a at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...
# 8
http://forums.java.sun.com/thread.jsp?forum=57&thread=260746check out the JTabbedPane border problem more in depth for more dukes...
mtnkid420a at 2007-7-8 11:27:48 > top of Java-index,Archived Forums,Swing...