Link to home
Start Free TrialLog in
Avatar of dmag
dmag

asked on

Word Wrap Checkboxes and Labels needed

I have an app with long lables and checkbox captions. The standard AWT doesn't allow multiple lines in it's lables (even if it did, I'd want it to wrap automagically).

Is there any way to get my widgets to "Do the Right Thing"? (i.e. automatically grow the label verticaly and wrap the text.) Java 1.0 solutions preferred, and it must work on labels, checkboxes, and pull-down listboxes.
Avatar of jpk041897
jpk041897

Unless someone knows of a pre made solution, you will have to subclass the controls.

The process is fairly easy for labels and check boxes, not so much for listboxes.


Let me know if (and when) you become interested in such a solution and I could post some code and suggestions using 1.02 (Its the oldest version I have).
Avatar of dmag

ASKER

I understand that the default labels/checkboxes don't do wrapping. And that I could write one myself given enough time and energy. But I have to think that SOMEONE has already encountered this problem and written a solution.

For 200 points,  I don't want 'suggestions'-- I want working code. If you wrote something (or have the time and energy to write something) by all means, post it.

All it has to do is automatically wrap text in labels and checkboxes. Java 1.02 is fine.
ASKER CERTIFIED SOLUTION
Avatar of blacklion
blacklion

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dmag

ASKER

Thanks! (note for those using 1.0, just change getSize() to preferredSize() or bounds().)
Also I saw implementaion using just multiple AWT labels. But that code still have to wrap lines, but does not have to draw them.
Hi this works good.exept that every time it is written the old text isn't removed.
any ideas?