Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2006

Tip: Looking for answers? Try searching our database.

Update bounds of a textfield while editing

Thread view: 
Jens Piegsa - 31 Dec 2006 16:34 GMT
Hi folks!

I want to have a TextPane, that always have the size of
it's content. i used a DocumentListener to update the bounds
in the help of getPreferredSize().
Now i got the problem, that sometimes a new line is inserted.
The behaviour results of first inserting a new char and than
updating its bounds. In this case it has to work somehow the
other way around. (But i can't get the preferred size before)

Who can help me with that little hen-egg problem?
Maybe a totally different approach.

- Jens
Andrew Thompson - 31 Dec 2006 17:42 GMT
...
> I want to have a TextPane, that always have the size of
> it's content.

That's interesting for you.  ..what do your users want?

> Maybe a totally different approach.

..the path of least surprise?

Andrew T.
Jens Piegsa - 31 Dec 2006 18:14 GMT
Andrew Thompson schrieb:
> ...
>> I want to have a TextPane, that always have the size of
[quoted text clipped - 7 lines]
>
> Andrew T.

Ok, maybe the wished behavior sounds a little surprising
without the context.
This text field is used for direct editing of nodes in a
graph.
Not every problem can be solved by moving it into a
that-doesn't-make-sense-space. ;-)

Jens


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.