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;
}

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);
    }

  • What is Event queue problem?

    HI,
    I have come across JSF document, they mentioned that Event queue
    Problem ins SUN's JSF implementation. what is that?

    You're going to have to be a little more specific.

  • 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.

  • 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

  • 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).

  • 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();
    }

  • 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).

  • 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

  • Problem with java.awt.MouseInfo or java.awt.event.*;

    I have a problem with the MouseInfo class. I think.. because in my mousePressed(MouseEvent event) method, I have this:
         public void mousePressed(MouseEvent event) {
              pInfo = mInfo.getPointerInfo();
              point = pInfo.getLocation();
              pointX = point.getX();
              pointY = point.getY();
              System.out.println("pointer is at: (" + (int)pointX + ", " + (int)pointY + ")");
         }I think you all could figure out what this does. I declared the variables at the top and I implemented MouseListener... when I click it doesnt tell me the X and Y coords.
    Alright, thanks. Any help appreciated.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MouseExample extends MouseAdapter implements Runnable {
        @Override
        public void mousePressed(MouseEvent event) {
            int x = event.getX();
            int y = event.getY();
            System.out.println("x=" + x + ", y=" + y);
        @Override
        public void run() {
            JLabel label = new JLabel("Click anywhere", SwingConstants.CENTER);
            label.setPreferredSize(new Dimension(300, 200));
            label.addMouseListener(this);
            JFrame f = new JFrame();
            f.getContentPane().add(label);
            f.pack();
            f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        public static void main(String[] args) {
            EventQueue.invokeLater(new MouseExample());
    }

  • JTable with ScrollPane update problem

    hay i have a table and scrollpane is used as a container, at runtime i create new object of table and assign it to the scrollpane, but its still showing the old table,
    I also tried to
    updateUI();
    repaint();
    but it still showing the same old table,
    I also debug and saw that the new table has been created n successfuly displaying the values at command prompt.
    Can any one know whats wrong in it.

    Dont be ferious budy, now this is a working example....
    Problem is: I am changing the table object in jPanel2 but still jPanel2 is showing the same old table, I think there is a refresh kind of a problem
    Be kool dude n tell where is the problem.
    package tabletesting;
    import java.awt.BorderLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ContainerEvent;
    import java.awt.event.ContainerAdapter;
    public class EmbededTable extends JFrame {
    public EmbededTable() {
    try {
    jbInit();
    } catch (Exception exception) {
    exception.printStackTrace();
    private void jbInit() throws Exception {
    flag=1; // flag to alter between objects
    getContentPane().setLayout(null);
    jPanel1.setBorder(BorderFactory.createEtchedBorder());
    jPanel1.setBounds(new Rectangle(28, 11, 320, 76));
    jPanel1.setBackground(Color.pink);
    jPanel1.setVisible(true);
    // jPanel1 contain the buttons when press toggel the table in panel
         this.setSize(new Dimension(640, 600));
    this.addContainerListener(new EmbededTable_this_containerAdapter(this));
    jPanel1.setLayout(null);
    jButton1.setBounds(new Rectangle(57, 2, 71, 29));
    jButton1.setText("jButton1");
    jButton1.addActionListener(new EmbededTable_jButton1_actionAdapter(this));
    jPanel2.setBorder(BorderFactory.createEtchedBorder());
    jPanel2.setBounds(new Rectangle(22, 133, 578, 304));
    jPanel2.addContainerListener(new EmbededTable_jPanel2_containerAdapter(this));
    jPanel2.setLayout(borderLayout1);
    testTable(); // to initially populate the jPanel2 with the tabel
    jButton2.setBounds(new Rectangle(191, 20, 93, 25));
    jButton2.setText("jButton2");
    jButton2.addActionListener(new EmbededTable_jButton2_actionAdapter(this));
    this.getContentPane().add(jPanel1);
    jPanel1.add(jButton1, null);
    jPanel1.add(jButton2);
    this.getContentPane().validate();
    this.setVisible(true);
    this.show();
    public void testTable()
    String[] columnNames = {"First Name",
    "Last Name",
    "Sport",
    "Include Input",
    "Include Output"};
    Object[][] data = {
    {"Mary", "Campione",
    "Snowboarding", new Boolean(false), new Boolean(false)},
    {"Alison", "Huml",
    "Rowing", new Boolean(false), new Boolean(true)},
    {"Kathy", "Walrath",
    "Knitting", new Boolean(false), new Boolean(false)},
    {"Sharon", "Zakhour",
    "Speed reading", new Boolean(false), new Boolean(true)},
    {"Philip", "Milne",
    "Pool", new Boolean(false), new Boolean(false)},
    if(flag==1)
    TableDemo newContentPane = new TableDemo(columnNames,data,4,5);
    newContentPane.setOpaque(true); //content panes must be opaque
    jPanel2.add(newContentPane, BorderLayout.CENTER);
    jPanel2.updateUI();
    jPanel2.repaint();
    jPanel2.revalidate();
    this.getContentPane().add(jPanel2);
    flag=0;
    else if(flag==0)
    Object[][] daa = {
    {"A", "T",
    "B", new Boolean(false), new Boolean(false)},
    {"C", "T",
    "Rowing", new Boolean(false), new Boolean(true)},
    {"D", "T",
    "Knitting", new Boolean(false), new Boolean(false)},
    {"E", "T",
    "Speed reading", new Boolean(false), new Boolean(true)},
    {"F", "T",
    "Pool", new Boolean(false), new Boolean(false)},
    TableDemo newContentPane = new TableDemo(columnNames,daa,4,5);
    newContentPane.setOpaque(true); //content panes must be opaque
    this.getContentPane().add(jPanel2);
    this.jPanel2.add(newContentPane,BorderLayout.CENTER);
    this.jPanel2.updateUI();
    jPanel2.repaint();
    jPanel2.revalidate();
    this.getContentPane().add(jPanel2);
    flag=1;
    public static void main(String[] args) {
    EmbededTable embededtable = new EmbededTable();
    JPanel jPanel1 = new JPanel();
    static int flag;
    JButton jButton1 = new JButton();
    JPanel jPanel2 = new JPanel();
    JPanel jPanel3 = new JPanel();
    BorderLayout borderLayout1 = new BorderLayout();
    JButton jButton2 = new JButton();
    public void CreateGUI()
    String[] columnNames = {"First Name",
    "Last Name",
    "Sport",
    "Include Input",
    "Include Output"};
    Object[][] data = {
    {"A", "Campione",
    "B", new Boolean(false), new Boolean(false)},
    {"C", "Huml",
    "Rowing", new Boolean(false), new Boolean(true)},
    {"D", "Walrath",
    "Knitting", new Boolean(false), new Boolean(false)},
    {"E", "Zakhour",
    "Speed reading", new Boolean(false), new Boolean(true)},
    {"F", "Milne",
    "Pool", new Boolean(false), new Boolean(false)},
    //Create and set up the content pane.
    TableDemo newContentPane = new TableDemo(columnNames,data,4,5);
    newContentPane.setOpaque(true); //content panes must be opaque
    jPanel3.setBorder(BorderFactory.createEtchedBorder());
    jPanel3.setBounds(new Rectangle(22, 133, 578, 304));
    jPanel3.setLayout(borderLayout1);
    // this.getContentPane().remove(jPanel2);
    this.getContentPane().add(jPanel3);
    this.jPanel3.add(newContentPane,BorderLayout.CENTER);
    this.jPanel3.updateUI();
    this.validate();
    public void jButton1_actionPerformed(ActionEvent e) {
    CreateGUI();
    public void jButton2_actionPerformed(ActionEvent e) {
    testTable();
    public void this_componentAdded(ContainerEvent e) {
    public void jPanel2_componentRemoved(ContainerEvent e) {
    System.out.println(" component removed");
    public void jPanel2_componentAdded(ContainerEvent e) {
    System.out.println(" component added");
    class EmbededTable_jPanel2_containerAdapter extends ContainerAdapter {
    private EmbededTable adaptee;
    EmbededTable_jPanel2_containerAdapter(EmbededTable adaptee) {
    this.adaptee = adaptee;
    public void componentRemoved(ContainerEvent e) {
    adaptee.jPanel2_componentRemoved(e);
    public void componentAdded(ContainerEvent e) {
    adaptee.jPanel2_componentAdded(e);
    class EmbededTable_this_containerAdapter extends ContainerAdapter {
    private EmbededTable adaptee;
    EmbededTable_this_containerAdapter(EmbededTable adaptee) {
    this.adaptee = adaptee;
    public void componentAdded(ContainerEvent e) {
    adaptee.this_componentAdded(e);
    class EmbededTable_jButton2_actionAdapter implements ActionListener {
    private EmbededTable adaptee;
    EmbededTable_jButton2_actionAdapter(EmbededTable adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton2_actionPerformed(e);
    class EmbededTable_jButton1_actionAdapter implements ActionListener {
    private EmbededTable adaptee;
    EmbededTable_jButton1_actionAdapter(EmbededTable adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);
    TabelDemo class
    public class TableDemo extends JPanel {
    private boolean DEBUG = false;
    public TableDemo(String[] c, Object[][] d,int col,int row) {
    super(new GridLayout(1, 0));
    JTable table = new JTable(new MyTableModel(c,d,4,5));
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    table.setFillsViewportHeight(true);
    Object obj=table.getValueAt(0,1);
    table.updateUI();
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.getViewport().setView(table);
         Object ob= table.getValueAt(0,0);
    System.out.println(" ob " + ob.toString());
    scrollPane.updateUI();
    scrollPane.getViewport().revalidate();
    scrollPane.getViewport().updateUI();
    add(scrollPane);
    this.updateUI();
    this.revalidate();
    super.repaint();
    super.validate();
    Tabel class
    public class MyTableModel extends AbstractTableModel {
    boolean DEBUG= false;
    public String[] columnNames ;
    public String[] str; // to verify only one output variable
    Boolean fal= new Boolean(false);
         public Object[][] data;
    MyTableModel()
    MyTableModel(String[] col, Object[][] dat, int lenRow, int lenCol)
    data=dat;
    columnNames=col;
    str= new String[col.length];
    funcopy(str,lenRow);
    void funcopy(String[] str, int lenRow)
    for(int i=0;i<lenRow;i++)
    str=fal.toString();
    for(int i=0;i<str.length;i++)
    System.out.println("values are " + str[i]);
    public int getColumnCount() {
    return columnNames.length;
    public int getRowCount() {
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    public boolean isCellEditable(int row, int col) {
    //Note that the data/cell address is constant,
    //no matter where the cell appears onscreen.
    if (col < 2) {
    return false;
    } else {
    return true;
    public void setValueAt(Object value, int row, int col) {
    if (DEBUG) {
    System.out.println("Setting value at " + row + "," + col
    + " to " + value
    + " (an instance of "
    + value.getClass() + ")");
    System.out.println("row " + row + "col " + col + value.toString());
    Object obj= getValueAt(row,col);
    if(col==3) // column 3 is the output column.
    if(value.toString().equals("true"))
    int savepointer=row;
    int flag=-1;
    for(int i=0;i<str.length;i++)
    if(str[i].toString().equalsIgnoreCase("true"))
    flag=1;
    if(flag!=1)
    System.out.println("inside flag ==1");
    data[row][col]=value;
    str[row]=value.toString();
    fireTableCellUpdated(row, col);
    if(value.toString().equals("false"))
    data[row][col]=value;
    str[row]=value.toString();
    fireTableCellUpdated(row, col);
    }// id col ends...
    if (DEBUG) {
    System.out.println("New value of data:");
    printDebugData();
    private void printDebugData() {
    int numRows = getRowCount();
    int numCols = getColumnCount();
    for (int i=0; i < numRows; i++) {
    System.out.print(" row " + i + ":");
    for (int j=0; j < numCols; j++) {
    System.out.print(" " + data[i][j]);
    System.out.println();
    System.out.println("--------------------------");

  • GUI event handling problems appear in 1.4.1 vs. 1.3.1?

    Hi,
    Has anyone else experienced strange event handling problems when migrating from 1.3.1 to 1.4.1? My GUI applications that make use of Swing's AbstractTableModel suddenly don't track mouse and selection events quickly anymore. Formerly zippy tables are now very unresponsive to user interactions.
    I've run the code through JProbe under both 1.3 and 1.4 and see no differences in the profiles, yet the 1.4.1 version is virtually unusable. I had hoped that JProbe would show me that some low-level event-handling related or drawing method was getting wailed on in 1.4, but that was not the case.
    My only guess is that the existing installation of 1.3.1 is interfering with the 1.4.1 installation is some way. Any thoughts on that before I trash the 1.3.1 installation (which I'm slightly reluctant to do)?
    My platform is Windows XP Pro on a 2GHz P4 with 1GB RAM.
    Here's my test case:
    import javax.swing.table.AbstractTableModel;
    import javax.swing.*;
    import java.awt.*;
    public class VerySimpleTableModel extends AbstractTableModel
    private int d_rows = 0;
    private int d_cols = 0;
    private String[][] d_data = null;
    public VerySimpleTableModel(int rows,int cols)
    System.err.println("Creating table of size [" + rows + "," + cols +
    d_rows = rows;
    d_cols = cols;
    d_data = new String[d_rows][d_cols];
    int r = 0;
    while (r < d_rows){
    int c = 0;
    while (c < d_cols){
    d_data[r][c] = new String("[" + r + "," + c + "]");
    c++;
    r++;
    System.err.println("Done.");
    public int getRowCount()
    return d_rows;
    public int getColumnCount()
    return d_cols;
    public Object getValueAt(int rowIndex, int columnIndex)
    return d_data[rowIndex][columnIndex];
    public static void main(String[] args)
    System.err.println( "1.4..." );
    JFrame window = new JFrame();
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    Dimension size = new Dimension(500,500);
    panel.setMinimumSize(size);
    panel.setMaximumSize(size);
    JTable table = new JTable(new VerySimpleTableModel(40,5));
    panel.add(table);
    window.getContentPane().add(panel);
    window.setSize(new Dimension(600,800));
    window.validate();
    window.setVisible(true);
    Thanks in advance!!
    - Dean

    Hi,
    I've fixed the problem by upgrading to 1.4.1_02. I was on 1.4.1_01.
    I did further narrow down the symptoms more. It seemed the further the distance from the previous mouse click, the longer it would take for the table row to highlight. So, clicking on row 1, then 2, was much faster than clicking on row 1, then row 40.
    If no one else has seen this problem -- good! I wouldn't wish the tremendous waste of time I've had on anyone!
    - Dean

  • 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

  • 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).

  • 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.

Maybe you are looking for

  • Charging for software on a BRAND NEW iPod Touch?

    Glad to hear people are now getting the 2.2 download to work. Has anyone gotten anywhere asking Apple for justification for a $10 software upgrade on a brand new iTouch purchased within 30 days and given as a Christmas gift? (I gave 2!) This is even

  • Storing resultset data to vector and then passing this data to JList

    hi every body I am facing this problem since two days I tried but could't get correctly,I am new to java and I need to pass the result set data from the database to a JList having JCheckBox I think I need to store the resulsetdata to a vector or arra

  • Commit the changes

    hi, SQL> select *from v$version; BANNER Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE    10.2.0.4.0      Production TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio NLSRTL

  • Query View ID

    Hi Friends, I have a requirement, where in we need to dyanmically capture a field called Subject codefrom a custom table when i run a report (View). For this we have created a varible of type customer exit. and we have i dentified a table RSZWVIEW wh

  • Who to use rs.getBoolean() in  oracle

    how to define a boolean dataType; I try to use this sql statement "isBankerWin BOOLEAN NOT NULL" but caught an "ORA-00902: invalid datatype" Exception who can tell me the reason? 3ks! Cheers!