-1

I have a streaming application which fetches data from Twitter. I'd like to show some of the statistics that I compute into a real-time window. I'd like to know if it's possible to create a static window with dynamic content (maybe with JOptionPane?). By dynamic I mean something that is updated from time to time. Example:

enter image description here

The window has only the "close" button. The number refreshes itself every tot x seconds.

Any help is appreciated, I haven't found anything helpful on the Internet.

sirdan
  • 1,018
  • 2
  • 13
  • 34
  • "a static window with dynamic content" Isn't this what every app ever created is? I'm not sure what you mean. – Steve Smith Jun 16 '17 at 15:06
  • By dynamic I mean something that refreshes, while the windows stays where it is – sirdan Jun 16 '17 at 15:10
  • Don't all apps do that? If I open VLC to watch a video, the window doesn't move around the screen. – Steve Smith Jun 16 '17 at 15:11
  • No, it's not what I mean. I'm gonna edit the question with a pic to make it clearer – sirdan Jun 16 '17 at 15:12
  • @SteveSmith question updated, what do you think? – sirdan Jun 16 '17 at 15:16
  • It's just a window showing content. What is the specific problem you are facing? – Steve Smith Jun 16 '17 at 15:17
  • Do I have to close the window each time the content is refreshed, or can I just change the content without closing the window? That's the real point of the question – sirdan Jun 16 '17 at 15:18
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/146893/discussion-between-steve-smith-and-sirdan). – Steve Smith Jun 16 '17 at 15:19
  • 1
    If latency is minimal, try this [example](https://stackoverflow.com/a/44417958/230513); otherwise consider `SwingWorker`, for [example](https://stackoverflow.com/a/4637725/230513). – trashgod Jun 16 '17 at 16:16

1 Answers1

0

I do not really understand your "static window"...

However you can add a background thread, or even a timer to update the contents of your window.

Usagi Miyamoto
  • 6,196
  • 1
  • 19
  • 33