Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Application lock-up when invalid icon image used on default look and feel decorated windows #122

Open
darrenscott opened this issue Jul 18, 2013 · 1 comment

Comments

@darrenscott
Copy link

It's possible to get an application using default look and feel decorated frames/dialogs to enter an infinite loop if the window icon configured is invalid.

I was able to reproduce this with the following short, self contained, correct example:

package com.darrenscott;

import javax.swing.*;
import java.awt.*;
import org.pushingpixels.substance.api.skin.SubstanceGraphiteGlassLookAndFeel;

public class SubstanceLockUpExample {

  public static void main(String[] args) {

    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          UIManager.setLookAndFeel(new SubstanceGraphiteGlassLookAndFeel());
          JFrame.setDefaultLookAndFeelDecorated(true);
          JFrame frame = new JFrame("Substance Lock-Up Example");
          frame.setIconImage(Toolkit.getDefaultToolkit().getImage("this-image-file-does-not-exist.png"));
          frame.setSize(new Dimension(300, 200));
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
        } catch (UnsupportedLookAndFeelException e) {
          e.printStackTrace();
        }
      }
    });
  }
}

At the point of attempting to show the frame, nothing appears and the code enters an infinite loop. This problem only occurs if defaultLookAndFeelDecorated is true; it works fine if it is false.

The offending code appears to be the updateAppIcon() method in SubstanceTitlePane. If the value returned from the call to SubstanceCoreUtilities.getScaledIconImage() is null, the containing while loop repeats indefinitely.

@shemnon
Copy link

shemnon commented Aug 10, 2013

I don't have the time to maintain this project, and I am currently looking for a new maintainer.

http://speling.shemnon.com/blog/2013/06/08/insubstantial-needs-a-new-maintainer/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants