From: Bob H. <ha...@st...> - 2007-08-16 18:59:14
|
Li Yang wrote: > Hi Bob, > > > > The environment I run Jmol (V 11.2.8) on is quite sensitive and it was > able to detect a hidden thread violation from using the Run button in > the script console window. I typed a script command (for example, > spin on) in the console window, and click the Run button. I can see > warnings about Swing component being access from a thread other than > the Event Dispatch Thread (EDT). I looked up the ScriptWindow.java, > and indeed in executeCommand method, console, runButton and haltButton > are being accessed from the ExecuteCommandThread instead of EDT. > Would you please take a look at this and put the call to these Swing > components to SwingUtilities.invokeLater or > SwingUtilities.invokeAndWait? > thanks, that's fixed. > > > Thank you very much. > > > > Li Yang > > > > //-----------------------------------------------------------------------------// > > Below is the thread warning > > > > A Swing component is being accessed on a thread (Thread-106) other > than the Event Dispatch Thread. > > Component: > org.openscience.jmol.app.ConsoleTextPane[,0,0,588x336,invalid,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.basic.BasicBorders$MarginBorder@16157ec,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=javax.swing.plaf.ColorUIResource[r=0,g=0,b=0],disabledTextColor=javax.swing.plaf.ColorUIResource[r=128,g=128,b=128],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=3,left=3,bottom=3,right=3],selectedTextColor=javax.swing.plaf.ColorUIResource[r=255,g=255,b=255],selectionColor=javax.swing.plaf.ColorUIResource[r=10,g=36,b=106],kit=javax.swing.text.StyledEditorKit@510e35,typeHandlers={text/plain=javax.swing.text.StyledEditorKit@510e35}] > > at java.awt.Component.repaint(Unknown Source) > > at javax.swing.text.DefaultCaret.repaint(Unknown Source) > > at javax.swing.text.DefaultCaret.changeCaretPosition(Unknown Source) > > at javax.swing.text.DefaultCaret.handleSetDot(Unknown Source) > > at javax.swing.text.DefaultCaret.setDot(Unknown Source) > > at javax.swing.text.DefaultCaret.setDot(Unknown Source) > > at javax.swing.text.JTextComponent.setCaretPosition(Unknown Source) > > at > org.openscience.jmol.app.ConsoleDocument.appendNewline(ScriptWindow.java:623) > > at > org.openscience.jmol.app.ConsoleTextPane.appendNewline(ScriptWindow.java:360) > > at > org.openscience.jmol.app.ScriptWindow.executeCommand(ScriptWindow.java:250) > > at > org.openscience.jmol.app.ScriptWindow$ExecuteCommandThread.run(ScriptWindow.java:175) > > A Swing component is being accessed on a thread (Thread-106) other > than the Event Dispatch Thread. > > Component: > javax.swing.JButton[,90,5,47x23,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@127f2bb,flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=11,bottom=2,right=11],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Halt,defaultCapable=true] > > at java.awt.Component.repaint(Unknown Source) > > at javax.swing.JComponent.setEnabled(Unknown Source) > > at javax.swing.AbstractButton.setEnabled(Unknown Source) > > at > org.openscience.jmol.app.ScriptWindow.executeCommand(ScriptWindow.java:301) > > at > org.openscience.jmol.app.ScriptWindow$ExecuteCommandThread.run(ScriptWindow.java:175) > >------------------------------------------------------------------------ > >------------------------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. >Still grepping through log files to find problems? Stop. >Now Search log events and configuration files using AJAX and a browser. >Download your FREE copy of Splunk now >> http://get.splunk.com/ > >------------------------------------------------------------------------ > >_______________________________________________ >Jmol-users mailing list >Jmo...@li... >https://lists.sourceforge.net/lists/listinfo/jmol-users > > -- Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 |