The Artima Developer Community
Sponsored Link

Java Answers Forum
remove panel and add it again

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Joao

Posts: 1
Nickname: pitius
Registered: Jul, 2003

remove panel and add it again Posted: Jul 30, 2003 8:58 AM
Reply to this message Reply
Advertisement
Hi gurus!
I add a Panel divided in two, then I remove the 2nd and I want to add it again (with new data) when a button is pressed.
When I add it 2nd time it stays blank.
This is a sample code:
public class XXX extends YYY
{
String currentDirectory="D:\\";
ZZZRenderer bkCanvas=new ZZZRenderer(currentDirectory);
ZZZTest test=new ZZZTest();
TextField setField=new TextField("",20);


public XXX()
{

setLayout(new GridLayout());
add(test);
add(bkCanvas);

}

public boolean action( Event evt, Object arg)
{

if (evt.target instanceof Button)
{
currentDirectory = (String)arg;
remove(bkCanvas);
bkCanvas=new ZZZRenderer(currentDirectory);
add(bkCanvas);
}
}
}
In the console I get the error:
Error null

Any ideas

Topic: One last thing... counter doest work!! Previous Topic   Next Topic Topic: buttons help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use