A border is just that - a border. It shouldn't include other components (and it's not possible to do that with the borders that are part of Swing).
You could write your own border class that extends AbstractBorder, and in its paintBorder method you should be able to put any components you like.
Tran Tuan Hung
Joined: Apr 08, 2007
thanks you very much Ulf Dittmer. But i didn't know how to use paintBorder to add a component on it. Can you give me a small example to do it and i am sorry for my stupid. although i have searched on google, but it not help me. Thanks very much
Joined: Mar 22, 2005
I have no idea how to go about it; as I said, I think it's not a good idea.
The fact that you didn't find anyone else doing it, either, should tell you something. There are most likely better ways to achieve what you're trying to do, possibly involving the use of layouts.