Can you explain what the posted is supposed to do?
Where are the 4 JFrames.

Where are you trying to put text in a JPanel?

April 13th, 2012, 10:47 AM

aussiemcgr

Re: Problem with placing text with JPanels

You cannot add a component to multiple containers. When you add the JTextArea to contentPane1, it is added to contentPane1, but when you then add the same JTextArea to contentPane2, it removes it from contentPane1 and then adds it to contentPane2.

Each GUI component can be contained only once. If a component is already in a container and you try to add it to another container, the component will be removed from the first container and then added to the second.

April 17th, 2012, 01:18 AM

Artem.N

Re: Problem with placing text with JPanels

Thanks for the hint. I've created separate JTextArea for each frame. So it works!

Sorry, I have forgotten to describe the problem.
In fact the problem is exactly as it was posted within next reply. I can not place same text (JTextArea) four times within four different frames. The only last assignment of JtextArea is displayed.

April 17th, 2012, 05:38 AM

Norm

Re: Problem with placing text with JPanels

A component can only be in one container. The last container it is added to will be its location.