I am trying to put 2 lines of text on a JButton. I have tried JButton1.setText("abc\ndef") and JButton1.setText("abc\rdef"), but the \n and \r characters are just treated as unprintable. I already have an icon in the button and I want to have the text settable at run time so I can't use an icon for one line of text. I know you use HTML in button text but I guess the version of swing I am using doesn't support it because I just see the tags when I try putting them in.
 
Is there a way to put multiple lines of text in a JButton? I am trying to make a button that looks like this, with settable text. The F1 in the corner is an icon. I had trouble getting the icon close to the edge but I finally got it close enough by making it the full button width.
 
__________________
|                               |
|   F1                       
|
|                               |
|    Text settable at      |
|     runtime.              |
|                               |
|                               |
---------------------------

 

Doal Miller

Fulcra

email: [EMAIL PROTECTED]

voice: (858) 874-7162

fax: (858) 571-1208

 

Reply via email to