-
Help With Menus
Okay I'm using some menus, I have a File Menu and then when I pull that down I get Open, Save, and Exit. How is it possible to make Open have a pull down menu? Like in IExplorer with New it has a submen? I can't figure it out but here is the code I have that makes the menu.
MenuBar bar = new MenuBar();
theframe.setMenuBar(bar);
Menu FileMenu = new Menu("File");
bar.add(FileMenu);
MenuItem Open = new MenuItem("Open", new MenuShortcut(KeyEvent.VK_O));
MenuItem Save = new MenuItem("Save", new MenuShortcut(KeyEvent.VK_S));
MenuItem Exit = new MenuItem("Exit", new MenuShortcut(KeyEvent.VK_E));
FileMenu.add(Open);
FileMenu.add(Save);
FileMenu.add(Exit);
Open.addActionListener(this);
Save.addActionListener(this);
Exit.addActionListener(this);[B]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks