returning PopUpMenu
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   a_a
Posted On:   Thursday, December 13, 2001 07:44 PM

Hi ! I have an applet which is written in AWT. To my Panel I am adding a PopupMenu: class MyPanel extends Panel{ ... private PopupMenu popup = new PopupMenu("mymenu"); ... public MyPanel(){ add(popup); ... } } I am looking for a way to get back PopupMenu object from MyPanel. I cannot use this public Component[] getComponents() Component array = MyPanel.getComponents(); for(int i=0;i { if(array[i] instanceof Panel) //I cannot do this since PopUpMenu extends MenuComponent class not Compon   More>>

Hi !

I have an applet which is written in AWT. To my Panel I am adding a PopupMenu:


class MyPanel extends Panel{
...


private PopupMenu popup = new PopupMenu("mymenu");
...


public MyPanel(){


add(popup);


...
}


}


I am looking for a way to get back PopupMenu object from MyPanel.


I cannot use this
public Component[] getComponents()

Component array = MyPanel.getComponents();
for(int i=0;i
{
if(array[i] instanceof Panel)
//I cannot do this since PopUpMenu
extends MenuComponent class
not Component

}


How do I get PopUpMenu?

   <<Less
About | Sitemap | Contact