Jbutton and text

N

Nosnos

Hi,

I have a Jbutton with some dynamic text (that mean that i don't know how long will it), and i wish that in spite of being too long, there will not be some "..." appears. I want that the text be divided into several lines ....

See this ascii draw

I have ----------------
| |
|Hi this is ...|
| |
----------------

I want ----------------
|Hi this is |
|an example |
| |
 
A

Alex Hunsley

Nosnos said:
Hi,

I have a Jbutton with some dynamic text (that mean that i don't know how long will it), and i wish that in spite of being too long, there will not be some "..." appears. I want that the text be divided into several lines ....

See this ascii draw

I have ----------------
| |
|Hi this is ...|
| |
----------------

I want ----------------
|Hi this is |
|an example |
| |

Google is your friend.
http://www.javaworld.com/javaworld/javaqa/2000-03/01-qa-button.html
 
A

Alex Hunsley

kevinc said:
Use HTML to render your label

Ah! He's right, I'd forgotten about that possibility.
That very link that I posted before has an addendum at the bottom about
using html...
alex
 
N

Nosnos

I can't, because I don't know which string will fit my button .... (so do'nt
know where to place my <br>)
Sorry you right, with HTML render, text are automatically wrapping with
multiline support

Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top