Results 1 to 4 of 4
- 07-25-2008, 08:00 AM #1
Member
- Join Date
- Jul 2008
- Posts
- 2
- Rep Power
- 0
How to wrap words in checkbox,push buttons
Is it possible to wrap sentence thru 'checkbox.setText()?
Basically i need to keep text of check box in 2 lines.
if I do same thing in case of label --label.setText("Hello\nWorld").
o/p--Hello
World
but in case of check box or push button i.e. chkbox.setText("Hello\nWorld");
O/p---Hello[]World..
Infact no escape sequence(\n,\f,\r etc) is working in any of the button case.
- 07-25-2008, 10:48 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 23
Did you try to use with HTML codes in the setText() function. I hope it support for HTML tags.
- 08-05-2008, 12:15 PM #3
Member
- Join Date
- Jun 2008
- Location
- South Africa
- Posts
- 6
- Rep Power
- 0
HTML codes don't work.
http : // dev.eclipse.org/newslists/news.eclipse.platform.swt/msg14885.html says wrapping is not supported on a button.
You would be able to fake it with an image, or you might be able to able to override it with a paint listener (but I have a feeling that at least on Windows the native button object does not support custom painting).
- 08-05-2008, 12:24 PM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 23
Are you talking about Swing or AWT. Swing support for wrapping. I'm working on that way in NetBeans.
Similar Threads
-
How to create tool bar (wrap on resize)
By Java Tip in forum SWT TipsReplies: 0Last Post: 07-02-2008, 08:10 PM -
How to use ItemListener for CheckBox class
By Java Tip in forum javax.swingReplies: 0Last Post: 04-23-2008, 08:18 PM -
Stack push/pop/peek operations
By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 09:03 AM -
SWT push button
By Java Tip in forum Java TipReplies: 0Last Post: 12-31-2007, 01:21 PM -
checkbox
By Alan in forum AWT / SwingReplies: 3Last Post: 05-18-2007, 10:10 AM
Bookmarks