JDK-4913618 : Dialog doesn't inherits icon from its parent frame
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2003-08-27
  • Updated: 2006-08-07
  • Resolved: 2006-08-07
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Name: rmT116609			Date: 08/27/2003


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


FULL OS VERSION :
Linux vova.labs.intellij.net 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686 i686 i386 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
KDE 3.1.3-0.9x.4 RedHat

A DESCRIPTION OF THE PROBLEM :
java.awt.Dialog doesn't inherit icon from its parent frame (icon is set by java.awt.Frame.setIconImage() method). Therefore all such dialogs has default ugly X11 icon. Due to it's impossible to set icon directly to dialog (why? all my native Win32 and Gnome/KDE application has icons for dialogs), all dialogs that belog to the Java application looks like they do not belong to the application because they have different icon.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Be sure that you are running KDE
2. Compile and run the attached sample application

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1. Appeared frame has "red square" icon
2. Child dialog has same "red square" icon
ACTUAL -
Child dialog has default X11 icon

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;

/**
 * @author Vladimir Kondratyev
 */
public class Test {
  public static void main(String[] args) {
    JFrame frame = new JFrame("Test");
    Container contentPane = frame.getContentPane();
    contentPane.setLayout(new BorderLayout());
    frame.addWindowListener(
      new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          System.exit(0);
        }
      }
    );

    BufferedImage image = new BufferedImage(16,16,BufferedImage.TYPE_INT_BGR);
    Graphics graphics = image.getGraphics();
    graphics.setColor(Color.RED);
    graphics.fillRect(0, 0, 32, 32);
    graphics.dispose();

    frame.setIconImage(image);

    frame.setBounds(300,300,400,300);
    frame.show();

    Dialog dialog = new Dialog(frame);
    dialog.setBounds(400,400, 100, 100);
    dialog.show();
  }
}

---------- END SOURCE ----------
(Incident Review ID: 200000) 
======================================================================

Comments
EVALUATION The icon supoort was improved with 6339074
07-08-2006

EVALUATION We've considered this before and decided not to do it. See 4094035 and 4196387 for details. We'll consider this as an rfe, but the UI guidelines we've seen recommend against it. ###@###.### 2003-08-27 Bug is not reproducible on KDE 3.3.0-29. On Gnome bug is reproduced with all versions of java. I've tested 6.0 current build, 1.5.0_01 and 1.4.2. Need to implement icon inheritance for child dialogs in XAWT. ###@###.### 2005-06-22 14:12:32 GMT
22-06-2005