Shell is a SWT class. Actually, my original message was incorret. I should have said shell.dispose(); shell is an instgance of Shell. This method call works elsewhere. Ne, I just checked, and I had an upper-case S instead of a lower-case s. The code now builds sucessfully. Thanks for the prod. John On Mon, Jun 06, 2011 at 01:07:04PM -0500, Richard Baldwin wrote: > If Shell is the name of a class, the only methods that can be called using > the syntax > > Shell.dispose(); > > are static methods. If dispose() is not static, it can't be called this way. > > Just a guess. Beyond that, I would need to see some code. > > Dick Baldwin > > On Mon, Jun 6, 2011 at 12:56 PM, John J. Boyer <john.boyer@xxxxxxxxxxxxxxxxx > > wrote: > > > In one of my methods the compiler complains about the statement > > Shell.dispose(); It says I can't call a nonstatic method in a static > > context. The method in which this statement occurs is not static. It was > > moved from another class in which there was no problem. > > > > I can provide the code, of course, but I thought you might be able to > > answer this one from your experience. > > > > Thanks, > > John > > > > -- > > John J. Boyer; President, Chief Software Developer > > Abilitiessoft, Inc. > > http://www.abilitiessoft.com > > Madison, Wisconsin USA > > Developing software for people with disabilities > > > > > > > > > -- > Richard G. Baldwin (Dick Baldwin) > Home of Baldwin's on-line Java Tutorials > http://www.DickBaldwin.com > > Professor of Computer Information Technology > Austin Community College > (512) 223-4758 > mailto:Baldwin@xxxxxxxxxxxxxxx > http://www.austincc.edu/baldwin/ -- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities