Alright I'm trying to design a GroupLayout but running into troubles and lots of confusion...I have read the java tutorial on them and I'm still at a lost.

Here is a makeshift design I painted:

http://img268.imageshack.us/img268/2757/grouplayout.png

The thing that is stumping me is how do I go about stretching the bottom JTextArea across...

Here is the little code I have come up with:

//Create Panels and TextBoxes
	private Container createContentPane()
	{
		//Creating main JPanel and setting the layout manager...
		JPanel contentPane = new JPanel(new BorderLayout());
		GroupLayout layout = new GroupLayout(contentPane);
		contentPane.setLayout(layout);
		contentPane.setOpaque(true);
		
		//Auto gaps and insertion for the layout manager
		layout.setAutoCreateGaps(true);
		layout.setAutoCreateContainerGaps(true);
		
		//Creating the Incoming data, JTextArea
		incDisp = new JTextArea(5, 30);
		incDisp.setEditable(false);
		incDisp.setLineWrap(true);
		incDisp.setWrapStyleWord(true);
		JScrollPane incScrollPane = new JScrollPane(incDisp);
		
		//Creating the send data, JTextArea
		senDisp = new JTextArea(4, 30);
		senDisp.setEditable(true);
		senDisp.setLineWrap(true);
		senDisp.setWrapStyleWord(true);
		JScrollPane senScrollPane = new JScrollPane(senDisp);
		
		//Creating the user list, JTextArea
		usrDisp = new JTextArea(0, 0);
		usrDisp.setEditable(false);
		usrDisp.setLineWrap(true);
		usrDisp.setWrapStyleWord(true);
		JScrollPane usrScrollPane = new JScrollPane(usrDisp);
		
		//Create JLabel for usrDisp
		JLabel usrLabel = new JLabel("Contacts");
		
		//Setting up the layout manager and placing items
		/*contentPane.add(incScrollPane, BorderLayout.CENTER);
		contentPane.add(senScrollPane, BorderLayout.SOUTH);
		contentPane.add(usrScrollPane, BorderLayout.EAST);
		contentPane.add(usrLabel);*/
		
		layout.setHorizontalGroup(layout.createSequentialGroup()
				//wtf.........
				
				
		
		
		
		);
		
		return contentPane;
	}

Recommended Answers

All 2 Replies

You would probably have a much easier time with GridBagLayout instead.

Ah I skipped over that one while reading thank you very much I should have this finished in no time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.