Assume I start a java app whose GUI contains a couple of entry fields (and labels).
Initially I can fill these entry fields (resp. labels) with some values.
Once the GUI dialog is displayed the user is normally able to enter something else.
But AFAIK the content values can NOT be updated by the prgm resp. a remote server AFTER the display.
Maybe there is a trick to update it anyway.
In former Java versions this "Push" technology was not possible.
But iI could imagine that the newer Java version contain meanwhile this "Push" feature.
How do I do this?
Cat
Andrew Thompson - 18 May 2008 10:45 GMT
> Assume I start a java app whose GUI contains a couple of entry fields (and labels).
> Initially I can fill these entry fields (resp. labels) with some values.
>
> Once the GUI dialog is displayed the user is normally able to enter something else.
> But AFAIK the content values can NOT be updated by the prgm resp. a remote server AFTER the display.
Out of morbid curiosity..
Can you describe a use-case* where this actually
makes any sense?
* And no, I do not consider 'P*ss off the end-user'
to be a valid use-case.
(Good call on setting the follow-ups to c.l.j.help only,
though it might pay to warn these poor c.l.j.programmers
why they may not see their own replies!)
--
Andrew T.
PhySci.org
RedGrittyBrick - 18 May 2008 11:35 GMT
> Assume I start a java app whose GUI contains a couple of entry fields (and labels).
> Initially I can fill these entry fields (resp. labels) with some values.
[quoted text clipped - 7 lines]
>
> How do I do this?
As, Andrew implies, the user might be surprised by this.
However I don't understand what the technical problem is. Presumably the
program might work as follows:
* Application is started
* Application creates GUI and sets default values
* Application displays GUI
* User enters own values into fields
* User clicks a button (or performs some equivalent action)
* Application sends data to server?
* Server responds with new data values
* Application inserts new data values into fields.
Or
* Application is started
* Applications starts a "listener" thread.
* Application creates GUI and sets default values
* Application displays GUI
* User enters own values into fields
* User clicks a button (or performs some equivalent action)
* Application sends data to server?
* Server acknowledges receipt.
* Time passes
* Server sends updated data values to "listener"
* Application inserts new data values into fields.
You don't say whether the application GUI is Swing Desktop, JSP, JSF or
something else.
You don't say whether the Application and server communicate using HTTP,
SOAP, Sockets or something else.
If you provide a little more detail (an SSCCE is always good), someone
may be able to help.

Signature
RGB
Andrew Thompson - 18 May 2008 11:46 GMT
On May 18, 8:35 pm, RedGrittyBrick <RedGrittyBr...@SpamWeary.foo>
wrote:
...
> As, Andrew implies, the user might be surprised by this.
You have a truly eloquent way of putting things.
I wish I had your skill with words, ..or perhaps
the temperament that allows me enough time to
pause and think of wording things in such a
friendly way. ;-)
--
A.
Andrea Francia - 18 May 2008 14:16 GMT
>> Assume I start a java app whose GUI contains a couple of entry fields
>> (and labels).
[quoted text clipped - 42 lines]
> You don't say whether the application GUI is Swing Desktop, JSP, JSF or
> something else.
Assuming that
- the client GUI application uses Swing components
- the client is connected to the server through RMI
You can use the beansbinding framework that allow you to bound the
properties of a local object to the swing components properties. If the
property is a JavaBean bound property the bound swing component can be
configured to be updated whenever the property change.
But, obviously, the local object has to be on the same JVM of the swing
component.
To bound the server changes to the local object you can use a remote
change listener.

Signature
Andrea Francia
http://code.google.com/p/remoted-list/ - Lazy loading lists through RMI.
Jeffrey H. Coffield - 18 May 2008 16:03 GMT
> Assume I start a java app whose GUI contains a couple of entry fields (and labels).
> Initially I can fill these entry fields (resp. labels) with some values.
[quoted text clipped - 9 lines]
>
> Cat
If you want an event on the server to update a Web app, I believe
something called Comet (an extension of Ajax) can do this. It depends on
having a persistent connection. See
http://en.wikipedia.org/wiki/Comet_(programming)
Jeffrey Coffield
Mark Space - 18 May 2008 17:32 GMT
> Assume I start a java app whose GUI contains a couple of entry fields (and labels).
> Initially I can fill these entry fields (resp. labels) with some values.
>
> Once the GUI dialog is displayed the user is normally able to enter something else.
> But AFAIK the content values can NOT be updated by the prgm resp. a remote server AFTER the display.
Well, setText() works fine, so I'm not sure what you're saying about
push technology or previous versions. Servers and remote processes and
such like of course require that you do some actual socket programming,
as far as I know.
Perhaps however you've confused Java with Javascript? The two are
totally different.
A code example would clear this up. See this for code examples:
<http://sscce.org/>
Roedy Green - 27 May 2008 06:09 GMT
>Maybe there is a trick to update it anyway.
>In former Java versions this "Push" technology was not possible.
>But iI could imagine that the newer Java version contain meanwhile this "Push" feature.
You would do this with a multithread applet and a socket. You could
send a stream of gzipped serialised objects to the Applet.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com