Make a JLabel wrap it's text by setting a max width?

No. You can use HTML in the label, but then you must hard code the break tag. A better approach is to use a JTextArea and turn wrapping on.

You can change the background,foreground, font etc. Of the text are to make it look like a label.

5 That's not entirely true. If using HTML you can hard code the break tags, but if you use HTML and assign the maximum size, the text will get wrapped automatically. – Daniel Rikowski Feb 14 at 12:52 If you decide to hard code break tags, make sure you use and not , as Java 5 doesn't like the latter.

– Craigo Aug 30 at 1:19.

Yes there are two similar ways (first with css style="width:...px", second with html WIDTH=...: 1. LabelText = String. Format("%s", width, text); 2.

LabelText = String. Format("%s", width, text).

There's a good technique here, scroll to the end of the article. JLabel labelBeingUsed = myLabel; View view = (View) labelBeingUsed. GetClientProperty(BasicHTML.

PropertyKey); view. SetSize(scrollPane1.getWidth(), 0.0f); float w = view. GetPreferredSpan(View.

X_AXIS); float h = view. GetPreferredSpan(View. Y_AXIS); labelBeingUsed.

SetSize((int) w, (int) h).

Or simply use myLabel. SetText(""+ myString +"").

JXLabel in the SwingX project supports wrapping JXLabel label = new JXLabel(somelongtext); label. SetLineWrap(true).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions