File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/java.desktop/share/classes/javax/swing Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ public class JInternalFrame extends JComponent implements
188188 protected String title ;
189189 /**
190190 * The icon that is displayed when this internal frame is iconified.
191+ * Subclassers must ensure this is set to a non-null value
192+ * during construction and not subsequently set this to null.
191193 * @see #iconable
192194 */
193195 protected JDesktopIcon desktopIcon ;
@@ -1307,11 +1309,15 @@ public JDesktopPane getDesktopPane() {
13071309 * <code>JInternalFrame</code>.
13081310 *
13091311 * @param d the <code>JDesktopIcon</code> to display on the desktop
1312+ * @throws NullPointerException if the {@code d} is {@code null}
13101313 * @see #getDesktopIcon
13111314 */
13121315 @ BeanProperty (description
13131316 = "The icon shown when this internal frame is minimized." )
13141317 public void setDesktopIcon (JDesktopIcon d ) {
1318+ if (d == null ) {
1319+ throw new NullPointerException ("JDesktopIcon is null" );
1320+ }
13151321 JDesktopIcon oldValue = getDesktopIcon ();
13161322 desktopIcon = d ;
13171323 firePropertyChange ("desktopIcon" , oldValue , d );
You can’t perform that action at this time.
0 commit comments