JDK-4094136 : Scrollbar behaviour doesn't match description at Maximum parameter
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 1.1.4
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-11-20
  • Updated: 1998-01-27
  • Resolved: 1998-01-27
Related Reports
Duplicate :  
Description

Name: joT67522			Date: 11/19/97


1) Steps:
Just create a scrollbar. E.g.:
new Scrollbar(Scrollbar.HORIZONTAL, 1, 5, 0, 10);
The Maximum isn't the highest Value ! The
highest value is 15 (= 5 + 10)
so there are 10 steps for scrolling...

It works in Netscape Navigator however...
i can't believe...!!!

2) Source:
/*
 * @(#)ScrollTest.java	0.00 97/11/03 Oliver Rode
 * 
 * Copyright (c) 1997 Oliver Rode. All Rights Reserved.
 *
 * CopyrightVersion 1.0
 * 
 */

package forum;

import java.applet.*;
import java.awt.*;
import java.util.*;

/**
 * Main class of this package.
 *
 * @version 1.0 NOV/02/1997
 * @author Oliver Rode
 */
public class ScrollTest extends Applet
{
  public ScrollTest ()
  {
  }

  public void init()
  {
	BorderLayout b = new BorderLayout();
	setLayout(b);

	Scrollbar ranger = new Scrollbar(Scrollbar.HORIZONTAL, 1, 5, 0, 10);
	ranger.setLineIncrement(1);
	ranger.setPageIncrement(2);
	add("North", ranger);
  }

  public static void main (String argc[])
  {
	Frame f = new Frame();
	f.resize(640,500);
	ScrollTest o = new ScrollTest();
	f.add(o);
	f.show();
	o.init();
	o.start();
	f.validate();
  }
}


Regards,
Oliver
(Review ID: 19972)
======================================================================

Comments
WORK AROUND Name: joT67522 Date: 11/19/97 ======================================================================
2004-06-11