Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4185305
Votes 2
Synopsis JProgressBar Metal PLAF overwrites empty borders
Category java:classes_swing
Reported Against 1.1.6 , 1.3.1 , 1.2rc1
Release Fixed
State 6-Fix Understood, bug
Priority: 4-Low
Related Bugs
Submit Date 29-OCT-1998
Description


/*

The JProgressBar Metal PLAF implementation as
shipped in JDK 1.2rc1 overwites an empty border
placed around it.  The following code recreates
the problem.  When you run this example, you will
see the border that the Metal PLAF is trying to
draw around the  customer  bar.  The paint routine
in MetalProgressBarUI.java is the culprit.

*/
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class pb_bug {

    public static void main(String[] args) {

        JFrame frame = new JFrame();
        frame.getContentPane().setLayout(new BorderLayout());

        JProgressBar pb = new JProgressBar();

        pb.setBorder(new EmptyBorder(10, 10, 10, 10));

        frame.getContentPane().add(pb, BorderLayout.CENTER);

        frame.show();

    }

}

(Review ID: 41450)
======================================================================




FULL PRODUCT VERSION :
java version "1.3.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)

FULL OPERATING SYSTEM VERSION :
 customer  Windows 2000 [Version 5.00.2195]



A DESCRIPTION OF THE PROBLEM :
If you set any type of border on a JProgressBar, extra
lines are drawn on top and on the left of the bar.  That is
troublesome when you decide to use a line border. The bug
can be easily seen when you for instance use a titled
border.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create a  customer  bar
2. select a line border for it
3.

EXPECTED VERSUS ACTUAL BEHAVIOR :
When a line border is selected, there should not be any
extra line drawn inside the component along the border.


This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class ProgressSample {
  public static void main (String args[]) {
    JFrame f = new JFrame("JProgressBar Sample");
    Container content = f.getContentPane();
    JProgressBar progressBar = new JProgressBar();
    progressBar.setValue(25);
    progressBar.setStringPainted(true);
    Border border = BorderFactory.createTitledBorder("Reading...");
    progressBar.setBorder(border);
    content.add(progressBar, BorderLayout.NORTH);
    f.setSize (300, 100);
    f.setVisible (true);
  }
}

---------- END SOURCE ----------
(Review ID: 138612)
======================================================================
Posted Date : 2005-09-09 19:19:06.0
Work Around
N/A
Evaluation



    The Metal LAF spec says that progress bar should use a subtle
inset 3D effect. The "extra" lines are specified when the metal
progress bar's border are used. It looks like we shouldn't paint
these lines for user defined border.

  xxxxx@xxxxx  

======================================================================
Posted Date : 2005-09-09 19:19:06.0

Contribution-Forum:https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=11905&forumID=1463
Posted Date : 2006-03-10 05:50:34.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang