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.
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