0
RSSReaderコンポーネントを使用してrss要求エラーを処理しようとしています。私はこのように私のRssReaderを作成し、次のようLWUITのRSSReaderエラーの処理
RSSReader r = new RSSReader();
r.setTargetContainer(c.getParent());
r.setUIID("RSSReader");
r.setURL("some feed url");
r.setProgressTitle("Fetching News Feed");
r.setHint("RSS Data Will Show Here");
r.setLimit(10);
NetworkManager.getInstance().start();
r.sendRequest();
myL x = new myL();
NetworkManager.getInstance().addErrorListener(x);
findRssContainer(c.getComponentForm()).removeComponent(findBtnLoadRss(c.getComponentForm()));
とmyL
クラスが書かれている:
class myL implements ActionListener
{
public void actionPerformed(ActionEvent ae) {
Container c = (Container)ae.getComponent(); //returns null pointer exception
findRssContainer(c).addComponent(findBtnLoadRss(c));
}
}
問題はae.getComponent
がnullであるということですので、私はエラーがfindContainer
を呼び出そうとします。私は成功なしでActionEventのあらゆる種類のプロパティを試しました。誰もがこの問題の回避策を知っていますか?
ありがとうございました!
class myL implements ActionListener
{
public Form f;
public myL(Form frm)
{
f = frm;
}
public void actionPerformed(ActionEvent ae) {
if(findBtnLoadRss(f).getParent() != null)
{
findRssContainer(f).addComponent(findBtnLoadRss(f));
}
}
}
を、パラメータとして
c.GetComponentForm()
で
myL
を構築する: