I am looking to find out if any API exists that can complete a task I am considering. I want to create a tool that allows a user to upload a xml file. I want that XML file to be displayed visually in a GUI. Using an API (I assume) I then want to give the user the ability to click on any tag. Once the user clicks a tag I would like for a second method to run which takes that value and runs some other methods. (The other methods include some DB calls but are not important).
I'm rather in the dark here with no idea how to accomplish this. I know how to display a XML in a java swing GUI but I am not sure how to allow a user to click on those tags AND have the values captured.
Would a API be required to do this or are there already some ways within vanilla Java that could allow it? Please give me a name of an API if you know.
Thank you.
1 Answers
Answers 1
You should be able to do that with javax.swing.JTree and javax.swing.event.TreeSelectionListener.
https://docs.oracle.com/javase/7/docs/api/javax/swing/JTree.html https://docs.oracle.com/javase/7/docs/api/javax/swing/event/TreeSelectionListener.html
0 comments:
Post a Comment