aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes getActions() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "getActions() method" Watch "getActions() method" New topic
Author

getActions() method

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
1.getActions() method returns an aray of Action object. do the number of objects differ for different components?.

2. what does the returned array hold? if they are the actions that a component on which the getAction() method was called can perform, why do some components like menu don't have the getAction() method. doesn't that mean we can't perform any action on menus.


have a great day,
krishna prasad
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

I don't know for sure, but I think that you can only perform actions for JMenuItem s.

What kind of Action do you want to do for JMenu s?

Kaydell
[ May 17, 2007: Message edited by: Kaydell Leavitt ]
krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
may be i want to make a right click on menu and see if i have anything i can do,say like add some more items to that menu, just like we do in windows.
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

Would a PopupMenu give you what you need?

I mostly use a Mac but I'd like to learn about what you said about right-clicking on menus to add to menus. Where is that?

Kaydell
[ May 17, 2007: Message edited by: Kaydell Leavitt ]
krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
that is when we right click on the menubar of any window, it's espective options will appear and when we click the option that particular option or all of it's associated options will appear on tha menu. for example when we right click on the meu of an IE window, options like 'standard buttons', 'address bar' etc., will appear, and when you choose any of them a set of items appear on th menu bar. How come we achieve this kind of operation in java swing when thre is no action assocated with JMenubar.
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

I don't know the answer to your question, but I know that on the Mac, you right-click -- not on the menu bar -- but you right-click in the Tool area.

I want to develop Swing apps that work for both Mac and Windows and work in a manner that when run on a Mac would work the way that a Mac user would expect and when run on Windows would work in the way that a Windows user would expect.

Kaydell
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getActions() method