To understand how a component is built and works (in the Swing widget set).
Take the JFC ScrollBar class (JScrollBar) and modify it to create a "dual" scroll bar. A dual scroll bar has two thumbs and allows you to control a range of values, rather than a single value.
Here is a single scrollbar:
Conceptually, you want to create a scrollbar with a thumb like this:
The JScrollBar class has 2 parameters that control the position and size of the thumb: value and extent. The user controls the value by moving the thumb, and the extent is controlled by the programmer. The value of the extent is typically used to show the percentage of data visible in the widget controlled by the scrollbar (e.g., if half of a list is visible in a scrolling list box, the extent would be set to half the range, which would cause the thumb to be rendered as half the size of the scrollbar).
The JDualScrollBar class should allow the user to control both the value and extent directly. It would be used to specify and range of values, rather than a single value.
For the basic assignment, you only need to update the behavior of the widget, not its appearance (updating the appearance can be done for extra credit: see below). In other words, you will have to make sure the thumb is the correct size and that when the user clicks on the appropriate part of the thumb, it behaves correctly. But, you do not have to change the single thumb to look like two thumbs, as shown above (a single thumb the size of those three regions is fine.)
The basic difference between the JDualScrollBar and the JScrollBar is that the the extent and value are controlled by a combination of the two thumbs in a new "dual-thumb" that resides in the scroll bar. The minimum size of the dual-thumb is twice the minimum size of the single thumb in the JScrollBar, with the "thumb-sized" region at each end of the dual-thumb being used to control the bounds of the scrollbar region. The middle of the dual-thumb (when it is larger than its minimum size) can be used to move both thumbs together. Clicking in the background of the scrollbar above or below the dual-thumb causes the whole dual-thumb to move.
You will be provided with a set of class files that implement the widget "JDualScrollBar". These files actually implement a normal scrollbar (they are, in fact, almost direct copies of the code for JScrollBar). You will subclass these files to create a widget called JDualScrollBar2. You should not change anything in the JDualScrollBar class files, instead overriding those methods you need to change in your "2" class files (add a "2" where appropriate to the class file names to create the new classes).
Your program should consist of a set of java files which should be commented with your name (the name you are registered under!) and ID number. The TA will test your program against a test file that assumes the existance of the class "JDualScroll2". Your files should be emailed to cs4470@cc.gatech.edu in a single message, with each file as a separate MIME attachment.
IMPORTANT: If the TA has to edit your files or his test program, you will lose points.
This program is due on or before Monday, October 1st. This means it must be received by 11:59pm EDT on Monday to not be considered late.
Your program should create a window of at least 500x500 pixels, and handle window resizing properly.
There is a single extra credit part of this assignment. You should update the Metal look and feel of this widget so it looks correct based on its new functionality.