Just think about it a bit - I hope you have.
Your original version creates the panel in the TestClass() constructor by calling the CustomPanel() constructor. The CustomPanel() constructor adds...
Type: Posts; User: GregBrannon
Just think about it a bit - I hope you have.
Your original version creates the panel in the TestClass() constructor by calling the CustomPanel() constructor. The CustomPanel() constructor adds...
I'm not getting the results you describe. I have a "test" button across the top and the rest of the panel filled with the JTextArea, BECAUSE the layout is set FIRST and then the components are added...
JPanel's layout is not BorderLayout by default, it's FlowLayout. You have to set JPanel's Layout to be BorderLayout:
// in the CustomPanel() constructor:
setLayout( new BorderLayout() );