Reputation: 117
I am in the process of developing a Java application using Swing. I want to open a document file inside the application where a user can select some content. On right click, it should give list of all the fields above, when user clicks on a field the selected part from the document goes to that particular field.
Please refer the image:
Upvotes: 1
Views: 645
Reputation: 205785
You can select text in a JTextComponent
and bring up a JPopupMenu
. The menu should have an Action
for each field that copies the selected text to the corresponding field. This related example illustrates some of the concepts.
Upvotes: 3