-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.6
-
x86
-
windows_nt
Name: mf23781 Date: 07/03/98
*Symptoms:
If a range is defined for a JProgressBar object with the setMinimum and
setMaximum methods. When an attempt to use the setValue method to set a
value outside of the defined range then an IllegalArgumentException should
be thrown. However this is not the case, the value is accepted with no
error.
-----------------------------------------------------------------
import java.awt.*;
import com.sun.java.swing.*;
public class JProgressBarTest
{
public JProgressBarTest()
{
JProgressBar c = new JProgressBar(); //Create JProgressBar object
c.setMinimum(-5); //Set initial state of ProgressBar
c.setMaximum(15);
c.setValue(5);
try
{
c.setValue(-10);
System.out.println("IllegalArgumentException was not thrown");
}
catch(IllegalArgumentException e)
{
System.out.println("Exception "+e);
}
}
public static void main(String argv[])
{
JProgressBarTest p = new JProgressBarTest();
}
}
======================================================================
- duplicates
-
JDK-4086250 Method setValue() of JProgressBar doesn't throw IllegalArgumentException.
-
- Closed
-