When working with this code in Designer, the borders are not visible (though of course they do work properly outside of designer - i.e. when the code is executed).
I tried searching for information regarding this in these forums but the only thing I could find related to this was that Designer doesn't support UI elements which are not directly created with a zero-argument constructor (including objects created through factory methods).
Is this indeed the reason my Borders don't display? And if so, is there any chance you could make an exception for things like BorderFactory which are an official part of the swing framework & recommended by Sun's swing tutorial? (Actually it would be super-nice if there was a way for me to use custom factory methods also)
Also, although I don't know the exact history of this code, I know that it has been edited with JBuilder's GUI designer (though I'm not sure that the use of BorderFactory comes from JBuilder since the code has also been manually edited).
RELEVANT SWING TUTORIAL PAGE
http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html
OUR CODE
- Code: Select all
Border etchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
Border myBorder = BorderFactory.createTitledBorder(etchedBorder,"Automobile",TitledBorder.LEFT,TitledBorder.TOP,new Font("SansSerif", Font.BOLD, 12),new Color(12,50,116));
panel.setBorder(myBorder);
Thanks for all your help. I'm amazed that Designer can do so well with our messy code - if it can be made to handle this pattern then I think it will be 100% useful for designing our legacy views (keeping us forever away from JBuilder).