Skip to content

Commit 1f90594

Browse files
committed
improve documentation of getMenuShortcutKeyMaskEx() deprecation warning
1 parent 30b6f3a commit 1f90594

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/edu/princeton/cs/algs4/Picture.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ public void setOriginLowerLeft() {
229229
/**
230230
* Displays the picture in a window on the screen.
231231
*/
232+
233+
// getMenuShortcutKeyMask() deprecated in Java 10 but its replacement
234+
// getMenuShortcutKeyMaskEx() is not available in Java 8
235+
@SuppressWarnings("deprecation")
232236
public void show() {
233237

234238
// create the GUI for viewing the image if needed
@@ -240,7 +244,6 @@ public void show() {
240244
menuBar.add(menu);
241245
JMenuItem menuItem1 = new JMenuItem(" Save... ");
242246
menuItem1.addActionListener(this);
243-
// use getMenuShortcutKeyMaskEx() in Java 10 (getMenuShortcutKeyMask() deprecated)
244247
menuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
245248
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
246249
menu.add(menuItem1);

0 commit comments

Comments
 (0)