Is it possible to activate the context menu of the Operating System in swing application?

2

Some time ago I realized that it is not possible to call the context menu of the operating system in swing components, although it is possible to perform standard keyboard actions (such as copying, pasting, cutting, selecting) on these components without having to implement nothing additional.

  • Why does not the system context menu work within swing applications?

  • Is there any way to activate it or just by implementing this menu using the swing components themselves?

asked by anonymous 11.01.2017 / 13:22

1 answer

4

What happens is that Operating Systems have native features for creating windows, menus, etc. that are not portable between them, that is, if you create a window using a language in Windows using the available features of the OS it will only work on Windows, the same goes for Linux. To access native features you can use AWT components.

Swing has emerged as a solution to allow software portability across multiple OSs, so long as the Operating System has a Java virtual machine installed.

Swing builds windows and menus that are interpreted by the Java virtual machine, do not use native features of Operating Systems.

You can know a little more about AWT x Swing at the following link: link

    
11.01.2017 / 19:07