Results 1 to 4 of 4

Thread: Event Queue

  1. #1
    netboy is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Event Queue

    Hello,

    I'm implementing a media player in swt. It is having play/pause, forward and rewind buttons. It is possible for me to create a queue for handling the click events? I mean when the user clicks one of the events, it is added to a queue and then a thread or a job will get the event from the queue and process it.

    I came to know that there is an EventQueue and Toolkit.getDefaultToolkit().getSystemEventQueue(), which is already implemented in java. Can I use it for this purpose or do I have to implement the queue myself?

    Thanks,
    netboy

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,772
    Blog Entries
    7
    Rep Power
    21

    Default Re: Event Queue

    That Toolkit class is a member of the AWT framework; you're not using it, you're using SWT, another framework. It's extremely hard to combine those two different frameworks.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    netboy is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Re: Event Queue

    Hello Jos,

    Thanks for the reply. I came to know a few minutes ago that EventQueue and Toolkit belongs to AWT. Is there any other method that you can suggest?

    Thanks,
    netboy

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,772
    Blog Entries
    7
    Rep Power
    21

    Default Re: Event Queue

    Quote Originally Posted by netboy View Post
    Thanks for the reply. I came to know a few minutes ago that EventQueue and Toolkit belongs to AWT. Is there any other method that you can suggest?
    I googled a bit on "swt event queue" and found this. Hopefully it is of any use.

    kind regards,

    Jos

    ps. if all else fails, you can write your own queue (see the java.util.concurrent package for some helpfull classes).
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 0
    Last Post: 05-27-2011, 09:46 AM
  2. event queue
    By nikkka in forum New To Java
    Replies: 2
    Last Post: 04-22-2011, 02:47 PM
  3. Queue
    By DCY in forum New To Java
    Replies: 6
    Last Post: 05-04-2010, 09:07 PM
  4. checking for an event during an event
    By infinity in forum AWT / Swing
    Replies: 22
    Last Post: 04-09-2009, 02:08 AM
  5. Queue in the GUI
    By jonywalker123 in forum Advanced Java
    Replies: 2
    Last Post: 03-06-2009, 09:33 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
  •