File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Displaying data when window opens Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Displaying data when window opens" Watch "Displaying data when window opens" New topic

Displaying data when window opens

Geoff Jefferson
Ranch Hand

Joined: Apr 09, 2009
Posts: 102

I am interested in displaying data in a given component (JRadioButton) when the user opens a window such as
a JFrame. Currently I have experimented with windowActivated(), and windowOpened() with some
success. The only problem ( so far ) is that when the user changes the data in the field, then changes to
another sreen in another app ( alt-tab ) and returns, the data reverts back to the original data.

This module is being used to modify data stored on the hard drive.

What is a good way to accomplish this?


Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2454
I can understand windowActivated refreshing the value, but windowOpened should only be invoked once so it should work.

Post your SSCCE demonstrating the problem.

Of course you can always remove the listener once the code has been executed once.
I agree. Here's the link:
subject: Displaying data when window opens
It's not a secret anymore!