
Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
>> I am having a hard time replacing the content of a JPanel by another
>> one. Can't seem to see the JPanel that replaces the older JPanel
[quoted text clipped - 21 lines]
> Method updateUI() is supposed to be used when the look&feel of a
> component has changed. Instead try Class_A.detailTabbedPane.revalidate();
The .revalidate() is not working. Can not understand it. I tried again
(below). Why can't I do say in Class_B:
*SelectedtabbedPane.dummyPanel_A = dummyPanel_B*
----------------------
*Class_A*
protected static JPanel dummyPanel_A;
detailTabbedPane.addTab("Tab Title", null, new
JScrollPane(dummyPanel_A),"Tab Tip");
... upon user tab Selection in Class_A
Class_B.retrieveIPInformation(someString,SelectedtabbedPane,dummyPanel_A)
*Class_B*
Make changes to dummyPanel_B then want to replace the Class_A panel
dummyPanel_A with dummyPanel_B in SelectedtabbedPane (using Goodies Forms)
protected static JPanel dummyPanel_B;
static void retrieveIPInformation(String insomeString,JTabbedPane
SelectedtabbedPane,dummyPanel_A )
..... Build the dummyPanel_B
dummyPanel_B = builder.getPanel();
..... Switch the dummyPanel_A
dummyPanel_A = dummyPanel_B;
..... or
Class_A.dummyPanel_A = dummyPanel_B;
SelectedtabbedPane.revalidate();

Signature
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
IchBin - 23 Feb 2005 01:01 GMT
I guess my question is:
How can you update a JPanel that is embedded within a JScrollPane within
a JTabbedPane object from a different Class? Reflection? I am at a lost
to resolve with out a redesign.

Signature
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
Bill Tschumy - 23 Feb 2005 02:50 GMT
> I guess my question is:
>
> How can you update a JPanel that is embedded within a JScrollPane within
> a JTabbedPane object from a different Class? Reflection? I am at a lost
> to resolve with out a redesign.
Can't you keep a reference to the tabbedPane somewhere that your code can get
at. Then you just do:
myTabbedPane.setComponentAt( index, newComponent);

Signature
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com
IchBin - 23 Feb 2005 03:54 GMT
>>I guess my question is:
>>
[quoted text clipped - 6 lines]
>
> myTabbedPane.setComponentAt( index, newComponent);
Bill...
Thank you so much! This does work.
I thought I tried this before. Apparently I did not have the correct
object reference. It does replace the component but I had it inside a
JScrollPane. After issuing the setComponentAt() it replaces the
JScrollPane(target_panel) with the new target_panel.
I am way a head of where I have been, with your help. To replace the
JScrollPane(target_panel), not just the panel I tried:
JScrollPane dummyJScrollPane = new JScrollPane(dummypanel_B);
SelectedtabbedPane.setComponentAt( 3, dummyJScrollPane);
Works like a charm....

Signature
Thanks again Bill...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist