Is it possible to empty the existing one, so that I can fill it like in example3 with all of my own selections?Or is it possible to disable it?

I have created my own one. On windows it replaced completely yours.But on Linux, after my own JPopupMenu closed, yours opened. So it would be helpful, if there is a possibility to disable yours or to empty it, so that I can fill it completly myself.

Call textArea.setPopupMenu(null), then call textArea.setComponentPopupMenu(myPopup). This will only work with Java 5+ (which you almost certainly are using).

The only reason RSTA defines "setPopupMenu()", "getPopupMenu()" and "createPopupMenu()" methods is because RSTA is usable in Java 1.4, whereas the Java API for context menus (get/setComponentPopupMenu()) was added in Java 5. So you can either use RSTA's API and not use Java's standard API, or set the RSTA-specific context menu to "null" and use the methods added in Java 5 exclusively.

If you're having trouble, feel free to post some code showing what you are doing.