Text of JLabel moves out of JPanel
I have a JPanel with specific size. I have added a JLabel on it. Now the text of JLabel is dynamic and comes from the database. When I add this data to JLabel, instead of it staying in the JPanel, it spreads out. When it happens, the data inside the JPanel is visible but the one outside the JPanel is not visible(which is obvious). I want to know if there is a way by which the data instead of going out of JPanel, will stay in JPanel itself (means it automatically adds a newline and moves to newline instead of going out).

Thanx in Advance.
Text of JLabel moves out of JPanel
===

I have a JPanel with specific size. I have added a JLabel on it. Now the text of JLabel is dynamic and comes from the database. When I add this data to JLabel, instead of it staying in the JPanel, it spreads out. When it happens, the data inside the JPanel is visible but the one outside the JPanel is not visible(which is obvious). I want to know if there is a way by which the data instead of going out of JPanel, will stay in JPanel itself (means it automatically adds a newline and moves to newline instead of going out).

Thanx in Advance.