-
Drag/dropping entities into a JTextPane
Hello Devx.
At the moment I need to be able to have a text pane represent a report. The report will need to store entities, so I will need to use icons, labels, or something to represent them in the report. My goal in doing this is representing "entities" inside a report, and not allowing the user to fudge with them.
I.e., here is what I don't want to happen. Let's say my entities look like [Lewis, Jerry 234324234]. I will need to parse those out later, and I don't want the user to be able to "simulate" them by typing in brackets, a name, and a number for example; and thereby break my parsing scheme.
My current solution is to drag and drop JLabels into the text pane and use them to represent entities. The solution still seems somewhat crude to me. They do have the advantage of not being fabricated by a user, and if you back space over them the entire thing disappears which is necessary when dealing with entities.
But there has got to be a better way. I haven't used JEditorPanes much. My only other idea is inserting some kind of atomic HTML tag that is not reproducible by the user.
I need a way to represent entities atomically in a JTextPane, so they can be parsed out later.
Any ideas?
-
I think I've figured it out.
I'm going to use a JEditorPane that renders HTML, and insert tags that hold metadata. That should work, and be easy to parse later on.
Similar Threads
-
By mmmisa83 in forum Java
Replies: 0
Last Post: 09-26-2006, 04:12 AM
-
By Gengar003 in forum Java
Replies: 1
Last Post: 05-13-2006, 11:14 PM
-
Replies: 1
Last Post: 10-20-2005, 10:33 AM
-
By François Bélair in forum Java
Replies: 0
Last Post: 08-26-2000, 02:19 PM
-
By Christian Calloway in forum Java
Replies: 0
Last Post: 06-19-2000, 11:27 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|