[英]How would i go about to attache a MongoDb Collection to a Java View
How would i go about to attache a collection
of MongoDb logging Document
to a JTable
or JList
or even a JTextPane
. 我将如何将MongoDb记录Document
的collection
附加到JTable
或JList
甚至JTextPane
。 The state of all Document
in the Collection
must be shown in real time sorted by insertion Date
. Collection
中所有Document
的状态必须实时显示,并按插入Date
排序。 When a new Documents
is inserted the View must reflect that. 插入新Documents
,视图必须反映出来。
This can of course be done by writing the code. 当然,这可以通过编写代码来完成。 What i look for is some existing technics for this 我正在寻找的是一些现有的技术
The java display should be easy. Java显示应该很容易。 Just implement a Table model for your JTable, that displays the field from the DBObject returned by MongoDB. 只需为您的JTable实现一个Table模型,它就会显示MongoDB返回的DBObject中的字段。 Then just trigger a redraw, when new data is available. 当有新数据可用时,只需触发重绘。
Why would you want to use a Text-Pane? 您为什么要使用文本窗格?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.