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

Working with UIManager.setLookAndFeel

mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi,

I am currently working on a small text editor, I had made a method to add certain actions on right mouse click.



here is how the actions are set up





and then later i thought that if i use the UIManager.setLookAndFeel , I would automatically get the actions such as ctrl+c, and ctrl +v and so on , which works great except i don't
know how i can have these actions added to the kontextMenu();I imagine there is a way to do it, but i haven't the slightest idea at the moment.

Thanks
Mike
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

You may get cut, copy and paste for free using key strokes, but you'll have to add them to the context menu manually.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi Rob,

Thanks for your reply.I thought maybe there would be a method already in place to do this,but ok then i will do it manually.

Thanks
Mike
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

so i will show how i did it just in case this might help someone else in the furture, was more than simple!! lol


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38340
    
  23
Good grief! What sort of constructor have you got for MeineAktionen?
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

hi Campbell ,

once again, this is from my course and that is how they do it

here is how it looks, maybe you can tell me how i could do it properly, only if you have time;) I understand you all do this on your own time.

Just a thank you here to all of you who help here!!!

By the way these course books were written i think in 2007, don't know if everything has changed that drastically since then.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Campbell Ritchie wrote:Good grief! What sort of constructor have you got for MeineAktionen?

From the looks of it:
I'm not 100% sure about the last one; my guess it's the action command for actions fired from the Action implementation, something MeineAktionen clearly is. It probably extends AbstractAction, and I can even guess the implementation of that constructor:
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi Rob,

Absolutely correct.Yer good;)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

It's just a matter of experience
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Working with UIManager.setLookAndFeel