Normally, one creates a Display object using something like: final Display d = new Display();That Display object can then be used to create Shells and other SWT objects, such as Color and Font objects.
If that's not what you're looking for please send a complete code sample and a description of what you want to do and I'll try to help.
Cheers Chris On Feb 24, 2011, at 5:52 AM, John J. Boyer wrote:
Michael,Display is a class in org.eclipse.swt.widgets I was hoping someone wouldbe familiar enough with swt to give a useful opinion. This is just the start of coding, and I have not been coding Java that long. Sone of the things you have noted are just incomplete. John On Thu, Feb 24, 2011 at 01:19:50PM +0000, Michael Whapples wrote:You'll need to give better detail than this. When you say callingDisplay() what do you mean by this, what class/object is it on? The name convention of a capital first letter suggests this is not a method callbut rather a constructor of a class.Looking at the code in the repository did not help at all, to be honest its dreadful. There's an instance where you construct an instance of an object but never assign it to a variable, this is meaningless in object orientated design. A constructor should only do work which is necessary to prepare an object ready for use, therefore never assigning it meansyou never use it, therefore why create it?In the public static void main (psvm) where you enter BrailleBlaster youhave put some throws on it, is this really wanted, shouldn'tBrailleBlaster try and handle them and if users need to be informed/ need to make a decision then couldn't BrailleBlaster catch them and give moreuser friendly error messages?As well as this rather unusual use of an object orientated language, you have made it harder to read/understand in some more cosmetic ways: Whatis the variable m? Indentation of blocks would also help quickly know where one is in the complicated conditional blocks you have used. I could go on but I feel it would get too long. Michael Whapples On 23/02/11 07:37, John J. Boyer wrote:As noted, I have BrailleBlaster running on Windows so I can develop and test a prototype GUI. I have SWT in my classpath. However when I call Display() it returns null. Do I have to do something more than just callthe SWT methods and classes? I am calling BrailleBlasster from thecommand line with java -jar brailleblaster.jar However, I've called GUI programs from the command line before, and they operate normally. Anysuggestions will be appreciated. Thanks, John-- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities