简体   繁体   中英

Text Document Editor in Java Swing Application

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:

图片

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM