Search:

Type: Posts; User: GregBrannon

Search: Search took 0.20 seconds.

  1. Replies
    5
    Views
    1,061

    Re: problem with BorderLayout

    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...
  2. Replies
    5
    Views
    1,061

    Re: problem with BorderLayout

    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...
  3. Replies
    5
    Views
    1,061

    Re: problem with BorderLayout

    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() );
Results 1 to 3 of 3