开发者

Drag and Drop through html table and Swing?

Is it possible to drag and drop some table from a web page开发者_如何学编程 and get the same table structure on a JTable?


You'll want to implement a DropTargetListener on the swing component you want to drag the HTML into. Then get the HTML from the drag using a text/html DataFlavor, and parse the HTML, converting it into a TableModel. Set this TableModel on your JTable.


I rode it is possible to Drag n Drop from desktop to browser, but not the other way around.

So, i don't know the answer to your question, but i would mention a little idea came to mind, maybe you find interesting:

Not directly dragging the table to the swing app. Instead drag that table from the browser, to some textArea or image on the page. It could then automatically transform the tabellar data to XML start some stream that sends that data to your swing application(Maybe some webservice could do pass it to the desktop app).

I don't know if that can help you giving you some tips, other thing comes to my mind is the dropbox API for java, check it out, maybe you have some interesting features that can help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜