Results 1 to 3 of 3

Thread: Event Handling

  1. #1
    zzpprk is offline Member
    Join Date
    Aug 2009
    Posts
    26
    Rep Power
    0

    Default Event Handling

    Hi

    Hope you can help because I am at a loss on thios one.

    As part of the actionPerformed(ActionEvent) method on a window (call it A), I open-up a second window B.

    The problem is that window B is only partially displayed and window A goes blank whenever I move window B around using the mouse.

    All is fine if I open window B outside the event handler as a test so the problem is not with window B.

    Seems to be that this weird display behaviour might be caused by the system being blocked because it is processing an event on window A. How can I tell the system that I have finished handling the event before I open window B?

    Any ideas is much appreciated.

    Regards

    Patrick

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    You've likely got a bug in your code. Where, I've no idea. Is your Swing code calling a time-consuming process but not calling this in a background thread? Again, there's no way for us to know what's going on given the information as presented by you. We'll need more information and code.

    Much luck.

  3. #3
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    How can I tell the system that I have finished handling the event before I open window B?
    To schedule an action to follow completion of the current event:
    Java Code:
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
            // here code to create the other window
    }
    });

Similar Threads

  1. Event handling... help?
    By kevzspeare in forum New To Java
    Replies: 2
    Last Post: 04-04-2009, 09:46 PM
  2. Event handling in JSF
    By java08 in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 03-24-2009, 07:42 AM
  3. rmi and event handling
    By darkhorse in forum Advanced Java
    Replies: 0
    Last Post: 03-15-2009, 09:20 AM
  4. SWT Event Handling
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-30-2007, 01:21 PM
  5. Event Handling
    By luisarca in forum Sun Java Wireless Toolkit
    Replies: 5
    Last Post: 05-07-2007, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •