JDK-4446468 : Moving JInternalFrame over JDesktopPane's border in JScrollPane shows PixelTrash
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_98
  • CPU: x86
  • Submitted: 2001-04-17
  • Updated: 2004-08-16
  • Resolved: 2004-08-16
Related Reports
Duplicate :  
Description

Name: boT120536			Date: 04/17/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


1. Exact steps to reproduce the problem

- Create a JDesktopPane.
- Create a JInternalFrame and add it to the JDesktopPane.
- Create a JPanel with a big minimumsize and BorderLayout.
- Add the JDesktopPane to the JPanel.
- Create a ScrollPane with that JPanel.
- Display that ScrollPane at a size smaller than the JPanel.
Now move the JInternalFrame over a border and back to the screen. If you move
it *slow*, you'll see pixel errors on the area that should be redrawn.

The visible reason for the bug: When a JInternalFrame is redrawn the
JScrollPane's borders, especially its scrollbars, are not subtracted from the
JDesktopPane's size.

2. Java SOURCE CODE that demonstrates the problem

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

public class Bug3 {
	public static void main(String[] args) {
		JFrame f = new JFrame(); //"Bug");
		JPanel panel = new JPanel() {
			{ setLayout(new BorderLayout()); }
			public Dimension getPreferredSize() {
				return new Dimension(2000,2000);
			}
			public Dimension getMinimumSize() {
				return getPreferredSize();
			}
		};
		JDesktopPane desktop = (JDesktopPane) panel.add(new JDesktopPane
());
		JInternalFrame iframe = (JInternalFrame) desktop.add(new
JInternalFrame("Test",true,true,true,true));
		iframe.getContentPane().add(new JButton("Test"));
		iframe.setSize(300,200);
		iframe.setVisible(true);
		f.getContentPane().add(new JScrollPane(panel));
		f.setSize(java.awt.Toolkit.getDefaultToolkit().getScreenSize());
		f.setVisible(true);
	}
}


(Review ID: 120845) 
======================================================================

Comments
WORK AROUND Name: boT120536 Date: 04/17/2001 Don't use JDesktopPanes in a JScrollPane's hierarchy. ======================================================================
19-08-2004

EVALUATION This has been fixed as part of 5086872, closing as such. ###@###.### 2004-08-16
16-08-2004