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 / General / November 2006

Tip: Looking for answers? Try searching our database.

remnants of deleted component still displayed on screen.

Thread view: 
Justin - 01 Nov 2006 18:41 GMT
I cant for the life of me figure this out.

I have a JPanel inside a JScrollbar inside another JPanel inside a
JPanel inside another JScrollBar inside an extended JDialogBox.

I have code to remove an element from the innermost JPanel.  I then
called validate(); on the inner most JPanel and JScrollBar.  However,
the graphic of the component remains.  So then I proceded to call
validate on all components in the heirarchy, and still the graphic
remains.

It's probably something absoletly retarded that I'm forgetting to do,
but it is irritating the hell out of me.
Justin - 01 Nov 2006 19:00 GMT
Part of the code is adding and removing componenets.  The user selects
a componenet that he/she does not want anymore, and it is removed from
the list (the list exists inside the innermost JPanel).  As long as
there is 1 or more instantiated elements, it works fine.  I am guessing
because it paints itself over the remnants of the deleted element.
However, when I delete the last element, I would like just a grey
background to show.  I did try setting the background to grey after
removing all components, but to no avail.

> I cant for the life of me figure this out.
>
[quoted text clipped - 9 lines]
> It's probably something absoletly retarded that I'm forgetting to do,
> but it is irritating the hell out of me.
Robert - 01 Nov 2006 19:50 GMT
> Part of the code is adding and removing componenets.  The user selects
> a componenet that he/she does not want anymore, and it is removed from
[quoted text clipped - 18 lines]
>> It's probably something absoletly retarded that I'm forgetting to do,
>> but it is irritating the hell out of me.

I would attempt to add the innermost JPanel to the innermost JScrollPane again
using setViewportView or similar. This has obviously not been tested etc but I
seem to recall that it works.

All the best,

Robert
Justin - 01 Nov 2006 20:17 GMT
Thank you thank you thank you

Did the trick...

> > Part of the code is adding and removing componenets.  The user selects
> > a componenet that he/she does not want anymore, and it is removed from
[quoted text clipped - 26 lines]
>
> Robert


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.