In the following code, implement the Makemenu () method to add a menu to the Eclscreen window.
public class Eclscreen extends Mainscreen
{
Richtextfield TextField;
Public Eclscreen ()
{
Settitle ("pushed Data Listener");
LabelField label = new LabelField ("pushed Data:");
Add (label);
TextField = new Richtextfield ();
Add (TextField);
}
/******************************************************************************************
* Makemenu (Menu,int)-Creates a custom Menu to add user define fields
******************************************************************************************/
protected void Makemenu (Menu menu, int instance)
{
MenuItem Optionmenu = new MenuItem ("Option", 100, 10) {
public void Run () {
Optionscreen screen = new Optionscreen ();
Uiapplication.getuiapplication (). Pushscreen (screen); Click menu option to pop up a new window Optionscreen
}
};
Menu.add (Optionmenu);
}
}