MACOS 10.4: Solve AWT Event queue hangup

Hi,
I'm having trouble with the AWT eventqueu. On MacOS 10.4, using Java 5 Runtime, my applet sometimes blocks. When looking at the threadstack, the deadlock always appears in the Event Loop, dispatching an AWT event, blocking in the CGlobalCursorManager._updateCursor call. In fact the CGlobalCursorManager.findHeavyweightUnderCursor Native call.
I already tried some workarounds:
- overwrite the validate method of my custom AWT components. Making sure that they do not block forever. This solves the problem for events coming through the overidden component, but it has to work for every event that might trigger the GlobalCursorManager.
I had some possible solutions for which I would like some pro's and con's in this forum:
1. I could try to kill the event loop. Is it possible to quit the event loop and restart it from within the applet ?
2. Can I force each AWT container to use another implementation of the validate method ?
3. Can I set another, customized, CGlogalCursorManager ?
4. Other possibilities ?
Thanks in advance for all those responding.

I think you mean that I can override the validate method for each custom UI object separately.
That's a possibility, but I was looking for a more general solution. If possible, I would to extends one
class. E.g. can I set another event queue ? That way, I could make a custom event queue in case of a Mac OS browser.

Similar Messages

  • How to "kill" AWT Event Queue thread without using System.exit()?

    When I run my program and the first GUI window is displayed a new thread is created - "AWT-Event Queue". When my program finishes, this thread stays alive and I think it causes some problems I have experienced lately.
    Is there any possibility to "kill" this thread without using System.exit() (I can't use it for some specific reasons)

    All threads are kept alive by the JVM session. When you use System.exit(int) you kill the current session, thus killing all threads. I'm not sure, though...
    What you could do, to make sure all threads die, is to make ever thread you start member of a thread group. When you want to exit you app, you kill all the threads in the thread group before exit.
    A small example:
    //Should be declared somewhere
    static ThreadGroup threadGroup = new ThreadGroup("My ThreadGroup");
    class MyClass extends Thread {
    super(threadGroup, "MyThread");
    Thread thread = new Thread(threadGroup, "MySecondThread");
    void exit() {
    //Deprecated, seek alternative
    threadGroup.stop();
    System.exit(0);
    }

  • AWT-Event queue not responding

    Hi all! I have already posted a message with similar problem wich was solved but this now is a different one.
    I have following situation:
    I have a class that is called from somewhere (I don't know where from) and that displays a JFrame. After it calls setVisible(true) it calls function synchronized lock() which does wait(). After the JFrame is done it calls synchronized unlock() which does notifyAll().
    The purpose is that my JFrame should do some checking and then let the code that called it resume it's work normaly.
    Te problem is that this only works with JDK version 1.3. If I do it on 1.4 the frame doesn't respond to clicks and doesn't repaint. If I remove lock() and unlock() the frame works ok but the main program is not suspended.
    I suppose that the frame needs to make new threads for user clicks or repainting (I have noticed a Timer thread) but it can't do it for some reason.
    Any help?

    Yeah, as the doctor said to the patient who said "Doctor, it hurts when I do this" .. "So don't do that" ... don't do that. That is, it sounds as if your application is posting huge numbers of events? So if your application didn't post so many events, would the event queue not be filled up?
    - David

  • JTable Awt -Event Queue problem

    Hi
    I've been looking everywhere for a solution to this, but can't seem to find one. I've got a JTable with an underlying model that is being continuously updated (every 100ms or so). Whenever I try to sort the JTable using TableRowSorter while the model is being added to I get
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.Vector.elementAt(Vector.java:430)
    at javax.swing.table.DefaultTableColumnModel.getColumn(DefaultTableColumnModel.java:277)
    I don't understand this as in my custom table model I've added the fireTableChanged etc. in a SwingUtilities.invokeLater( ...) thread.
    Has anyone else encountered this problem and found a solution? I'd be really grateful!
    Thanks

    Hi
    Thanks for responding, I'm still a little confused. I've posted the code below for both the JTable and the TableModel. The tablemodel simply gets values from a vector which is being dynamically updated from outside the table - but whenever the vector is added to
    The problem seems to only occur when I press the column header to sort the tables during the updates. My understanding is that the method refresh() should create a threadsafe update of the table - but somehow it refreshes the binding to the tablemodel and during this time the table returns a defaulttablemodel that doesn't correspond to the actual underlying data....I thought this kind of problem would be solved by invoking all updates on the swing event thread, but it seems to still produce the effect and I'm stumped!!
    (The data is in an array called turns, and the addElement() in another class calls the refresh() method)
    many thanks, in the hope that someone has the kindness and and benevolence to wade through the following code!
    public class JContiguousTurnsListTable extends JTable {
    private JContiguousTurnsListTableModel jctltm;
    public JContiguousTurnsListTable(Conversation c) {
    super();
    jctltm = new JContiguousTurnsListTableModel(this,c);
    this.setModel(jctltm);
    setSize();
    //this.setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS);
    //this.setAutoCreateRowSorter(true);
    TableRowSorter <TableModel> sorter = new TableRowSorter <TableModel>(jctltm);
    //sorter.setSortsOnUpdates(true);
    this.setRowSorter(sorter);
    System.err.println("Setting up ");
    private void setSize(){
    TableColumn column = null;
    for (int i = 0; i <11; i++) {
    column = this.getColumnModel().getColumn(i);
    if(i==1||i==2||i==3||i==4||i==8||i==9){
    column.setPreferredWidth(50);
    else if (i==0||i==5){
    column.setPreferredWidth(180);
    else if (i == 6) {
    column.setPreferredWidth(150);
    else if(i==10){
    column.setPreferredWidth(250);
    else
    column.setPreferredWidth(100);
    //column.setPreferredWidth(100);
    //column.setMinWidth(100);
    //column.setMaxWidth(100);
    public String getColumnName(int column){
    return jctltm.getColumnName(column);
    public void refresh(){
    this.jctltm.refresh();
    ----------------And the table model:
    public class JContiguousTurnsListTableModel extends AbstractTableModel {
    private Conversation c;
    public JContiguousTurnsListTableModel(JTable jt,Conversation c) {
    super();
    this.c=c;
    public void refresh(){
    //System.out.println("Refresh");
    SwingUtilities.invokeLater(new Runnable(){public void run(){fireTableDataChanged();fireTableStructureChanged();} });
    public boolean isCellEditable(int x, int y){
    return false;
    public String getColumnName(int column){
    if(column==0){
    return "Sender";
    else if(column==1){
    return "Onset";
    else if (column==2){
    return "Enter";
    else if(column ==3){
    return "E - O";
    else if(column ==4){
    return "Speed";
    else if(column ==5){
    return "Spoof Orig.";
    else if(column ==6){
    return "Text";
    else if(column ==7){
    return "Recipients";
    else if(column ==8){
    return "Blocked";
    else if(column ==9){
    return "Dels";
    else if(column ==10){
    return "TaggedText";
    else if(column ==11){
    return "ContgNo";
    else if(column ==12){
    return "Inconcistency";
    else{
    return " ";
    public Object getValueAt(int x, int y){
    try{ 
    //System.out.println("GET VALUE AT "+x+" "+y);
    Vector turns = c.getContiguousTurns();
    if(x>=turns.size())return " ";
    ContiguousTurn t = (ContiguousTurn)turns.elementAt(x);
    if(y==0){
    return t.getSender().getUsername();
    else if(y==1){
    return t.getTypingOnset();
    else if(y==2){
    return t.getTypingReturnPressed();
    else if(y==3){
    return t.getTypingReturnPressed()-t.getTypingOnset();
    else if(y==4){
    long typingtime = t.getTypingReturnPressed()-t.getTypingOnset();
    if(typingtime<=0)return 0;
    return ((long)t.getTextString().length())/typingtime;
    else if(y==5){
    return t.getApparentSender().getUsername();
    else if(y==6){
    return t.getTextString();
    else if(y==7){
    //System.out.println("GETTINGRECIP1");
    Vector v = t.getRecipients();
    String names ="";
    // System.out.println("GETTINGRECIP3");
    for(int i=0;i<v.size();i++){
    Conversant c = (Conversant)v.elementAt(i);
    // System.out.println("GETTINGRECIP4");
    names = names+", "+c.getUsername();
    // System.out.println("GETTINGRECIP5");
    return names;
    else if (y==8){
    if (t.getTypingWasBlockedDuringTyping())return "BLOCKED";
    return "OK";
    else if(y==9){
    return t.getNumberOfDeletes();
    else if(y==10){
    String returnText="";
    Vector v = t.getWordsAsLexicalEntries();
    for(int i=0;i<v.size();i++){
    LexiconEntry lxe= (LexiconEntry)v.elementAt(i);
    returnText = returnText+lxe.getWord()+" ("+lxe.getPartOfSpeech()+") ";
    return returnText;
    else if(y==11){
    return t.getNumberOfTurns();
    else if(y==12){
    // System.out.println("CONTIGUOUS1");
    String value ="";
    boolean hasSameRecipients = t.getTurnsHaveSameRecipients();
    boolean hasSameApparentOrigin = t.getTurnsHaveSameApparentOrigin();
    if (hasSameRecipients&hasSameApparentOrigin){
    value = "OK";
    else if (hasSameRecipients&!hasSameApparentOrigin){
    value = "Diff. O";
    else if(!hasSameRecipients&hasSameApparentOrigin){
    value = "Diff. Recip";
    else {
    value = "Diff O&R";
    //System.out.println("CONTIGUOUS2");
    return value;
    return " ";
    }catch (Exception e){
    return "UI ERROR";
    public Class getColumnClass(int column) {
    Class returnValue;
    if ((column >= 0) && (column < getColumnCount())) {
    returnValue = getValueAt(0, column).getClass();
    } else {
    returnValue = Object.class;
    return returnValue;
    public int getRowCount(){
    return this.c.getContiguousTurns().size();
    public int getColumnCount(){
    return 13;
    }

  • Exception in thread "AWT-Event Queue 0" Mem Out of Bounds. Java Heap Space

    Hello,
    I'm not sure how to resolve this Java Heap Space Memory Out of Bounds error. Could someone please assist me with this error?
    A SCENARIO:
    I am reading in tons of data from 5 separate text files. The files have tons of rows (up to 64,220 in one). The data must be read into the program and assembled. When I have all of the files populated, I receive the OOM Error. If I remove the data from one of the 5 files the program runs successfully. If I add the data back into the file and then remove the data from some other file, the program runs successfully.
    Thanks
    RodneyM

    ff.skip(18);
    i = ff.read();
    i = ((ff.read() << 8) | i);
    i = ((ff.read() << 16) | i);
    i = ((ff.read() << 24) | i);
    xsize = i;
    System.out.println("width=" + xsize);
    i = 0;
    i = ff.read();
    i = ((ff.read() << 8) | i);
    i = ((ff.read() << 16) | i);
    i = ((ff.read() << 24) | i);
    ysize = i;
    System.out.println("Height=" + ysize);
    ff.skip(38);//62-(2+16+4+4=26)=36, actually total=62 Bytes header This is completely wrong. First an foremost you should not have this code in the paint(Graphics g) method. This is a GUI thing. The paint method may be called for any reason and you do not+ want to open a file stream, read it, and do the distance transformation every single time the method is called. There's also the issue that you have overridden the paint method as opposed to subclassing a component, overriding the paintComponent method, and adding it to the frame. But that can be ignored for right now (it will come back later and cause complications).
    Next, you've said that the header is 62 bytes. This is incorrect for a png file. The code you have posted assumes (very specifically) that you have inputted a BMP version 3 with 2-color entry palette. In other words you can only open a very specific type of image with that code. Definitely not a png. This is what was causing the out of memory error since it interprets the width and height wrong when reading the bytes and you end up trying to create a 2-D int array that will take up several hundred megabytes in size
    //xsize and ysize are interpreted wrongly
    pix=new int[xsize][ysize];
    mat1=new int[xsize][ysize]; Now granted, BMP v3 is the most common type you will encounter but you must admit that the code is not very robust at all (since it requires a very specific input).

  • Triggering events from event queue

    Can anyone tell me if events triggered FROM the event queue execute immediatly before returning to the place where the trigger occured (as it seems to when I follow the code in the debugger).
    for example in my code I am:
    1) capturing a tab change event so I'm on the AWT event queue.
    2) calling stopcellediting() on a table which eventually triggers a losefocus event on a control within the table.
    3) the program flow seems to go straight to the focuslost event before returning to process the rest of tab change event.
    is this behaviour reliable? or is it just a timing coincidence?
    thanks in advance.

    This behaviour is reliable.
    All the code that executes these events is performed in the same thread, so it has no means to do something in parallel.
    SwingUtilities.invokeLater method does provide an ability to postpone execution of some code but inside Swing package it is used mainly for paint related tasks (for example the painting of the focus change will most likely occur only after the rest of tab change event processing will be executed).

  • Running JUnit tests from AWT Event Quene

    Anyone know how to run JUnit tests from the AWT Event Queue? JFCUnit is overkill; I'm just looking for a TestRunner that runs on a different thread. I can delve into the JUnit documentation but, with luck, someone who's been through this before can spare me the trouble. Also, anyone else get a server error when searching for "JUnit event dispatch" on this forum?

    JUnit 3 version:
    import java.util.concurrent.atomic.AtomicReference;
    import javax.swing.SwingUtilities;
    import junit.framework.TestCase;
    public abstract class EDTTestCase extends TestCase {
         * Overriding this method guarantees that setUp(), tearDown(), and all
         * tests run on the EDT.
        @Override
        public void runBare() throws Throwable {
            final AtomicReference<Throwable> problem = new AtomicReference<Throwable>();
            if (!SwingUtilities.isEventDispatchThread()) {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        try {
                            runBare();
                        catch (Throwable throwable) {
                            problem.set(throwable);
                if (problem.get() != null) {
                    throw problem.get();
            else {
                super.runBare();
    }

  • AWT System Event Queue

    Hello all,
    I'm interested in how the AWT system event queue works. I'm talking about the EventQueue we can all retrieve using Toolkit.getDefaultToolkit().getSystemEventQueue().
    My main questions are:
    1) What happens to events once they get on the queue?
    2) How do the AWT Components get notified of the events?
    3) How is the correct AWT Component to notify determined?
    I've done a little bit of Googling but haven't found anything explaining how the event queue actually works.
    In case you're wondering, I'd like to know all this because I'm in a position where I need to mimick the system event queue's behaviour without actually touching it.
    Any links to further reading, suggestions or comments are most welcome.
    Thanks in advance,
    Sam

    Hello Sam,
    Your questions could be answered by the following documents:
    http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/events.html
    http://download.java.net/jdk6/docs/api/java/awt/doc-files/AWTThreadIssues.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/FocusSpec.html
    Cheers,
    Sam

  • How to enqueue custom AWT event?

    hi,
    in my applet I need to use custom AWT events. I subclass them from java.awt.AWTEvent and set their id to higher as AWTEvent.RESERVED_ID_MAX - as recomended in documentation.
    But how to enqueue such event? A tried to use following approach:
    getToolkit().getSystemEventQueue().postEvent( myEvent );
    and it works fine - but only in browsers usings Sun's VM implementation. In browsers using Microsoft's VM I'm getting following exception:
    com.ms.security.SecurityExceptionEx[matlu/client/ClientConnection.enQueue]: Event queue access denied.
    So the question is: is there any other way to enqueue custom event, which will keep Microsoft's security manager happy?
    thak you very much
    Lubo Matecka

    I know it must be visible... (But it doesnt have to be bigger than 1 pixel...)
    The code I posted is just to illustrate the idea.
    If you need to post multiple events you just replace the AWTEvent member with a LinkedList (or some similar FIFO).
    Then in postEvent you do theLinkedList.addFirst(yourEvent)
    And in paint() you do AWTEvent ev = (AWTEvent)theLinkedList.removeLast();
    process ev.
    if(theLinkedList.size() > 0)
       repaint();Yes. I have run into the same problem, and I did not use the repaint- trick...
    My applet communicates with the server in a separate thread. When a response receives the communication thread should post an event to the AWT- thread to get the response processed.
    My solution here is to process the thread in the communicator- thread. This is a bad solution because it might create multithreading bugs.... but it has proven to work ok in practice.
    Another example is like this. The use presses the mouse at Component B so that:
    1 Component A gets a focusLost event.
    2 Component B gets a mousePressed.
    3 I want to do something in component A that should be done after component B has processed the mousePressed event. This can be solved without using events. You just have to write some more code (You are already in the right thread).

  • Additional event queue appearing after RMI callback

    Hi,
    I am working on a client-server applicaion in which the client passes the server a callback object so it can be notified if shared data is changed so it can refresh.
    After receiving the notification from server the processing is moved to a Runnable executed on the dispatch tread with SwingUtilities.invokeLater(Runnable).
    But a case arose in which there there seems to appear an additional event queue.
    The original event queue (Thread name is AWT-EventQueue-2) is busy. Then in a thread named "RMI TCP Connection(3)-192.168.1.4" a notification comes but it is dispatched on a thread named "AWT-EventQueue-0". But I want the notification processing happen after AWT-EventQueue-2 has finished its current task.
    How can I avoid the additonal queue creation and what wrong am I doing so it is created(Swing is single-threaded as I have read everywhere)?
    Thanks
    Mike

    I found a way to solve this but I am not sure it is good.
    I save reference to the event queue the application uses on startup and instead of
    SwingUtilities.invokeLater(changeRunnable)
    use
    systemQueue.postEvent(new java.awt.event.InvocationEvent(Toolkit.getDefaultToolkit(), changeRunnable));
    Currently that works fine and change events are dispatched synchronously to the other things happening. But I wonder if there is a chance that the system queue is substituted in runtime by another queue and my reference will become invalid.
    Mike

  • Flush Event Queue doesn't work with "Key up"

    Hi,
    probably just a simple thing I am missing here. See the attached VI (including SubVI). In case 1 I fetch the Key Up event for ENTER and issue a Value Change on the Stop Button. This results in a check for the string length and in case it is too short brings up a dialog telling you the ID string is too short and brings you back to the ID entry. Unfortunately - when confirming the dialog with ENTER instead of using the mouse on the button theKey Up event fired again and therefore fetched by the Event Structure.
    So I thought I just flush all events in the queue. To be sure, I put a time value on the flush function which proceeds AFTER the dialog is completed, so the ENTER Key Up should be deleted as well. Bummer is - it doesn't work. Anyone know why?
    I tried as well with the dynamic event, which I unregistered right after the Stop Event is issued in the Key Up case. I then "re"register for the Key Up event at the same time/position as the flush event queue function is positioned now in the VI below. Still no joy.
    What is my mistake? Thanks a lot.
    Solved!
    Go to Solution.
    Attachments:
    Manual_ID_Entry.llb ‏47 KB

    comrade wrote:
    I don't understand 2 things:
    a) Why is the Key up event even fired? It doesn't come from the VI where the event structure resides and to which "Instance" the event is bound (VI->Key up), but from the dialog box (which is a different VI). Unless a calling VI inherits all events from its SubVIs or something like that.
    b) Why isn't the event fired by the button in the dialog box discarded as the flush event queue function is supposed to perform?
    Because you are slow.  Not you personally.  But compared to the computer, you just don't stand a chance.  So you hit the Enter button on the dialog.  That dialog's OK button activates on the key down.  So the dialog is long gone by the time you manage to get your finger off of the Enter key.  In fact, you loop should be back around to be waiting for an event first.  So it is waiting for an event when you finally get your finger off of the button.  Hey, we have a Key Up event!
    Your current checking for the validity of the id is just flat out annoying.  Use the Key Down? event to check for a valid character being entered.  Notice the '?' in my choice of event there?  That means it is a filter event.  This means you can throw away (discard) the character being pressed before the control even sees it.  You could also discard if there are already enough characters (Greater Or Equal, not Equal).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Seeing " Warning The event queue appears to be stuck."

    I'm seeing some strange things since I changed to v3.6.1. Could be due to other changes made at roughly the same time but I suspect it's the new jars. I was reading what Patrick wrote here:
    http://blackbeanbag.net/wp/2009/07/20/coherence-3-5-service-guardian-deadlock-detection/...and I'm wondering now if my app is just not keeping up with the flow of events...?
    Thanks,
    Andrew
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.609/26.953 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:08.984/27.328 Oracle Coherence GE 3.6.1.0 <Warning> (thread=AWT-EventQueue-0, member=34): The event queue appears to be stuck.
    2010-12-15 14:34:08.984/27.328 Oracle Coherence GE 3.6.1.0 <Error> (thread=AWT-EventQueue-0, member=34): Full Thread Dump
    Thread[testASocketToServerThread1,5,main]
         java.lang.Thread.sleep(Native Method)
         testAbook.binary.client.testASocketToServerBinary$1.run(testASocketToServerBinary.java:99)
         java.lang.Thread.run(Thread.java:619)
    Thread[IpMonitor,6,Cluster]
         java.net.Inet4AddressImpl.isReachable0(Native Method)
         java.net.Inet4AddressImpl.isReachable(Inet4AddressImpl.java:52)
         java.net.InetAddress.isReachable(InetAddress.java:419)
         java.net.InetAddress.isReachable(InetAddress.java:378)
         com.tangosol.coherence.component.util.daemon.IpMonitor.onNotify(IpMonitor.CDB:12)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[threadtestIMsgBase,1,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         testIbook2.common.testIOrderRepository$1.run(testIOrderRepository.java:54)
         java.lang.Thread.run(Thread.java:619)
    Thread[AWT-EventQueue-0,6,main]
         java.lang.Thread.dumpThreads(Native Method)
         java.lang.Thread.getAllStackTraces(Thread.java:1487)
         com.tangosol.net.GuardSupport.logStackTraces(GuardSupport.java:810)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.drainOverflow(Service.CDB:45)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid$EventDispatcher.drainOverflow(Grid.CDB:9)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.post(Grid.CDB:17)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.sendPartitionedRequest(PartitionedCache.CDB:64)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.getAll(PartitionedCache.CDB:12)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$EntryAdvancer.entrySetPage(PartitionedCache.CDB:31)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap$EntryAdvancer.nextPage(PartitionedCache.CDB:18)
         com.tangosol.util.PagedIterator.hasNext(PagedIterator.java:71)
         com.tangosol.util.ConverterCollections$ConverterEntrySet$ConverterIterator.hasNext(ConverterCollections.java:3201)
         quoteclient.QuoteClient.addQuoteListener(QuoteClient.java:263)
         bbo.RediQuotes.<init>(RediQuotes.java:42)
         bbo.RediQuotes.getRediQuotes(RediQuotes.java:18)
         bbo.BBOTableRecord.getValue(BBOTableRecord.java:102)
         bbo.BBORecordsModel.getValueAt(BBORecordsModel.java:78)
         javax.swing.JTable.getValueAt(JTable.java:2685)
         javax.swing.JTable.prepareRenderer(JTable.java:5702)
         javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
         javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
         javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1770)
         javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
         javax.swing.JComponent.paintComponent(JComponent.java:752)
         javax.swing.JComponent.paint(JComponent.java:1029)
         javax.swing.JComponent.paintChildren(JComponent.java:862)
         javax.swing.JComponent.paint(JComponent.java:1038)
         javax.swing.JViewport.paint(JViewport.java:747)
         javax.swing.JComponent.paintChildren(JComponent.java:862)
         javax.swing.JComponent.paint(JComponent.java:1038)
         javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
         javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
         javax.swing.RepaintManager.paint(RepaintManager.java:1224)
         javax.swing.JComponent._paintImmediately(JComponent.java:5072)
         javax.swing.JComponent.paintImmediately(JComponent.java:4882)
         javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
         javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
         javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
         javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
         java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Thread[Java2D Disposer,10,system]
         java.lang.Object.wait(Native Method)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
         sun.java2d.Disposer.run(Disposer.java:125)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketListener1P,8,Cluster]
         java.net.PlainDatagramSocketImpl.receive0(Native Method)
         java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
         java.net.DatagramSocket.receive(DatagramSocket.java:712)
         com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:22)
         com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[autoRetrieveBtNews,6,main]
         java.lang.Thread.sleep(Native Method)
         testAbook.report.testABookBtNews$1.run(testABookBtNews.java:53)
         java.lang.Thread.run(Thread.java:619)
    Thread[Signal Dispatcher,9,system]
    Thread[D3D Screen Updater,7,system]
         java.lang.Object.wait(Native Method)
         sun.java2d.d3d.D3DScreenUpdateManager.run(D3DScreenUpdateManager.java:421)
         java.lang.Thread.run(Thread.java:619)
    Thread[Invocation:Management,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[AWT-Windows,6,main]
         sun.awt.windows.WToolkit.eventLoop(Native Method)
         sun.awt.windows.WToolkit.run(WToolkit.java:295)
         java.lang.Thread.run(Thread.java:619)
    Thread[DistributedCache:DistributedStatsCacheService,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[testASocketToServerThread2,5,main]
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
         sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
         sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
         java.io.InputStreamReader.read(InputStreamReader.java:167)
         java.io.BufferedReader.fill(BufferedReader.java:136)
         java.io.BufferedReader.read1(BufferedReader.java:187)
         java.io.BufferedReader.read(BufferedReader.java:261)
         testAbook.binary.client.testASocketToServerBinary$2.run(testASocketToServerBinary.java:167)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketReceiver,7,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketReceiver.onWait(PacketReceiver.CDB:2)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketPublisher,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher.onWait(PacketPublisher.CDB:2)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[Logger@9254847 3.6.1.0,3,main]
         java.lang.Integer.toString(Integer.java:308)
         java.sql.Timestamp.toString(Timestamp.java:301)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Logger.formatParameter(Logger.CDB:13)
         com.tangosol.coherence.component.application.console.Coherence$Logger.formatParameter(Coherence.CDB:40)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Logger.formatMessage(Logger.CDB:23)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Logger.onNotify(Logger.CDB:57)
         com.tangosol.coherence.component.application.console.Coherence$Logger.onNotify(Coherence.CDB:4)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[DistributedCache:DistributedQuotesCacheService,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onWait(Grid.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[EventQueue:ContinuousQueryCache{Cache=stats._1_DAY_PERCENT_CHANGED, Filter=AlwaysFilter},5,EventQueue:ContinuousQueryCache{Cache=stats._1_DAY_PERCENT_CHANGED, Filter=AlwaysFilter}]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:781)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketListenerN,8,Cluster]
         java.net.PlainDatagramSocketImpl.receive0(Native Method)
         java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
         java.net.DatagramSocket.receive(DatagramSocket.java:712)
         com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:22)
         com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[Cluster|Member(Id=34, Timestamp=2010-12-15 14:34:28.185, Address=192.168.3.26:8088, MachineId=27418, Location=machine:dab1,process:4020,member:s1, Role=BboBBOClientMain),6,Cluster]
         sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
         sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:273)
         sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:255)
         sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:136)
         sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
         sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
         com.tangosol.coherence.component.net.TcpRing.select(TcpRing.CDB:11)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onWait(ClusterService.CDB:6)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[threadAutoRefreshBBO,5,main]
         java.lang.Thread.sleep(Native Method)
         bbo.BBORecordsModel$1.run(BBORecordsModel.java:152)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketListener1,8,Cluster]
         java.net.PlainDatagramSocketImpl.receive0(Native Method)
         java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
         java.net.DatagramSocket.receive(DatagramSocket.java:712)
         com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:22)
         com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[testAOrderRepositoryBinaryThread,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         testAbook.binary.common.testAOrderRepositoryBinary$1.run(testAOrderRepositoryBinary.java:47)
         java.lang.Thread.run(Thread.java:619)
    Thread[Reference Handler,10,system]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    Thread[Thread-16,5,main]
         java.lang.Thread.sleep(Native Method)
         bbo.udp.BBOUDPRecords.refreshBBOUDP(BBOUDPRecords.java:299)
         bbo.udp.BBOUDPRecordsModel.refreshBBOUDP(BBOUDPRecordsModel.java:90)
         bbo.udp.BBOUDPRecordsModel$1.run(BBOUDPRecordsModel.java:107)
         java.lang.Thread.run(Thread.java:619)
    Thread[testASocketToServerThread3,5,main]
         java.net.SocketOutputStream.socketWrite0(Native Method)
         java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
         sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
         sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
         sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
         java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
         java.io.BufferedWriter.flush(BufferedWriter.java:236)
         testAbook.binary.client.testASocketToServerBinary$3.run(testASocketToServerBinary.java:248)
         java.lang.Thread.run(Thread.java:619)
    Thread[Attach Listener,5,system]
    Thread[DistributedCache:DistributedQuotesCacheService:EventDispatcher,6,Cluster]
         quoteclient.QuoteClient.p(QuoteClient.java:48)
         quoteclient.QuoteClient.entryUpdated(QuoteClient.java:95)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
         com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
         com.tangosol.coherence.component.util.SafeNamedCache.translateMapEvent(SafeNamedCache.CDB:7)
         com.tangosol.coherence.component.util.SafeNamedCache.entryUpdated(SafeNamedCache.CDB:1)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap$ProxyListener.dispatch(PartitionedCache.CDB:22)
         com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap$ProxyListener.entryUpdated(PartitionedCache.CDB:1)
         com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         com.tangosol.coherence.component.util.CacheEvent.run(CacheEvent.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onNotify(Service.CDB:26)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[DistributedCache:DistributedStatsCacheService:EventDispatcher,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onWait(Service.CDB:7)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[AWT-Shutdown,5,main]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265)
         java.lang.Thread.run(Thread.java:619)
    Thread[EventQueue:ContinuousQueryCache{Cache=stats.OPEN_PRICE, Filter=AlwaysFilter},5,EventQueue:ContinuousQueryCache{Cache=stats.OPEN_PRICE, Filter=AlwaysFilter}]
         java.lang.Object.wait(Native Method)
         java.lang.Object.wait(Object.java:485)
         com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
         com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
         com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:781)
         java.lang.Thread.run(Thread.java:619)
    Thread[readerThread,6,main]
         java.lang.Object.wait(Native Method)
         java.util.TimerThread.mainLoop(Timer.java:509)
         java.util.TimerThread.run(Timer.java:462)
    Thread[Thread-11,5,main]
         java.lang.Thread.sleep(Native Method)
         testIbook2.client.testIBBOSocketToServer$1.run(testIBBOSocketToServer.java:82)
         java.lang.Thread.run(Thread.java:619)
    Thread[threadReceive,5,main]
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
         sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
         sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
         java.io.InputStreamReader.read(InputStreamReader.java:167)
         java.io.BufferedReader.fill(BufferedReader.java:136)
         java.io.BufferedReader.readLine(BufferedReader.java:299)
         java.io.BufferedReader.readLine(BufferedReader.java:362)
         testIbook2.client.testIBBOSocketToServer$2.run(testIBBOSocketToServer.java:171)
         java.lang.Thread.run(Thread.java:619)
    Thread[main,5,main]
         java.awt.Component.resize(Component.java:2045)
         java.awt.Component.setSize(Component.java:2035)
         java.awt.Window.setSize(Window.java:791)
         strategies.layout.LayoutViewer.openLayout(LayoutViewer.java:319)
         bbo.BBOClientMain.main(BBOClientMain.java:74)
    Thread[TimerQueue,5,system]
         java.lang.Object.wait(Native Method)
         javax.swing.TimerQueue.run(TimerQueue.java:232)
         java.lang.Thread.run(Thread.java:619)
    Thread[PacketSpeaker,8,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.queue.ConcurrentQueue.waitForEntry(ConcurrentQueue.CDB:16)
         com.tangosol.coherence.component.util.queue.ConcurrentQueue.remove(ConcurrentQueue.CDB:7)
         com.tangosol.coherence.component.util.Queue.remove(Queue.CDB:1)
         com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketSpeaker.onNotify(PacketSpeaker.CDB:21)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         java.lang.Thread.run(Thread.java:619)
    Thread[Invocation:Management:EventDispatcher,6,Cluster]
         java.lang.Object.wait(Native Method)
         com.tangosol.coherence.component.util.Daemon.onWait(Daemon.CDB:18)
         com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onWait(Service.CDB:7)
         com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39)
         java.lang.Thread.run(Thread.java:619)
    Thread[Finalizer,8,system]
         java.lang.Object.wait(Native Method)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
         java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    2010-12-15 14:34:09.000/27.344 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.015/27.359 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.015/27.359 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.015/27.359 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.031/27.375 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.046/27.390 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:09.046/27.390 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.203/30.547 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.218/30.562 Oracle Coherence GE 3.6.1.0 <Info> (thread=AWT-EventQueue-0, member=34): null
    2010-12-15 14:34:12.296/30.640 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null
    2010-12-15 14:34:12.296/30.640 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null
    2010-12-15 14:34:12.296/30.640 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null
    2010-12-15 14:34:12.312/30.656 Oracle Coherence GE 3.6.1.0 <Info> (thread=DistributedCache:DistributedQuotesCacheService:EventDispatcher, member=34): null

    Hi Tarun
    Please see the discussion in this thread GuardSupport logging thread dumps without giving a reason
    Paul

  • Swing event queue, modal dialogs, event threads, etc...

    Hey all,
    So I am playing around with the focus manager, swing event thread and event queue, etc. Learned quite a bit. I am also playing around with test automation of our UI, using jfcUnit. I have written a few simple apps to play aorund with record/playback, coding tests, etc. What this thread is about though, is figuring out how modal and non-modal dialogs "take over" the event thread/queue? The reason I ask is, if I put a simple test harness like tool embeded in my app as a separate pop-up modal dialog, and from within it there is a GUI that I can use to select a "Test" to run. Now, when I run this test, jfcUnit needs to run on the main window, not within my non-modal dialog. What I am not sure of, however, is that if by using a non-modal dialog all events will go to the main event thread? I mean, I know if I mouse over my second non-modal frame (spawned from the application frame), that events will trigger for that dialog. I remember reading somewhere that modal dialogs "block" the main event queue, all left over events are given to the newly added event queue (presumably by the modal dialog) and existing left-over events get moved to the event queue. If that is the case, I am curious why events for the "old" queue are moved to the new queue if they were orginally intended for the old queue? I would think a "flush" before adding a new queue would be more appropriate so that the old queue can process all of its intended events.
    Now, I am just about to try this, but I am hoping a non-modal pop-up will not interfere with the jfcUnit running the UI of the main window. I am guessing, however, that it might. How are non-modal dialogs handled in terms of events and the event queue? Is it the same as modal dialogs? Or is there no blockage of the mainwindow event queue? If there is no blockage, than any sort of automation based on relative positions to a window may occur on the non-modal dialog, in which case it's best to hide the non-modal dialog during running of these tests.
    What are your thoughts, or better yet, knowledge of this topic? A decent explanation from a developer standpoint and not from the API's which dont give some of the more detailed info I am seeking is what I am hoping to get out of this.
    Thanks.

    Check this out. First, AWTListener has a LOT of
    different types you can register it for. I ORd all
    them together and when I ran my app, it took almost 30
    minutes for it to show up because of the huge stream
    of events being spit out via System.out. ...Yes, that doesn't surprise me in the least. There's hundreds of events that are fired around, usually unbeknownst to the user for every little thing. Lots of component and container events, in particular.
    Just make sure you OR ( using | not || ) ALL the
    "mask" values you want to watch for. That may be why
    you aren't seeing anything. When I did all that, and
    opened a menu, a ton of events came out.Maybe, I'll try that again, but I did specifically add an ActionEvent mask to get action events, and that should be all I need to get action events on buttons or menu items, and it wasn't getting them for either. It was only getting events on buttons when I used SwingEventMonitor, but not menu items.
    So I don't quite understand enough of the underlying event handling. Although, I suspect it could have something to do with the fact that these are Swing components, not AWT components (which their native peers) and it's pretty clear from AbstractButton (or was it DefaultButtonModel) how ActionEvents are fired, and they don't seem to have any connection to the code that deals with AWTListeners.
    My problem is that I kinda need a way to catch events without having a listener attached directly. Normally, I would have a listener, but there's this situation whereby an action may be triggered before I can get hold of the component to attach my listener to it. Perhaps I can get mouse press/release and just deal with it that way.
    Let me know if you did that and still didn't see what
    you were looking for. After playing with this, I am
    guessing the main reason for AWTListener is to
    register a listener for a specific type of event,
    instead of listening to them all, hence avoiding lots
    of extra overhead. Then again, the main event
    dispatcher must do a decent amount of work to fire off
    events to listeners of specific awt event types.Yes, it's definitely that. There's no point in sending events if no one is listening for it, so it does save some time.
    You are right, popup menus I think are dialogs, I
    don't know for sure, but you can access them via the
    JMenu.getPopupMenu() and JMenu.isPopupShowin().
    However, I am still not getting my test stuff working
    quite right.
    Yes, for menu popups. For a JPopupMenu on a right-click on any component (tree or whatever), I had a need to know about that from any arbitrary application (it's this GU testing app I'm working on), and since the popup menu doesn't belong to any component before it's shown, I couldn't necessarily know about it til it was displayed. I managed to use a combination of HierarchyEvents (using an AWTEventListener) and "component added" ContainerEvents. Not a simple matter, but it seems to work well.

  • Specifying Event Queue for EventQueue.invokeAndWait().

    Javadoc says EventQueue.invokeAndWait(Runnable runnable) / invokeLater are static methods causing the Runnable executed in the system event queue thread. But I found that my applet appli. running under IE has 3 event dispatching threads AWT-EventQueue-0, AWT-EventQueue-1 and AWT-EventQueue-2. The system event queue (the one returned by Toolkit.getSystemEventQueue() ) is inside AWT-EventQueue-0 but by testing my applet's event queue should be in AWT-EventQueue-2.
    My question is, is it possible to specify which event queue's thread to run the Runnable? Since I found that the 3 event dispatching threads are of different thread groups and only the AWT-EventQueue-2 is in the same thread group as my applet and I want my Runnable to be in the same thread group of my applet thread. The thread groups of the 3 dispatching threads are :
        Thread[] threads=new Thread[100];
        int threadsReturned=Thread.enumerate(threads);
        for (int i=0; i<threadsReturned ; i++) {
            System.out.println("thread name:" + threads);
    System.out.println("thread group class name:" + threads[i].getThreadGroup().getClass().getName()) ;
    System.out.println("thread group name:" + threads[i].getThreadGroup().getName());
    1.
    thread name:Thread[AWT-EventQueue-0,6,main]
    thread group class name:java.lang.ThreadGroup
    thread group name:main
    2.
    thread name:Thread[AWT-EventQueue-1,6,Plugin Thread Group]
    thread group class name:java.lang.ThreadGroup
    thread group name:Plugin Thread Group
    3.
    thread name:Thread[AWT-EventQueue-2,4,http://(my url)/-threadGroup]
    thread group class name:sun.plugin2.applet.Applet2ThreadGroup
    thread group name:http://(my url)/-threadGroup                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Please continue in [the thread where you first posted this problem|http://forums.sun.com/thread.jspa?threadID=5431496]. I'm locking this.
    db
    edit Thread unlocked on clarification from OP in the other thread.
    Edited by: DarrylBurke

  • AWT Event Listener not listening...

    Hi,
    I'm having problems with an AWT Event Listener on a JFrame.
    Basically, im making a tank game, so the first screen to appear is an inventory screen. The when you click start on this screen, you create a GameScreen which extends JFrame. i have an AWT Event Listener added to this frame using this code:
    Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener(){
    public void eventDispatched(AWTEvent e) {
    if(((KeyEvent)e).getKeyCode() == KeyEvent.VK_DOWN && e.getID() == KeyEvent.KEY_PRESSED)
    It's checking events on the arrow keys and the tab and enter keys.
    So when the this round of the game has finished, i setVisible to false, and make the inventory visible again.
    The problem is, when i set make the GameScreen visible again, the listeners aren't working.
    It seems to be working fine for 'enter', that is VK_ENTER, but not for the arrow keys...
    Any1 have any ideas??
    Any help would be great!
    Thanks,
    D.

    I am willing to bet that your problem lies in that once you return the main game screen from the inventory screen that you need to set the focus back to the main game screen. I believe, as events go, the component that has the focus is the one that will receive the events and process them according to their listener code. As I am not sure where your focus goes once you close the inventory screen and open the main screen, it could be that the wrong component has the focus.
    As far as getting the focus to the correct component is concerned, I remember myself and Malohkan having a discussion as to how to get this to work, and he came up with a work-around. That thread is somewhere in this forum. I'm not sure if it will solve your problem, but it might be something worth looking into.
    -N.

Maybe you are looking for

  • Two Line Heading in ALV?

    Dear All, I have created ALV Grid Report. Which having Colunms - <b>Material, Description, Showroom(Plan-A), Showroom(Plan-B),</b> Now user had requirend that The 'Plan-A', 'Plan-B' Come under heading 'Showroom'... how to do this... regards.

  • Report Table name

    Hi Please suggest the table name for same functionality of  CJID report. Regards Rama

  • Internal server error while connecting SAP's customer financial fact sheet with iOS device

    Hi all, I am trying to connect SAP's customer financial fact sheet latest ( version 3.7)   with iOS phone/iPAD (version 7.1) but it shows internal server error, when trying to connect  Neither "Gateway (direct)" nor "SMP Cloud" enabled with port 80/4

  • Message in scheduled state

    Hi Experts, In our production system, messages are frequently going to 'scheduled for outbound processing" state. After the manual retry the messages are going through. We are planning to setup RSQIWKEX, RSARFCEX and RSXMB_RESTART_MESSAGES for automa

  • Putting a AMD R9 270 in a Dell XPS 7100 from 2010

    Currently have a Dell XPS 7100 (2010) with a HD 5870. I would like to remove the HD 5870 and add a AMD R9 270. I believe I am OK as far as space, power, bottlenecking, and PCI slot. However, I read a thread in a forum that the Dell XPS 7100 motherboa