Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Creating menus at runtime

Reply
Thread Tools

Creating menus at runtime

 
 
Braga
Guest
Posts: n/a
 
      06-18-2004
Hi.
I whant create my menus (Jmenu) from array aMenus ={"File","Edit",
"Help"}
and menu items (JMenuItem) from array aItems =
{"File,New","File,Save","File,Exit","Edit,Paste ", "Edit,Cut",
"Help,Help"}

my big problem I DON'T KNOW HOW TO DO to create menus at runtime...
aney help please..
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      06-18-2004
On 18 Jun 2004 10:59:07 -0700, Braga wrote:
...
> my big problem I DON'T KNOW HOW TO DO to create menus at runtime...


...that and random SHOUTING..

> aney help please..


please take these sort of
questions over to a more appropriate group..
<http://www.physci.org/codes/javafaq.jsp#cljh>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      06-18-2004
Braga schrieb:
> Hi.
> I whant create my menus (Jmenu) from array aMenus ={"File","Edit",
> "Help"}
> and menu items (JMenuItem) from array aItems =
> {"File,New","File,Save","File,Exit","Edit,Paste ", "Edit,Cut",
> "Help,Help"}
>
> my big problem I DON'T KNOW HOW TO DO to create menus at runtime...
> aney help please..


http://java.sun.com/j2se/1.4.2/docs/...ing/JMenu.html

tells me I can create a JMenu like this:

JMenu menu = new JMenu("File");

There is even more, it also tells me that I can add a JMenuItem. Wow!

JMenuItem item = new JMenuItem("New");
menu.add(item);

http://java.sun.com/j2se/1.4.2/docs/...JMenuItem.html
http://java.sun.com/docs/books/tutor...ents/menu.html

If you want to become a good programmer, learn to read the documentation
first.
 
Reply With Quote
 
David Alex Lamb
Guest
Posts: n/a
 
      06-19-2004
In article <(E-Mail Removed)> ,
Braga <(E-Mail Removed)> wrote:
>Hi.
>I whant create my menus (Jmenu) from array aMenus ={"File","Edit",
>"Help"}
>and menu items (JMenuItem) from array aItems =
>{"File,New","File,Save","File,Exit","Edit,Paste ", "Edit,Cut",
>"Help,Help"}
>
>my big problem I DON'T KNOW HOW TO DO to create menus at runtime...
>aney help please..


This doesn't directly help the OP but...
I've been working on a package for automating menu construction, based on an
idea of Roedy's, whose current state is found at
http://www.cs.queensu.ca/home/dalamb...ge_description

I'd appreciate knowing if there's someone willing to be create or convert a
small application or applet for which automated menu creation might be useful.
--
"Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5
http://www.cs.queensu.ca/~dalamb/ qucis->cs to reply (it's a long story...)
 
Reply With Quote
 
Yu SONG
Guest
Posts: n/a
 
      06-20-2004
Braga wrote:
> Hi.
> I whant create my menus (Jmenu) from array aMenus ={"File","Edit",
> "Help"}
> and menu items (JMenuItem) from array aItems =
> {"File,New","File,Save","File,Exit","Edit,Paste ", "Edit,Cut",
> "Help,Help"}
>
> my big problem I DON'T KNOW HOW TO DO to create menus at runtime...
> aney help please..


Have a look at API.

Also you may need to consider thread issues (i.e. event-dispatching
thread) for "changing" GUI.

--
Song

/* E-mail.c */
#define User "Yu.Song"
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s@%s", User, Warwick);
return 0;}

Further Info. : http://www.dcs.warwick.ac.uk/~esubbn/
__________________________________________________ _____

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating the maximum number of menus and maximum number of stills rossco DVD Video 2 11-24-2005 09:33 PM
creating dynamic menus with submenus from sql paulakeijzers ASP .Net 1 11-08-2005 10:18 AM
Help with creating dynamic menus Peter HTML 4 07-07-2005 10:22 PM
Creating menus =?Utf-8?B?U2FuZHk=?= ASP .Net 5 01-29-2005 07:36 AM
Select menus above flyout menus? help? news.west.cox.net HTML 8 12-09-2004 12:54 PM



Advertisments