Hi
u can add the run time menus. u can go thru this example,which adds a new Menu when a button is clicked..
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class runtimemenu extends JFrame implements ActionListener
{
Container contentPane;
JMenuBar mb;
JMenu file,edit;
JMenuItem open,cut;
JButton addButton;
runtimemenu()
{
contentPane = getContentPane();
file = new JMenu("File");
edit = new JMenu("Edit");
open = new JMenuItem ("open");
cut = new JMenuItem ("cut");
file.add(open);
mb = new JMenuBar();
mb.add(file);
setJMenuBar(mb);
addButton = new JButton("Add a menu");
contentPane.add(addButton);
addButton.addActionListener(this);
contentPane.setLayout(new FlowLayout());
setSize(300,250);
setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
edit.add(cut);
mb.add(edit);
setJMenuBar(mb);
validate();
}
public static void main(
String a[])
{
new runtimemenu();
}
}
cheers,
Raj