waiting message

Discussion in 'Java' started by kastis, Dec 14, 2003.

  1. kastis

    kastis Guest

    I'm calling remote methods on the server, where database queries are
    executed.
    sometimes it takes a while to get the results back to the client side.
    I'm trying to display JDialog with message to wait, but while dialog
    box appears immediatelly, the content inside it only appears when
    remote method returns data, and that makes dialog box rather
    irelevant.

    what can I do to get message window displayed while waiting for data?
    kastis, Dec 14, 2003
    #1
    1. Advertising

  2. kastis

    Harald Hein Guest

    "kastis" wrote:

    > I'm calling remote methods on the server, where database queries
    > are executed.
    > sometimes it takes a while to get the results back to the client
    > side. I'm trying to display JDialog with message to wait, but
    > while dialog box appears immediatelly, the content inside it only
    > appears when remote method returns data, and that makes dialog box
    > rather irelevant.
    >
    > what can I do to get message window displayed while waiting for
    > data?


    This gets asked again and again. Read the cljg FAQ (posted a month or
    so ago), and read about the Swing threading model.

    You might also want to learn about proper newsgroup behavior (posting
    to one relevant group only instead of posting to a bunch of groups, and
    reading past articles and the FAQ before posting).
    Harald Hein, Dec 14, 2003
    #2
    1. Advertising

  3. Thomas Weidenfeller, Dec 16, 2003
    #3
  4. You would have to launch the remote request in a different thread (which you should be doing anyway if you are currently launching the request within an Action or something like that... you are basically blocking the whole event thread by doing that). I'm no guru w.r.t. Swing thread saftey issues but I would imagine that you would still be able to call setters on the dialog from the other thread and get it to redisplay properly.

    kastis wrote:
    > I'm calling remote methods on the server, where database queries are
    > executed.
    > sometimes it takes a while to get the results back to the client side.
    > I'm trying to display JDialog with message to wait, but while dialog
    > box appears immediatelly, the content inside it only appears when
    > remote method returns data, and that makes dialog box rather
    > irelevant.
    >
    > what can I do to get message window displayed while waiting for data?
    Charles Fineman, Dec 18, 2003
    #4
  5. Charles Fineman wrote:
    > You would have to launch the remote request in a different thread (which
    > you should be doing anyway if you are currently launching the request
    > within an Action or something like that... you are basically blocking
    > the whole event thread by doing that).


    Yes.

    > I'm no guru w.r.t. Swing thread
    > saftey issues but I would imagine that you would still be able to call
    > setters on the dialog from the other thread and get it to redisplay
    > properly.
    >


    Actually, while this usually works in practice it is technically
    incorrect. If your code affects Swing components it should execute
    within the Swing thread. This can be accomplished by using the
    SwingUtilities.invokeLater() method.

    Ray
    Raymond DeCampo, Dec 20, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grant Merwitz

    XmlHttp (Ajax) Show Waiting Message

    Grant Merwitz, Jan 10, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    7,820
    Grant Merwitz
    Jan 11, 2006
  2. Mark Richards
    Replies:
    2
    Views:
    1,081
    Andrew Thompson
    Oct 8, 2004
  3. =?Utf-8?B?SGlyYWs=?=
    Replies:
    0
    Views:
    1,307
    =?Utf-8?B?SGlyYWs=?=
    May 26, 2006
  4. Replies:
    0
    Views:
    518
  5. fabrice

    Progress Bar or Waiting message

    fabrice, Aug 24, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    11,240
    fabrice
    Aug 24, 2006
Loading...

Share This Page