• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working with UIManager.setLookAndFeel

 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may get cut, copy and paste for free using key strokes, but you'll have to add them to the context menu manually.
 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good grief! What sort of constructor have you got for MeineAktionen?
 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

Absolutely correct.Yer good;)
 
Rob Spoor
Sheriff
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just a matter of experience
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic