Take a look at StackLayout - that will allow you to pr-create your pages and easily switch between them... Cheers Cheis -- Sent from my Android phone. Richard Baldwin <baldwin@xxxxxxxxxxxxxxx> wrote: Hi Chris, Thanks for the response. See my comments inline below. On Sat, Aug 27, 2011 at 11:44 AM, Chris von See <chris@xxxxxxxxxxxxx> wrote: Hi Richard - I got a chance to take a look at your code... I'm not totally sure I understand if your goal is to make the program accessible or just to perform some action when the user selects something from the list, but here are some thoughts: rgb] My ultimate goal is to expose a new GUI page that contains lots of controls (text boxes, buttons, etc.) when the user selects an item from the list. I do want it to be accessible to blind students because my purpose is to write a GUI interface for my SVG Graphics Library (see http://cnx.org/content/m39607/latest/). Right now, I am trying to work out an overall structure that will be accessible. I have never used the SWT before, nor have I ever written a Java program with accessibility in mind, so I am plowing new ground in two areas with this one. -- If your goal is accessibility, take a look at the org.eclipse.swt.accessibility package. Many controls have a getAccessible() method that returns an Accessible object which allows you to do various accessibility-related things. Look at the Accessible object's methods and in particular the types of accessibility-related listeners you can add, which would allow you to (for example) change the description that is spoken for each list item or create the relation between the list and a descriptive label ("labelA") so that the label is spoken when the list gains focus. rgb] Thanks, I will take a look at it. Take a look at the snippets for the package at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/accessibility/package-summary.html to get some examples. rgb] Will do. -- Using List.addSelectionListener() is the way you would be notified of user list item selection. SWT should speak each item as the user traverses the list. You can modify what's spoken by setting listeners via List.getAccessible(). rgb] I have discovered that the following approach to event handling seems to work better in the sense that with this approach, the new page is not exposed until the user presses the Enter key on the selected item: myCombo.addListener (SWT.DefaultSelection, new Listener () { public void handleEvent (Event e) { //event handler code goes here }//end handleEvent }); -- If I'm reading your code correctly, you're creating your list using the Shell as the parent, and then immediately creating a "page" Composite with the same Shell as parent. I didn't run your code, but I *think* this will overlay your List with the contents of the "page" Composite. rgb] Actually it displays the new page below the Combo box, but the approach that you suggest below might work better. I really don't want to dispose of the old page in order to expose a new one. Try creating a "base" Composite with the shell as parent, then set a layout on that "base", add your list with the "base" as parent and then add your "page" Composite as another child of that same "base". Depending on what layout manager you use the controls will appear in different relative positions; you might try RowLayout with SWT.VERTICAL so that the list appears above the "page". rgb] I will definitely try this. -- When the list item is changed you don't need to dispose your "page" Composite - just set the label and foreground color (for the text) or background color (for the background of the "page"). rgb] Good. As I mentioned earlier, I don't want to dispose of the old page when I expose a new one. I would like for the user to be able to return to the page with the contents of the text boxes, etc., still intact. -- Instead of allocating red, green and blue Color objects using new Color(r, g, b), try using the static Color.RED, Color.GREEN and Color.BLUE - these have the same red, green and blue color settings as what you created. You also won't need to dispose these static Color objects when your program exits. rgb] Thanks. Good point. Hope this helps. I'll try to answer any other questions you may have, but I'll be in and out this weekend so it may take me a while to get back to you. rgb] I really do appreciate your feedback. If I am successful in this effort, I will publish a free Java program that blind students can use to draw technical diagrams for their physics and math courses. Actually, I have already published such a program, but the user interface is very difficult because it requires some knowledge of programming syntax. My objective is to make it available to every student with an easy-to-use GUI interface, even if they don't know about programming syntax. Thanks, Dick B. Cheers Chris On Aug 26, 2011, at 5:32 PM, Richard Baldwin wrote: John, This is my second attempt to send this. The previous attempt was rejected because the zip file was too large. I had included the SWT library in it, which is what made it so large. Since you probably have that already, I deleted it from the zip file and am going to try again with a much smaller zip file. Thanks, Dick Baldwin On Fri, Aug 26, 2011 at 7:23 PM, Richard Baldwin <baldwin@xxxxxxxxxxxxxxx> wrote: Hi John, I'm afraid that given my current lack of knowledge of SWT, I would be completely overwhelmed by the BrailleBlaster code. However, I have attached a zip file containing a simple page switcher program using SWT. If you could take the time to import it into Eclipse (or however you program using SWT) and let me know if the structure that I am using could be successfully navigated by a blind person, or how I should modify it to achieve that goal, I would greatly appreciate it. The GUI contains a list of three items. (I could make it a Combo or three radio buttons.) When the user selects one of the items in the list, a Composite object opens below the list. Right now, the Composite page simply contains a label, but eventually I intend for each new page to be a significant GUI in its own right. By the way, I had to rename a couple of build.bat files to get the zip file past the GMail virus police. Thanks, Dick Baldwin On Fri, Aug 26, 2011 at 6:45 PM, John J. Boyer <john.boyer@xxxxxxxxxxxxxxxxx> wrote: Dick, Accessibility with SWT is almost automatic. BrailleBlaster does not use any particular accessibility features now, though it might use the accessibility package in SWT later. In the Bfailloeblasterr menu, BBMenu.java there is a listener for each item. The event is not sent until the enter key is pressed on that item. There are SWT widgets for handling lists. These will be used later, for example in handling the list of recent documents. If you have Mercurial you can get the source of BrailleBlaster from its googlecode page. BBMenu.java is in org.brailleblaster.wordprocessor I could also send you this class privately as an attachmennt, if you wish. John On Fri, Aug 26, 2011 at 06:03:09PM -0500, Richard Baldwin wrote: > I know this is off topic for this list, but I also know that there are > several excellent SWT programmers that frequent this list who probably know > the answer to my question. > > The objective is to make it possible for a blind user of an SWT GUI to > navigate through a list of items, such as might be found in a Combo, a List, > or perhaps a set of Radio buttons, and cause an event to be fired for one > and only one of the items in the list when that item is chosen. > > It looks to me like using the following code to register a listener on each > item in the list causes each item to fire an event when the arrow keys are > used to traverse the list: > > addSelectionListener(new SelectionAdapter() > > I guess what I am looking for is something like an ActionListener in the AWT > and Swing that can be fired by pressing the Return key after the arrow keys > have been used to choose a specific item. > > I am finding that learning the SWT and trying to achieve accessibility for > blind users at the same time is something of a challenge. > > If you prefer to contact me and have this discussion off list, that will be > OK with me. > > Thanks, > Dick Baldwin > > -- > 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 -- 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/ -- 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/ <PageSwitcher01.zip> -- 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/