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

SCROLLBARS_AS_NEEDED does not work correctly in Windows

XMLWordPrintable

    • 1.1.6
    • x86
    • windows_nt
    • Verified



        Name: mf23781 Date: 11/20/97


        The following piece of Java displays a panel which does not need Scrollbars, but in Windows 95 and Windows NT it has them. When it is run on AIX it has no scrollbars.

        The default for the instantiation is SCROLLBARS_AS_NEEDED. The action is incorrect whether the default is taken or SCROLLBARS_AS_NEEDED is specified.

        -----------------------------------------------------------------------------------------------------
        import java.applet.*;
        import java.awt.*;

        public class ScrollPane extends Applet {
            private java.awt.ScrollPane ivjScrollPane1;

            public void init() {
                super.init();
                setName("ScrollPane");
                setLayout(null);
                setSize(426, 240);
        //
        // ivjScrollPane1 = new java.awt.ScrollPane(java.awt.ScrollPane.SCROLLBARS_NEVER);
        //
                ivjScrollPane1 = new java.awt.ScrollPane();

                ivjScrollPane1.setName("ScrollPane1");
                ivjScrollPane1.setBounds(26, 16, 376, 205);
                add(ivjScrollPane1, "ScrollPane1");
            }

            public static void main(java.lang.String[] args) {
                try {
                   java.awt.Frame frame = new java.awt.Frame();
                   ScrollPane aScrollPane = new ScrollPane();

                   frame.add("Center", aScrollPane);
                   frame.setSize(500, 300);
                   aScrollPane.init();
                   aScrollPane.start();
                   frame.setVisible(true);
                }
                catch (Throwable exception) {
                   System.err.println("Exception caught in main()");
                   exception.printStackTrace(System.out);
                }
            }
        }



        ======================================================================

              rkarsunw Ralph Kar (Inactive)
              miflemi Mick Fleming
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: