How To Make JLabel automatically wrap to next line


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. JLabel myLabel;
  2. String myString =
  3. "<html><p>This is a long paragraph and I want it to break on its own. " +
  4. "This is a long paragraph and I want it to break on its own. " +
  5. "This is a long paragraph and I want it to break on its own. " +
  6. "This is a long paragraph and I want it to break on its own.</p></html>";
  7. myLabel = new JLabel(myString);

URL: http://www.coderanch.com/t/336273/GUI/java/Make-JLabel-automatically-wrap-next

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.