Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1231641

fp.bugs 2904: Win32 cannot tab among controls.

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Not verified

      Description

      The Gripster <###@###.###>

      Win 32 only: Cannot tab among controls on a panel, okay on solaris. Beta 2 build

      Steps to reproduce
      Compile and run the attached code
      <Click> on any of the controls
      Press <Tab> to go to the next control


      import java.awt.*;

      public class TabTest extends java.applet.Applet
      {

          public void init()
          {
             add( new Button("Test this") );
             List list = new List();
             list.addItem("One");
             list.addItem("Two");
             list.addItem("Three");
             add( list);
             add( new TextField("Here") );
             resize(200, 200);
          }
          public static void main(String args[])
          {
             AppletFrame.startApplet("TabTest", "Tabbing Test", args);
          }
      }


      /* Generic Applet to Application Frame
       * @(#)AppletFrame.java 1.4 12/02/95 15:28:07
       * @author Kevin A. Smith
       *
       */

      import java.awt.Frame;
      import java.awt.Event;
      import java.awt.Dimension;
      import java.applet.Applet;

      // Applet to Application Frame window
      class AppletFrame extends Frame
      {

          public static void startApplet(String className,
                                         String title,
                                         String args[])
          {
             // local variables
             Applet a;
             Dimension appletSize;

             try
             {
                // create an instance of your applet class
                a = (Applet) Class.forName(className).newInstance();
             }
             catch (ClassNotFoundException e) { return; }
             catch (InstantiationException e) { return; }
             catch (IllegalAccessException e) { return; }

             // initialize the applet
             a.init();
             a.start();
        
             // create new application frame window
             AppletFrame f = new AppletFrame(title);
        
             // add applet to frame window
             f.add("Center", a);
        
             // resize frame window to fit applet
             // assumes that the applet sets its own size
             // otherwise, you should set a specific size here.
             appletSize = a.size();
             f.pack();
             f.resize(appletSize);

             // show the window
             f.show();
        
          } // end startApplet()
        
        
          // constructor needed to pass window title to class Frame
          public AppletFrame(String name)
          {
             // call java.awt.Frame(String) constructor
             super(name);
          }

          // needed to allow window close
          public boolean handleEvent(Event e)
          {
             // Window Destroy event
             if (e.id == Event.WINDOW_DESTROY)
             {
                // exit the program
                System.exit(0);
                return true;
             }
             
             // it's good form to let the super class look at any
             // unhandled events
             return super.handleEvent(e);

          } // end handleEvent()

      } // end class AppletFrame






        Attachments

          Activity

            People

            Assignee:
            tballsunw Tom Ball (Inactive)
            Reporter:
            kasmithsunw Kevin Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: