Fixing compiler warnings in src/demo/share/jfc

Marc Hoffmann hoffmann at mountainminds.com
Wed Oct 23 17:59:41 UTC 2019


MOTIVATION

As a developer of the JaCoCo code coverage library I do lots of JDK builds. JDK
builds are simple, fast and produce minimal log output. Nice! What annoys me
though are plenty of compiler warnings at the end of the build caused by the
example code in src/demo/share/jfc

FIX

I propose a series of 3 patches (based on each other) which fixes all compiler
warnings for the demos:

patch1.txt - Fix compiler warnings in demos: raw types
patch2.txt - Fix compiler warnings in demos: deprecated APIs
patch3.txt - Fix compiler warnings in demos: deprecated Applet APIs

While patch 1 & 2 do not change functionality patch 3 actually removes the
Applet versions of some of the demos. The java main versions of the same demos
are still intact.

The patches are based on changeset 56699:70e6b0d8db13.

They have been tested from this clone: https://github.com/marchof/jdk/tree/fix-compiler-warnings-in-demos

RESULT

All compiler warnings on demo code during JDK build are removed

TESTING

I haven't found any automated tests so I manually launched all the demos. From
what I can say they are still functional.

SCOPE

I applied minimal changes to remove compiler warnings only. There are many more
cleanup opportunities in the demo code. Also there is (dead?) code in
src/demo/share/java2d which has similar issues. Both are not on scope of these
patches.

NEXT STEPS

I’m have no experience with OpenJDK patches. If you’re interested in getting these warnings fixed please
let me know how I can submit these patches properly.

-------------- next part --------------
diff --git a/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java b/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java
index d5a0477..64af243 100644
--- a/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java
+++ b/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java
@@ -136,7 +136,7 @@
     private JRadioButton openRadioButton;
     private JRadioButton saveRadioButton;
     private JRadioButton customButton;
-    private JComboBox lafComboBox;
+    private JComboBox<SupportedLaF> lafComboBox;
     private JRadioButton justFilesRadioButton;
     private JRadioButton justDirectoriesRadioButton;
     private JRadioButton bothFilesAndDirectoriesRadioButton;
@@ -292,7 +292,7 @@
         showButton.setMnemonic('s');
 
         // Create laf combo box
-        lafComboBox = new JComboBox(supportedLaFs.toArray());
+        lafComboBox = new JComboBox<>(supportedLaFs.toArray(new SupportedLaF[0]));
         lafComboBox.setSelectedItem(nimbusLaF);
         lafComboBox.setEditable(false);
         lafComboBox.addActionListener(optionListener);
@@ -729,7 +729,7 @@
                     frame.pack();
                 } catch (UnsupportedLookAndFeelException exc) {
                     // This should not happen because we already checked
-                    ((DefaultComboBoxModel) lafComboBox.getModel()).
+                    ((DefaultComboBoxModel<?>) lafComboBox.getModel()).
                             removeElement(supportedLaF);
                 }
             }
diff --git a/src/demo/share/jfc/Font2DTest/Font2DTest.java b/src/demo/share/jfc/Font2DTest/Font2DTest.java
index f01f983..de3b1ae 100644
--- a/src/demo/share/jfc/Font2DTest/Font2DTest.java
+++ b/src/demo/share/jfc/Font2DTest/Font2DTest.java
@@ -67,7 +67,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.util.EnumSet;
 import java.util.StringTokenizer;
 import java.util.BitSet;
 import javax.swing.*;
@@ -101,8 +100,8 @@
     private final ChoiceV2 transformMenu;
     private final ChoiceV2 transformMenuG2;
     private final ChoiceV2 methodsMenu;
-    private final JComboBox antiAliasMenu;
-    private final JComboBox fracMetricsMenu;
+    private final JComboBox<FontPanel.AAValues> antiAliasMenu;
+    private final JComboBox<FontPanel.FMValues> fracMetricsMenu;
 
     private final JSlider contrastSlider;
 
@@ -151,10 +150,10 @@
         methodsMenu = new ChoiceV2( this );
 
         antiAliasMenu =
-            new JComboBox(EnumSet.allOf(FontPanel.AAValues.class).toArray());
+            new JComboBox<>(FontPanel.AAValues.values());
         antiAliasMenu.addActionListener(this);
         fracMetricsMenu =
-            new JComboBox(EnumSet.allOf(FontPanel.FMValues.class).toArray());
+            new JComboBox<>(FontPanel.FMValues.values());
         fracMetricsMenu.addActionListener(this);
 
         contrastSlider = new JSlider(JSlider.HORIZONTAL, 100, 250,
@@ -467,7 +466,7 @@
         int style = fontStyles[styleMenu.getSelectedIndex()];
         Font f;
         for (int i = 0; i < listCount; i++) {
-            String fontName = (String)fontMenu.getItemAt(i);
+            String fontName = fontMenu.getItemAt(i);
             f = new Font(fontName, style, size);
             if ((rm.getSelectedIndex() != RangeMenu.SURROGATES_AREA_INDEX) &&
                 canDisplayRange(f, rangeStart, rangeEnd)) {
@@ -905,7 +904,7 @@
                                 parseUserText( userTextArea.getText() ), null );
         }
         else if ( source instanceof JComboBox ) {
-            JComboBox c = (JComboBox) source;
+            JComboBox<?> c = (JComboBox<?>) source;
 
             /// RangeMenu handles actions by itself and then calls fireRangeChanged,
             /// so it is not listed or handled here
@@ -1070,7 +1069,7 @@
         }
     }
 
-    private final class ChoiceV2 extends JComboBox {
+    private final class ChoiceV2 extends JComboBox<String> {
 
         private BitSet bitSet = null;
 
@@ -1141,7 +1140,7 @@
             this.choice = choice;
         }
 
-        public Component getListCellRendererComponent(JList list,
+        public Component getListCellRendererComponent(JList<?> list,
                                                       Object value,
                                                       int index,
                                                       boolean isSelected,
diff --git a/src/demo/share/jfc/Font2DTest/FontPanel.java b/src/demo/share/jfc/Font2DTest/FontPanel.java
index 973b80d..d98ccd5 100644
--- a/src/demo/share/jfc/Font2DTest/FontPanel.java
+++ b/src/demo/share/jfc/Font2DTest/FontPanel.java
@@ -434,7 +434,7 @@
         private int canvasInset_X = 5, canvasInset_Y = 5;
 
         /// LineBreak'ed TextLayout vector
-        private Vector lineBreakTLs = null;
+        private Vector<TextLayout> lineBreakTLs = null;
 
         /// Whether the current draw command requested is for printing
         private boolean isPrinting = false;
@@ -800,7 +800,7 @@
                 if ( textToUse == FILE_TEXT ) {
                     if ( !isPrinting )
                       f2dt.fireChangeStatus( "LineBreaking Text... Please Wait", false );
-                    lineBreakTLs = new Vector();
+                    lineBreakTLs = new Vector<>();
                     for ( int i = 0; i < fileText.length; i++ ) {
                         AttributedString as =
                           new AttributedString( fileText[i], g2.getFont().getAttributes() );
@@ -929,7 +929,7 @@
                 float xPos, yPos = (float) canvasInset_Y;
                 g2.drawRect( 0, 0, w - 1, h - 1 );
                 for ( int i = drawStart; i <= drawEnd; i++ ) {
-                    TextLayout oneLine = (TextLayout) lineBreakTLs.elementAt( i );
+                    TextLayout oneLine = lineBreakTLs.elementAt( i );
                     xPos =
                       oneLine.isLeftToRight() ?
                       canvasInset_X : ( (float) w - oneLine.getAdvance() - canvasInset_X );
@@ -992,9 +992,9 @@
             /// Back up metrics and other drawing info before printing modifies it
             int backupDrawStart = drawStart, backupDrawEnd = drawEnd;
             int backupNumCharAcross = numCharAcross, backupNumCharDown = numCharDown;
-            Vector backupLineBreakTLs = null;
+            Vector<TextLayout> backupLineBreakTLs = null;
             if ( textToUse == FILE_TEXT )
-              backupLineBreakTLs = (Vector) lineBreakTLs.clone();
+              backupLineBreakTLs = new Vector<>(lineBreakTLs);
 
             printPageNumber = pageIndex;
             isPrinting = true;
@@ -1246,7 +1246,7 @@
        }
        public static Object getValue(int ordinal) {
            if (valArray == null) {
-               valArray = (FMValues[])EnumSet.allOf(FMValues.class).toArray(new FMValues[0]);
+               valArray = EnumSet.allOf(FMValues.class).toArray(new FMValues[0]);
            }
            for (int i=0;i<valArray.length;i++) {
                if (valArray[i].ordinal() == ordinal) {
@@ -1257,7 +1257,7 @@
        }
        private static FMValues[] getArray() {
            if (valArray == null) {
-               valArray = (FMValues[])EnumSet.allOf(FMValues.class).toArray(new FMValues[0]);
+               valArray = EnumSet.allOf(FMValues.class).toArray(new FMValues[0]);
            }
            return valArray;
        }
@@ -1308,7 +1308,7 @@
 
        public static Object getValue(int ordinal) {
            if (valArray == null) {
-               valArray = (AAValues[])EnumSet.allOf(AAValues.class).toArray(new AAValues[0]);
+               valArray = EnumSet.allOf(AAValues.class).toArray(new AAValues[0]);
            }
            for (int i=0;i<valArray.length;i++) {
                if (valArray[i].ordinal() == ordinal) {
@@ -1321,7 +1321,7 @@
        private static AAValues[] getArray() {
            if (valArray == null) {
                Object [] oa = EnumSet.allOf(AAValues.class).toArray(new AAValues[0]);
-               valArray = (AAValues[])(EnumSet.allOf(AAValues.class).toArray(new AAValues[0]));
+               valArray = EnumSet.allOf(AAValues.class).toArray(new AAValues[0]);
            }
            return valArray;
        }
diff --git a/src/demo/share/jfc/Font2DTest/RangeMenu.java b/src/demo/share/jfc/Font2DTest/RangeMenu.java
index 54b6ad8..9200fb8 100644
--- a/src/demo/share/jfc/Font2DTest/RangeMenu.java
+++ b/src/demo/share/jfc/Font2DTest/RangeMenu.java
@@ -62,7 +62,7 @@
 
 /// Custom made choice menu that holds data for unicode range
 
-public final class RangeMenu extends JComboBox implements ActionListener {
+public final class RangeMenu extends JComboBox<String> implements ActionListener {
 
     private static final int[][] UNICODE_RANGES = getUnicodeRanges();
     private static final String[] UNICODE_RANGE_NAMES = getUnicodeRangeNames();
@@ -181,7 +181,7 @@
         Object source = e.getSource();
 
         if ( source instanceof JComboBox ) {
-                String rangeName = (String)((JComboBox)source).getSelectedItem();
+                String rangeName = (String)((JComboBox<?>)source).getSelectedItem();
 
                 if ( rangeName.equals("Custom...") ) {
                     useCustomRange = true;
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/GlobalControls.java b/src/demo/share/jfc/J2Ddemo/java2d/GlobalControls.java
index 6432e3e..4a75387 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/GlobalControls.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/GlobalControls.java
@@ -63,7 +63,7 @@
         "USHORT_x555_RGB", "BYTE_GRAY", "USHORT_GRAY",
         "BYTE_BINARY", "BYTE_INDEXED", "BYTE_BINARY 2 bit", "BYTE_BINARY 4 bit",
         "INT_RGBx", "USHORT_555x_RGB" };
-    public final JComboBox screenCombo;
+    public final JComboBox<String> screenCombo;
     public TextureChooser texturechooser;
     public JCheckBox aliasCB, renderCB, toolBarCB;
     public JCheckBox compositeCB, textureCB;
@@ -83,7 +83,7 @@
         textureCB = createCheckBox("Texture", false, 2);
         compositeCB = createCheckBox("AlphaComposite", false, 3);
 
-        screenCombo = new JComboBox();
+        screenCombo = new JComboBox<>();
         screenCombo.setPreferredSize(new Dimension(120, 18));
         screenCombo.setLightWeightPopupEnabled(true);
         screenCombo.setFont(font);
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/Tools.java b/src/demo/share/jfc/J2Ddemo/java2d/Tools.java
index 8f4dff7..62a6009 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/Tools.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/Tools.java
@@ -94,7 +94,7 @@
     protected boolean focus;
     public JToggleButton toggleB;
     public JButton printB;
-    public JComboBox screenCombo;
+    public JComboBox<String> screenCombo;
     public JToggleButton renderB, aliasB;
     public JToggleButton textureB, compositeB;
     public JButton startStopB;
@@ -167,7 +167,7 @@
             toolbar.setPreferredSize(new Dimension(6*25, 26));
         }
 
-        screenCombo = new JComboBox();
+        screenCombo = new JComboBox<>();
         screenCombo.setPreferredSize(new Dimension(100, 18));
         screenCombo.setFont(font);
         for (String name : GlobalControls.screenNames) {
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Clipping/Areas.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Clipping/Areas.java
index 80ec808..4023d2c 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Clipping/Areas.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Clipping/Areas.java
@@ -151,7 +151,6 @@
 
         Areas demo;
         JToolBar toolbar;
-        JComboBox combo;
 
         public DemoControls(Areas demo) {
             super(demo.name);
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Images/ImageOps.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Images/ImageOps.java
index 69ac8e0..95dfdd3 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Images/ImageOps.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Images/ImageOps.java
@@ -188,20 +188,20 @@
     static class DemoControls extends CustomControls implements ActionListener {
 
         ImageOps demo;
-        JComboBox imgCombo, opsCombo;
+        JComboBox<String> imgCombo, opsCombo;
         Font font = new Font(Font.SERIF, Font.PLAIN, 10);
 
         @SuppressWarnings("LeakingThisInConstructor")
         public DemoControls(ImageOps demo) {
             super(demo.name);
             this.demo = demo;
-            add(imgCombo = new JComboBox());
+            add(imgCombo = new JComboBox<>());
             imgCombo.setFont(font);
             for (String name : ImageOps.imgName) {
                 imgCombo.addItem(name);
             }
             imgCombo.addActionListener(this);
-            add(opsCombo = new JComboBox());
+            add(opsCombo = new JComboBox<>());
             opsCombo.setFont(font);
             for (String name : ImageOps.opsName) {
                 opsCombo.addItem(name);
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/Balls.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/Balls.java
index 84d0c08..799d02a 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/Balls.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/Balls.java
@@ -71,7 +71,7 @@
     private boolean active;
     protected Ball[] balls = new Ball[colors.length];
     protected boolean clearToggle;
-    protected JComboBox combo;
+    protected JComboBox<String> combo;
 
     public Balls() {
         setBackground(WHITE);
@@ -279,7 +279,7 @@
             addTool("B", demo.balls[4].isSelected);
             addTool("I", demo.balls[5].isSelected);
             addTool("V", demo.balls[6].isSelected);
-            add(combo = new JComboBox());
+            add(combo = new JComboBox<>());
             combo.addItem("10");
             combo.addItem("20");
             combo.addItem("30");
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/BezierScroller.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/BezierScroller.java
index 3e9e4ed..e361653 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/BezierScroller.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Mix/BezierScroller.java
@@ -60,7 +60,6 @@
 import java2d.AnimatingControlsSurface;
 import java2d.CustomControls;
 import javax.swing.AbstractButton;
-import javax.swing.JComboBox;
 import javax.swing.JToggleButton;
 import javax.swing.JToolBar;
 
@@ -320,7 +319,6 @@
 
         BezierScroller demo;
         JToolBar toolbar;
-        JComboBox combo;
 
         public DemoControls(BezierScroller demo) {
             super(demo.name);
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/GradAnim.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/GradAnim.java
index dbf3ee7..3eb1725 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/GradAnim.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/GradAnim.java
@@ -266,13 +266,13 @@
     class DemoControls extends CustomControls implements ActionListener {
 
         GradAnim demo;
-        JComboBox combo;
+        JComboBox<String> combo;
 
         @SuppressWarnings("LeakingThisInConstructor")
         public DemoControls(GradAnim demo) {
             super(demo.name);
             this.demo = demo;
-            combo = new JComboBox();
+            combo = new JComboBox<>();
             combo.addActionListener(this);
             combo.addItem("2-color GradientPaint");
             combo.addItem("3-color LinearGradientPaint");
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/TextureAnim.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/TextureAnim.java
index 6e97e20..304ccfe 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/TextureAnim.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Paint/TextureAnim.java
@@ -299,7 +299,7 @@
 
         TextureAnim demo;
         JToolBar toolbar;
-        JComboBox combo;
+        JComboBox<String> combo;
         JMenu menu;
         JMenuItem[] menuitems;
         int iconSize = 20;
@@ -318,7 +318,7 @@
             addTool("RO", "rotate", false);
             addTool("SX", "shear x", false);
             addTool("SY", "shear y", false);
-            add(combo = new JComboBox());
+            add(combo = new JComboBox<>());
             combo.addActionListener(this);
             combo.addItem("8");
             combo.addItem("16");
diff --git a/src/demo/share/jfc/Metalworks/MetalworksPrefs.java b/src/demo/share/jfc/Metalworks/MetalworksPrefs.java
index 36626ee..063a549 100644
--- a/src/demo/share/jfc/Metalworks/MetalworksPrefs.java
+++ b/src/demo/share/jfc/Metalworks/MetalworksPrefs.java
@@ -162,7 +162,7 @@
 
         JPanel protoPanel = new JPanel();
         JLabel protoLabel = new JLabel("Protocol");
-        JComboBox protocol = new JComboBox();
+        JComboBox<String> protocol = new JComboBox<>();
         protocol.addItem("SMTP");
         protocol.addItem("IMAP");
         protocol.addItem("Other...");
@@ -171,7 +171,7 @@
 
         JPanel attachmentPanel = new JPanel();
         JLabel attachmentLabel = new JLabel("Attachments");
-        JComboBox attach = new JComboBox();
+        JComboBox<String> attach = new JComboBox<>();
         attach.addItem("Download Always");
         attach.addItem("Ask size > 1 Meg");
         attach.addItem("Ask size > 5 Meg");
diff --git a/src/demo/share/jfc/Notepad/ElementTreePanel.java b/src/demo/share/jfc/Notepad/ElementTreePanel.java
index e1bac63..114c0a0 100644
--- a/src/demo/share/jfc/Notepad/ElementTreePanel.java
+++ b/src/demo/share/jfc/Notepad/ElementTreePanel.java
@@ -115,7 +115,7 @@
 
                 if (as != null) {
                     StringBuilder retBuffer = new StringBuilder("[");
-                    Enumeration names = as.getAttributeNames();
+                    Enumeration<?> names = as.getAttributeNames();
 
                     while (names.hasMoreElements()) {
                         Object nextName = names.nextElement();
diff --git a/src/demo/share/jfc/Stylepad/Stylepad.java b/src/demo/share/jfc/Stylepad/Stylepad.java
index 872e0a4..6468757 100644
--- a/src/demo/share/jfc/Stylepad/Stylepad.java
+++ b/src/demo/share/jfc/Stylepad/Stylepad.java
@@ -255,8 +255,8 @@
         w.loadDocument();
     }
 
-    JComboBox createFamilyChoices() {
-        JComboBox b = new JComboBox();
+    JComboBox<String> createFamilyChoices() {
+        JComboBox<String> b = new JComboBox<>();
         String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().
                 getAvailableFontFamilyNames();
         for (String fontName : fontNames) {
diff --git a/src/demo/share/jfc/SwingSet2/ButtonDemo.java b/src/demo/share/jfc/SwingSet2/ButtonDemo.java
index 0ba9574..c5e8c7a 100644
--- a/src/demo/share/jfc/SwingSet2/ButtonDemo.java
+++ b/src/demo/share/jfc/SwingSet2/ButtonDemo.java
@@ -61,12 +61,12 @@
     JPanel radioButtonPanel = new JPanel();
     JPanel toggleButtonPanel = new JPanel();
 
-    Vector buttons = new Vector();
-    Vector checkboxes = new Vector();
-    Vector radiobuttons = new Vector();
-    Vector togglebuttons = new Vector();
+    Vector<Component> buttons = new Vector<>();
+    Vector<Component> checkboxes = new Vector<>();
+    Vector<Component> radiobuttons = new Vector<>();
+    Vector<Component> togglebuttons = new Vector<>();
 
-    Vector currentControls = buttons;
+    Vector<Component> currentControls = buttons;
 
     JButton button;
     JCheckBox check;
@@ -466,12 +466,12 @@
                     String command = cb.getActionCommand();
                     if(command == "Enabled") {
                         for(int i = 0; i < currentControls.size(); i++) {
-                            c = (Component) currentControls.elementAt(i);
+                            c = currentControls.elementAt(i);
                             c.setEnabled(cb.isSelected());
                             c.invalidate();
                         }
                     } else if(command == "PaintBorder") {
-                        c = (Component) currentControls.elementAt(0);
+                        c = currentControls.elementAt(0);
                         if(c instanceof AbstractButton) {
                             for(int i = 0; i < currentControls.size(); i++) {
                                 b = (AbstractButton) currentControls.elementAt(i);
@@ -480,7 +480,7 @@
                             }
                         }
                     } else if(command == "PaintFocus") {
-                        c = (Component) currentControls.elementAt(0);
+                        c = currentControls.elementAt(0);
                         if(c instanceof AbstractButton) {
                             for(int i = 0; i < currentControls.size(); i++) {
                                 b = (AbstractButton) currentControls.elementAt(i);
@@ -489,7 +489,7 @@
                             }
                         }
                     } else if(command == "ContentFilled") {
-                        c = (Component) currentControls.elementAt(0);
+                        c = currentControls.elementAt(0);
                         if(c instanceof AbstractButton) {
                             for(int i = 0; i < currentControls.size(); i++) {
                                 b = (AbstractButton) currentControls.elementAt(i);
@@ -549,7 +549,7 @@
         }
     }
 
-    public Vector getCurrentControls() {
+    public Vector<Component> getCurrentControls() {
         return currentControls;
     }
 }
diff --git a/src/demo/share/jfc/SwingSet2/ComboBoxDemo.java b/src/demo/share/jfc/SwingSet2/ComboBoxDemo.java
index faed889..c2fe267 100644
--- a/src/demo/share/jfc/SwingSet2/ComboBoxDemo.java
+++ b/src/demo/share/jfc/SwingSet2/ComboBoxDemo.java
@@ -57,13 +57,13 @@
     Face face;
     JLabel faceLabel;
 
-    JComboBox hairCB;
-    JComboBox eyesCB;
-    JComboBox mouthCB;
+    JComboBox<?> hairCB;
+    JComboBox<?> eyesCB;
+    JComboBox<?> mouthCB;
 
-    JComboBox presetCB;
+    JComboBox<?> presetCB;
 
-    Hashtable parts = new Hashtable();
+    Hashtable<String, Object> parts = new Hashtable<>();
 
     /**
      * main method allows us to run as a standalone demo.
@@ -111,28 +111,28 @@
 
         JLabel l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.presets")));
         l.setAlignmentX(JLabel.LEFT_ALIGNMENT);
-        presetCB = (JComboBox) comboBoxPanel.add(createPresetComboBox());
+        presetCB = (JComboBox<?>) comboBoxPanel.add(createPresetComboBox());
         presetCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT);
         l.setLabelFor(presetCB);
         comboBoxPanel.add(Box.createRigidArea(VGAP30));
 
         l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.hair_description")));
         l.setAlignmentX(JLabel.LEFT_ALIGNMENT);
-        hairCB = (JComboBox) comboBoxPanel.add(createHairComboBox());
+        hairCB = (JComboBox<?>) comboBoxPanel.add(createHairComboBox());
         hairCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT);
         l.setLabelFor(hairCB);
         comboBoxPanel.add(Box.createRigidArea(VGAP15));
 
         l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.eyes_description")));
         l.setAlignmentX(JLabel.LEFT_ALIGNMENT);
-        eyesCB = (JComboBox) comboBoxPanel.add(createEyesComboBox());
+        eyesCB = (JComboBox<?>) comboBoxPanel.add(createEyesComboBox());
         eyesCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT);
         l.setLabelFor(eyesCB);
         comboBoxPanel.add(Box.createRigidArea(VGAP15));
 
         l = (JLabel) comboBoxPanel.add(new JLabel(getString("ComboBoxDemo.mouth_description")));
         l.setAlignmentX(JLabel.LEFT_ALIGNMENT);
-        mouthCB = (JComboBox) comboBoxPanel.add(createMouthComboBox());
+        mouthCB = (JComboBox<?>) comboBoxPanel.add(createMouthComboBox());
         mouthCB.setAlignmentX(JComboBox.LEFT_ALIGNMENT);
         l.setLabelFor(mouthCB);
         comboBoxPanel.add(Box.createRigidArea(VGAP15));
@@ -217,36 +217,36 @@
         return face;
     }
 
-    JComboBox createHairComboBox() {
-        JComboBox cb = new JComboBox();
+    JComboBox<String> createHairComboBox() {
+        JComboBox<String> cb = new JComboBox<>();
         fillComboBox(cb);
         cb.addActionListener(this);
         return cb;
     }
 
-    JComboBox createEyesComboBox() {
-        JComboBox cb = new JComboBox();
+    JComboBox<String> createEyesComboBox() {
+        JComboBox<String> cb = new JComboBox<>();
         fillComboBox(cb);
         cb.addActionListener(this);
         return cb;
     }
 
-    JComboBox createNoseComboBox() {
-        JComboBox cb = new JComboBox();
+    JComboBox<String> createNoseComboBox() {
+        JComboBox<String> cb = new JComboBox<>();
         fillComboBox(cb);
         cb.addActionListener(this);
         return cb;
     }
 
-    JComboBox createMouthComboBox() {
-        JComboBox cb = new JComboBox();
+    JComboBox<String> createMouthComboBox() {
+        JComboBox<String> cb = new JComboBox<>();
         fillComboBox(cb);
         cb.addActionListener(this);
         return cb;
     }
 
-    JComboBox createPresetComboBox() {
-        JComboBox cb = new JComboBox();
+    JComboBox<String> createPresetComboBox() {
+        JComboBox<String> cb = new JComboBox<>();
         cb.addItem(getString("ComboBoxDemo.preset1"));
         cb.addItem(getString("ComboBoxDemo.preset2"));
         cb.addItem(getString("ComboBoxDemo.preset3"));
@@ -261,7 +261,7 @@
         return cb;
     }
 
-    void fillComboBox(JComboBox cb) {
+    void fillComboBox(JComboBox<String> cb) {
         cb.addItem(getString("ComboBoxDemo.brent"));
         cb.addItem(getString("ComboBoxDemo.georges"));
         cb.addItem(getString("ComboBoxDemo.hans"));
@@ -279,15 +279,15 @@
 
     public void actionPerformed(ActionEvent e) {
         if(e.getSource() == hairCB) {
-            String name = (String) parts.get((String) hairCB.getSelectedItem());
+            String name = (String) parts.get(hairCB.getSelectedItem());
             face.setHair((ImageIcon) parts.get(name + "hair"));
             faceLabel.repaint();
         } else if(e.getSource() == eyesCB) {
-            String name = (String) parts.get((String) eyesCB.getSelectedItem());
+            String name = (String) parts.get(eyesCB.getSelectedItem());
             face.setEyes((ImageIcon) parts.get(name + "eyes"));
             faceLabel.repaint();
         } else if(e.getSource() == mouthCB) {
-            String name = (String) parts.get((String) mouthCB.getSelectedItem());
+            String name = (String) parts.get(mouthCB.getSelectedItem());
             face.setMouth((ImageIcon) parts.get(name + "mouth"));
             faceLabel.repaint();
         } else if(e.getSource() == presetCB) {
diff --git a/src/demo/share/jfc/SwingSet2/DirectionPanel.java b/src/demo/share/jfc/SwingSet2/DirectionPanel.java
index 1411aaf..9a18f64 100644
--- a/src/demo/share/jfc/SwingSet2/DirectionPanel.java
+++ b/src/demo/share/jfc/SwingSet2/DirectionPanel.java
@@ -92,9 +92,9 @@
     }
 
     public void setSelection( String selection  ) {
-        Enumeration e = group.getElements();
+        Enumeration<AbstractButton> e = group.getElements();
         while( e.hasMoreElements() ) {
-            JRadioButton b = (JRadioButton)e.nextElement();
+        	AbstractButton b = e.nextElement();
             if( b.getActionCommand().equals(selection) ) {
                b.setSelected(true);
             }
diff --git a/src/demo/share/jfc/SwingSet2/ExampleFileView.java b/src/demo/share/jfc/SwingSet2/ExampleFileView.java
index 9e66705..7090c67 100644
--- a/src/demo/share/jfc/SwingSet2/ExampleFileView.java
+++ b/src/demo/share/jfc/SwingSet2/ExampleFileView.java
@@ -59,9 +59,9 @@
  * @author Jeff Dinkins
  */
 public class ExampleFileView extends FileView {
-    private Hashtable icons = new Hashtable(5);
-    private Hashtable fileDescriptions = new Hashtable(5);
-    private Hashtable typeDescriptions = new Hashtable(5);
+    private Hashtable<String, Icon> icons = new Hashtable<>(5);
+    private Hashtable<File, String> fileDescriptions = new Hashtable<>(5);
+    private Hashtable<String, String> typeDescriptions = new Hashtable<>(5);
 
     /**
      * The name of the file.  Do nothing special here. Let
@@ -85,7 +85,7 @@
      * @see FileView#getDescription
      */
     public String getDescription(File f) {
-        return (String) fileDescriptions.get(f);
+        return fileDescriptions.get(f);
     };
 
     /**
@@ -111,7 +111,7 @@
      * @see FileView#getTypeDescription
      */
     public String getTypeDescription(File f) {
-        return (String) typeDescriptions.get(getExtension(f));
+        return typeDescriptions.get(getExtension(f));
     }
 
     /**
@@ -149,7 +149,7 @@
         Icon icon = null;
         String extension = getExtension(f);
         if(extension != null) {
-            icon = (Icon) icons.get(extension);
+            icon = icons.get(extension);
         }
         return icon;
     }
diff --git a/src/demo/share/jfc/SwingSet2/LayoutControlPanel.java b/src/demo/share/jfc/SwingSet2/LayoutControlPanel.java
index b6d4ff9..d3794d6 100644
--- a/src/demo/share/jfc/SwingSet2/LayoutControlPanel.java
+++ b/src/demo/share/jfc/SwingSet2/LayoutControlPanel.java
@@ -104,7 +104,7 @@
         // Make sure the controls' text position and label alignment match
         // the initial value of the associated direction panel.
         for(int i = 0; i < demo.getCurrentControls().size(); i++) {
-            Component c = (Component) demo.getCurrentControls().elementAt(i);
+            Component c = demo.getCurrentControls().elementAt(i);
             setPosition(c, RIGHT, CENTER);
             setAlignment(c,CENTER,CENTER);
         }
@@ -173,7 +173,7 @@
             }
 
             for(int i = 0; i < demo.getCurrentControls().size(); i++) {
-                Component c = (Component) demo.getCurrentControls().elementAt(i);
+                Component c = demo.getCurrentControls().elementAt(i);
                 int hPos, vPos, hAlign, vAlign;
                 if( c instanceof AbstractButton ) {
                    hPos = ((AbstractButton)c).getHorizontalTextPosition();
@@ -228,7 +228,7 @@
                     hPos = RIGHT; vPos = BOTTOM;
             }
             for(int i = 0; i < demo.getCurrentControls().size(); i++) {
-                Component c = (Component) demo.getCurrentControls().elementAt(i);
+                Component c = demo.getCurrentControls().elementAt(i);
                 setPosition(c, hPos, vPos);
             }
             demo.invalidate();
@@ -267,7 +267,7 @@
                     hPos = RIGHT; vPos = BOTTOM;
             }
             for(int i = 0; i < demo.getCurrentControls().size(); i++) {
-                Component c = (Component) demo.getCurrentControls().elementAt(i);
+                Component c = demo.getCurrentControls().elementAt(i);
                 setAlignment(c,hPos,vPos);
                 c.invalidate();
             }
diff --git a/src/demo/share/jfc/SwingSet2/ListDemo.java b/src/demo/share/jfc/SwingSet2/ListDemo.java
index 2e4d2e1..0352bc3 100644
--- a/src/demo/share/jfc/SwingSet2/ListDemo.java
+++ b/src/demo/share/jfc/SwingSet2/ListDemo.java
@@ -59,7 +59,7 @@
  * @author Jeff Dinkins
  */
 public class ListDemo extends DemoModule {
-    JList list;
+    JList<String> list;
 
     JPanel prefixList;
     JPanel suffixList;
@@ -69,7 +69,7 @@
 
     GeneratedListModel listModel;
 
-    Vector checkboxes = new Vector();
+    Vector<JCheckBox> checkboxes = new Vector<>();
 
     /**
      * main method allows us to run as a standalone demo.
@@ -103,7 +103,7 @@
         centerPanel.add(Box.createRigidArea(HGAP30));
 
         // Create the list
-        list = new JList();
+        list = new JList<>();
         list.setCellRenderer(new CompanyLogoListCellRenderer());
         listModel = new GeneratedListModel(this);
         list.setModel(listModel);
@@ -293,12 +293,12 @@
     }
 
 
-    class GeneratedListModel extends AbstractListModel {
+    class GeneratedListModel extends AbstractListModel<String> {
         ListDemo demo;
         Permuter permuter;
 
-        public Vector prefix = new Vector();
-        public Vector suffix = new Vector();
+        public Vector<String> prefix = new Vector<>();
+        public Vector<String> suffix = new Vector<>();
 
         public GeneratedListModel (ListDemo demo) {
             this.demo = demo;
@@ -337,7 +337,7 @@
             return prefix.size() * suffix.size();
         }
 
-        public Object getElementAt(int index) {
+        public String getElementAt(int index) {
             if(permuter == null) {
                 update();
             }
@@ -363,7 +363,7 @@
 
     class CompanyLogoListCellRenderer extends DefaultListCellRenderer {
        public Component getListCellRendererComponent(
-            JList list,
+            JList<?> list,
             Object value,
             int index,
             boolean isSelected,
diff --git a/src/demo/share/jfc/SwingSet2/OptionPaneDemo.java b/src/demo/share/jfc/SwingSet2/OptionPaneDemo.java
index da8c145..c60d4b8 100644
--- a/src/demo/share/jfc/SwingSet2/OptionPaneDemo.java
+++ b/src/demo/share/jfc/SwingSet2/OptionPaneDemo.java
@@ -163,7 +163,7 @@
                 message[0] = getString("OptionPaneDemo.componentmessage");
                 message[1] = new JTextField(getString("OptionPaneDemo.componenttextfield"));
 
-                JComboBox cb = new JComboBox();
+                JComboBox<String> cb = new JComboBox<>();
                 cb.addItem(getString("OptionPaneDemo.component_cb1"));
                 cb.addItem(getString("OptionPaneDemo.component_cb2"));
                 cb.addItem(getString("OptionPaneDemo.component_cb3"));
diff --git a/src/demo/share/jfc/SwingSet2/SliderDemo.java b/src/demo/share/jfc/SwingSet2/SliderDemo.java
index fe4061f..15bd7c4 100644
--- a/src/demo/share/jfc/SwingSet2/SliderDemo.java
+++ b/src/demo/share/jfc/SwingSet2/SliderDemo.java
@@ -164,7 +164,9 @@
         s.setPaintLabels( true );
         s.setSnapToTicks( true );
 
-        s.getLabelTable().put(new Integer(11), new JLabel(new Integer(11).toString(), JLabel.CENTER));
+        @SuppressWarnings("unchecked")
+		Dictionary<Object, Object> labelTable = s.getLabelTable();
+        labelTable.put(new Integer(11), new JLabel(new Integer(11).toString(), JLabel.CENTER));
         s.setLabelTable( s.getLabelTable() );
 
         s.getAccessibleContext().setAccessibleName(getString("SliderDemo.minorticks"));
diff --git a/src/demo/share/jfc/SwingSet2/SwingSet2.java b/src/demo/share/jfc/SwingSet2/SwingSet2.java
index 8f421b0..6a710b1 100644
--- a/src/demo/share/jfc/SwingSet2/SwingSet2.java
+++ b/src/demo/share/jfc/SwingSet2/SwingSet2.java
@@ -703,8 +703,8 @@
         setStatus(getString("Status.loading") + getString(classname + ".name"));
         DemoModule demo = null;
         try {
-            Class demoClass = Class.forName(classname);
-            Constructor demoConstructor = demoClass.getConstructor(new Class[]{SwingSet2.class});
+            Class<?> demoClass = Class.forName(classname);
+            Constructor<?> demoConstructor = demoClass.getConstructor(new Class[]{SwingSet2.class});
             demo = (DemoModule) demoConstructor.newInstance(new Object[]{this});
             addDemo(demo);
         } catch (Exception e) {
diff --git a/src/demo/share/jfc/SwingSet2/TableDemo.java b/src/demo/share/jfc/SwingSet2/TableDemo.java
index 378f77c..130c4aa 100644
--- a/src/demo/share/jfc/SwingSet2/TableDemo.java
+++ b/src/demo/share/jfc/SwingSet2/TableDemo.java
@@ -75,8 +75,8 @@
     JSlider     interCellSpacingSlider;
     JSlider     rowHeightSlider;
 
-    JComboBox   selectionModeComboBox = null;
-    JComboBox   resizeModeComboBox = null;
+    JComboBox<String>   selectionModeComboBox = null;
+    JComboBox<String>   resizeModeComboBox = null;
 
     JLabel      headerLabel;
     JLabel      footerLabel;
@@ -126,7 +126,7 @@
         JPanel printPanel = new JPanel(new ColumnLayout());
 
         getDemoPanel().add(controlPanel, BorderLayout.NORTH);
-        Vector relatedComponents = new Vector();
+        Vector<JComponent> relatedComponents = new Vector<>();
 
 
         // check box panel
@@ -245,7 +245,7 @@
         selectMode.setBorder(new TitledBorder(getString("TableDemo.selection_mode")));
 
 
-        selectionModeComboBox = new JComboBox() {
+        selectionModeComboBox = new JComboBox<>() {
             public Dimension getMaximumSize() {
                 return getPreferredSize();
             }
@@ -256,7 +256,7 @@
         selectionModeComboBox.setSelectedIndex(tableView.getSelectionModel().getSelectionMode());
         selectionModeComboBox.addItemListener(new ItemListener() {
             public void itemStateChanged(ItemEvent e) {
-                JComboBox source = (JComboBox)e.getSource();
+                JComboBox<?> source = (JComboBox<?>)e.getSource();
                 tableView.setSelectionMode(source.getSelectedIndex());
             }
         });
@@ -272,7 +272,7 @@
         resizeMode.setBorder(new TitledBorder(getString("TableDemo.autoresize_mode")));
 
 
-        resizeModeComboBox = new JComboBox() {
+        resizeModeComboBox = new JComboBox<>() {
             public Dimension getMaximumSize() {
                 return getPreferredSize();
             }
@@ -285,7 +285,7 @@
         resizeModeComboBox.setSelectedIndex(tableView.getAutoResizeMode());
         resizeModeComboBox.addItemListener(new ItemListener() {
             public void itemStateChanged(ItemEvent e) {
-                JComboBox source = (JComboBox)e.getSource();
+                JComboBox<?> source = (JComboBox<?>)e.getSource();
                 tableView.setAutoResizeMode(source.getSelectedIndex());
             }
         });
@@ -367,7 +367,7 @@
      *
      * @param components The list of objects that are related
      */
-    void buildAccessibleGroup(Vector components) {
+    void buildAccessibleGroup(Vector<JComponent> components) {
 
         AccessibleContext context = null;
         int numComponents = components.size();
@@ -549,7 +549,7 @@
             public int getRowCount() { return data.length;}
             public Object getValueAt(int row, int col) {return data[row][col];}
             public String getColumnName(int column) {return names[column];}
-            public Class getColumnClass(int c) {return getValueAt(0, c).getClass();}
+            public Class<?> getColumnClass(int c) {return getValueAt(0, c).getClass();}
             public boolean isCellEditable(int row, int col) {return col != 5;}
             public void setValueAt(Object aValue, int row, int column) { data[row][column] = aValue; }
          };
@@ -557,7 +557,7 @@
 
         // Create the table
         tableView = new JTable(dataModel);
-        TableRowSorter sorter = new TableRowSorter(dataModel);
+        TableRowSorter<TableModel> sorter = new TableRowSorter<>(dataModel);
         tableView.setRowSorter(sorter);
 
         // Show colors by rendering them in their own color.
@@ -575,7 +575,7 @@
         };
 
         // Create a combo box to show that you can use one in a table.
-        JComboBox comboBox = new JComboBox();
+        JComboBox<NamedColor> comboBox = new JComboBox<>();
         comboBox.addItem(aqua);
         comboBox.addItem(beige);
         comboBox.addItem(black);
diff --git a/src/demo/share/jfc/TableExample/OldJTable.java b/src/demo/share/jfc/TableExample/OldJTable.java
index bc90794..8c77978 100644
--- a/src/demo/share/jfc/TableExample/OldJTable.java
+++ b/src/demo/share/jfc/TableExample/OldJTable.java
@@ -72,7 +72,7 @@
         return addColumn(columnIdentifier, width, null, null, null);
     }
 
-    public TableColumn addColumn(Object columnIdentifier, List columnData) {
+    public TableColumn addColumn(Object columnIdentifier, List<?> columnData) {
         return addColumn(columnIdentifier, -1, null, null, columnData);
     }
 
@@ -86,7 +86,7 @@
 
     public TableColumn addColumn(Object columnIdentifier, int width,
                                  TableCellRenderer renderer,
-                                 TableCellEditor editor, List columnData) {
+                                 TableCellEditor editor, List<?> columnData) {
         checkDefaultTableModel();
 
         // Set up the model side first
@@ -112,7 +112,7 @@
         ((DefaultTableModel)getModel()).addRow(rowData);
     }
 
-    public void addRow(List rowData) {
+    public void addRow(List<?> rowData) {
         checkDefaultTableModel();
         ((DefaultTableModel)getModel()).addRow(rowData.toArray());
     }
@@ -132,7 +132,7 @@
         ((DefaultTableModel)getModel()).insertRow(rowIndex, rowData);
     }
 
-    public void insertRow(int rowIndex, List rowData) {
+    public void insertRow(int rowIndex, List<?> rowData) {
         checkDefaultTableModel();
         ((DefaultTableModel)getModel()).insertRow(rowIndex, rowData.toArray());
     }
@@ -142,7 +142,7 @@
         ((DefaultTableModel)getModel()).setNumRows(newSize);
     }
 
-    public void setDataVector(Object[][] newData, List columnIds) {
+    public void setDataVector(Object[][] newData, List<?> columnIds) {
         checkDefaultTableModel();
         ((DefaultTableModel)getModel()).setDataVector(
                 newData, columnIds.toArray());
diff --git a/src/demo/share/jfc/TableExample/TableExample3.java b/src/demo/share/jfc/TableExample/TableExample3.java
index ba10101..3ab77df 100644
--- a/src/demo/share/jfc/TableExample/TableExample3.java
+++ b/src/demo/share/jfc/TableExample/TableExample3.java
@@ -121,7 +121,7 @@
             }
 
             @Override
-            public Class getColumnClass(int col) {
+            public Class<?> getColumnClass(int col) {
                 return getValueAt(0, col).getClass();
             }
 
diff --git a/src/demo/share/jfc/TableExample/TableExample4.java b/src/demo/share/jfc/TableExample/TableExample4.java
index f4132b6..053c631 100644
--- a/src/demo/share/jfc/TableExample/TableExample4.java
+++ b/src/demo/share/jfc/TableExample/TableExample4.java
@@ -123,7 +123,7 @@
             }
 
             @Override
-            public Class getColumnClass(int c) {
+            public Class<?> getColumnClass(int c) {
                 return getValueAt(0, c).getClass();
             }
 
@@ -147,7 +147,7 @@
         tableView.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 
         // Create a combo box to show that you can use one in a table.
-        JComboBox comboBox = new JComboBox();
+        JComboBox<String> comboBox = new JComboBox<>();
         comboBox.addItem("Red");
         comboBox.addItem("Orange");
         comboBox.addItem("Yellow");
diff --git a/src/demo/share/jfc/TableExample/TableMap.java b/src/demo/share/jfc/TableExample/TableMap.java
index b0c24f0..cc8954a 100644
--- a/src/demo/share/jfc/TableExample/TableMap.java
+++ b/src/demo/share/jfc/TableExample/TableMap.java
@@ -94,7 +94,7 @@
     }
 
     @Override
-    public Class getColumnClass(int aColumn) {
+    public Class<?> getColumnClass(int aColumn) {
         return model.getColumnClass(aColumn);
     }
 
diff --git a/src/demo/share/jfc/TableExample/TableSorter.java b/src/demo/share/jfc/TableExample/TableSorter.java
index 960eec1..31898db 100644
--- a/src/demo/share/jfc/TableExample/TableSorter.java
+++ b/src/demo/share/jfc/TableExample/TableSorter.java
@@ -91,7 +91,7 @@
     }
 
     public int compareRowsByColumn(int row1, int row2, int column) {
-        Class type = model.getColumnClass(column);
+        Class<?> type = model.getColumnClass(column);
         TableModel data = model;
 
         // Check for nulls
-------------- next part --------------
diff --git a/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java b/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java
index 64af243..53a8602 100644
--- a/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java
+++ b/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java
@@ -158,7 +158,7 @@
         for (UIManager.LookAndFeelInfo lafInfo : installedLafs) {
             try {
                 Class<?> lnfClass = Class.forName(lafInfo.getClassName());
-                LookAndFeel laf = (LookAndFeel) (lnfClass.newInstance());
+                LookAndFeel laf = (LookAndFeel) (lnfClass.getDeclaredConstructor().newInstance());
                 if (laf.isSupportedLookAndFeel()) {
                     String name = lafInfo.getName();
                     SupportedLaF supportedLaF = new SupportedLaF(name, laf);
diff --git a/src/demo/share/jfc/Font2DTest/Font2DTest.java b/src/demo/share/jfc/Font2DTest/Font2DTest.java
index de3b1ae..0fb8251 100644
--- a/src/demo/share/jfc/Font2DTest/Font2DTest.java
+++ b/src/demo/share/jfc/Font2DTest/Font2DTest.java
@@ -358,7 +358,7 @@
         userTextDialog.pack();
         userTextDialog.addWindowListener( new WindowAdapter() {
             public void windowClosing( WindowEvent e ) {
-                userTextDialog.hide();
+                userTextDialog.setVisible(false);
             }
         });
 
@@ -384,7 +384,7 @@
         printDialog.setResizable( false );
         printDialog.addWindowListener( new WindowAdapter() {
             public void windowClosing( WindowEvent e ) {
-                printDialog.hide();
+                printDialog.setVisible(false);
             }
         });
         printDialog.getContentPane().setLayout( new GridLayout( printModeCBs.length + 2, 1 ));
@@ -401,7 +401,7 @@
         fontInfoDialog.setResizable( false );
         fontInfoDialog.addWindowListener( new WindowAdapter() {
             public void windowClosing( WindowEvent e ) {
-                fontInfoDialog.hide();
+                fontInfoDialog.setVisible(false);
                 showFontInfoCBMI.setState( false );
             }
         });
@@ -672,9 +672,9 @@
 
         /// Set the visibility of User Text dialog
         if ( selectedText == fp.USER_TEXT )
-          userTextDialog.show();
+          userTextDialog.setVisible(true);
         else
-          userTextDialog.hide();
+          userTextDialog.setVisible(false);
         /// Change the visibility/status/availability of Print JDialog buttons
         printModeCBs[ fp.ONE_PAGE ].setSelected( true );
         if ( selectedText == fp.FILE_TEXT || selectedText == fp.USER_TEXT ) {
@@ -792,10 +792,10 @@
                             lcdContrast, userTextOpt );
             if ( showFontInfoOpt ) {
                 fireUpdateFontInfo();
-                fontInfoDialog.show();
+                fontInfoDialog.setVisible(true);
             }
             else
-              fontInfoDialog.hide();
+              fontInfoDialog.setVisible(false);
         }
         catch ( Exception ex ) {
             fireChangeStatus( "ERROR: Failed to Load Options File; See Stack Trace", true );
@@ -818,7 +818,7 @@
                 }
             });
             f.pack();
-            f.show();
+            f.setVisible(true);
         }
         catch ( Exception ex ) {
             fireChangeStatus( "ERROR: Failed to Load PNG File; See Stack Trace", true );
@@ -860,7 +860,7 @@
             else if ( itemName.equals( "Page Setup..." ))
               fp.doPageSetup();
             else if ( itemName.equals( "Print..." ))
-              printDialog.show();
+              printDialog.setVisible(true);
             else if ( itemName.equals( "Close" ))
               parent.dispose();
             else if ( itemName.equals( "Exit" ))
@@ -892,12 +892,12 @@
             if ( itemName.equals( "Print" )) {
                 for ( int i = 0; i < printModeCBs.length; i++ )
                   if ( printModeCBs[i].isSelected() ) {
-                      printDialog.hide();
+                      printDialog.setVisible(false);
                       fp.doPrint( i );
                   }
             }
             else if ( itemName.equals( "Cancel" ))
-              printDialog.hide();
+              printDialog.setVisible(false);
             /// Update button from Usert Text JDialog...
             else if ( itemName.equals( "Update" ))
               fp.setTextToDraw( fp.USER_TEXT, null,
@@ -995,10 +995,10 @@
             else if ( cbmi == showFontInfoCBMI ) {
                 if ( showFontInfoCBMI.getState() ) {
                     fireUpdateFontInfo();
-                    fontInfoDialog.show();
+                    fontInfoDialog.setVisible(true);
                 }
                 else
-                  fontInfoDialog.hide();
+                  fontInfoDialog.setVisible(false);
             }
         }
     }
@@ -1038,7 +1038,7 @@
 
         f.getContentPane().add( f2dt );
         f.pack();
-        f.show();
+        f.setVisible(true);
     }
 
     /// Inner class definitions...
diff --git a/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java b/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java
index 1292a83..40678fd 100644
--- a/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java
+++ b/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java
@@ -86,6 +86,6 @@
 
         f.getContentPane().add( f2dt );
         f.pack();
-        f.show();
+        f.setVisible(true);
     }
 }
diff --git a/src/demo/share/jfc/Font2DTest/FontPanel.java b/src/demo/share/jfc/Font2DTest/FontPanel.java
index d98ccd5..0e95d0e 100644
--- a/src/demo/share/jfc/Font2DTest/FontPanel.java
+++ b/src/demo/share/jfc/Font2DTest/FontPanel.java
@@ -392,7 +392,7 @@
         setTransformG2( g2transform ); // ABP
         setDrawMethod( method );
         setRenderingHints(AAValues.getValue(aa), FMValues.getValue(fm),
-                          new Integer(contrast));
+                          Integer.valueOf(contrast));
     }
 
     /// Writes the current screen to PNG file
@@ -1137,7 +1137,7 @@
                                   zoomAreaWidth / 2, (int) ( maxAscent * ZOOM ));
             g2.dispose();
             if ( !nowZooming )
-              zoomWindow.show();
+              zoomWindow.setVisible(true);
             /// This is sort of redundant... since there is a paint function
             /// inside zoomWindow definition that does the drawImage.
             /// (I should be able to call just repaint() here)
@@ -1176,7 +1176,7 @@
         public void mouseReleased( MouseEvent e ) {
             if ( textToUse == RANGE_TEXT || textToUse == ALL_GLYPHS ) {
                 if ( nowZooming )
-                  zoomWindow.hide();
+                  zoomWindow.setVisible(false);
                 nowZooming = false;
             }
             this.setCursor( Cursor.getDefaultCursor() );
diff --git a/src/demo/share/jfc/Font2DTest/RangeMenu.java b/src/demo/share/jfc/Font2DTest/RangeMenu.java
index 9200fb8..3e79653 100644
--- a/src/demo/share/jfc/Font2DTest/RangeMenu.java
+++ b/src/demo/share/jfc/Font2DTest/RangeMenu.java
@@ -186,7 +186,7 @@
                 if ( rangeName.equals("Custom...") ) {
                     useCustomRange = true;
                     customRangeDialog.setLocationRelativeTo(parent);
-                    customRangeDialog.show();
+                    customRangeDialog.setVisible(true);
                 }
                 else {
                   useCustomRange = false;
@@ -195,7 +195,7 @@
         }
         else if ( source instanceof JButton ) {
                 /// Since it is only "OK" button that sends any action here...
-                customRangeDialog.hide();
+                customRangeDialog.setVisible(false);
         }
     }
 
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java b/src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java
index 5da5cc8..40fa0cc 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/DemoPanel.java
@@ -64,7 +64,7 @@
         try {
             if (obj instanceof String) {
                 className = (String) obj;
-                obj = Class.forName(className).newInstance();
+                obj = Class.forName(className).getDeclaredConstructor().newInstance();
             }
             if (obj instanceof Component) {
                 add((Component) obj);
diff --git a/src/demo/share/jfc/J2Ddemo/java2d/demos/Fonts/Tree.java b/src/demo/share/jfc/J2Ddemo/java2d/demos/Fonts/Tree.java
index e60ac76..48dccf2 100644
--- a/src/demo/share/jfc/J2Ddemo/java2d/demos/Fonts/Tree.java
+++ b/src/demo/share/jfc/J2Ddemo/java2d/demos/Fonts/Tree.java
@@ -51,8 +51,8 @@
 public class Tree extends AnimatingSurface {
 
     private char theC = 'A';
-    private Character theT = new Character(theC);
-    private Character theR = new Character((char) (theC + 1));
+    private Character theT = Character.valueOf(theC);
+    private Character theR = Character.valueOf((char) (theC + 1));
 
     public Tree() {
         setBackground(WHITE);
@@ -65,9 +65,9 @@
     @Override
     public void step(int w, int h) {
         setSleepAmount(4000);
-        theT = new Character(theC = ((char) (theC + 1)));
-        theR = new Character((char) (theC + 1));
-        if (theR.compareTo(new Character('z')) == 0) {
+        theT = Character.valueOf(theC = ((char) (theC + 1)));
+        theR = Character.valueOf((char) (theC + 1));
+        if (theR.compareTo(Character.valueOf('z')) == 0) {
             theC = 'A';
         }
     }
diff --git a/src/demo/share/jfc/SwingSet2/ColorChooserDemo.java b/src/demo/share/jfc/SwingSet2/ColorChooserDemo.java
index 2a4b731..d87c108 100644
--- a/src/demo/share/jfc/SwingSet2/ColorChooserDemo.java
+++ b/src/demo/share/jfc/SwingSet2/ColorChooserDemo.java
@@ -128,7 +128,7 @@
                                                             okListener,
                                                             null);
 
-                dialog.show();
+                dialog.setVisible(true);
 
                 if(e.getSource() == outerColorButton) {
                     bezAnim.setOuterColor(chosen);
diff --git a/src/demo/share/jfc/SwingSet2/DemoModule.java b/src/demo/share/jfc/SwingSet2/DemoModule.java
index 8fb6042..a080f58 100644
--- a/src/demo/share/jfc/SwingSet2/DemoModule.java
+++ b/src/demo/share/jfc/SwingSet2/DemoModule.java
@@ -190,7 +190,7 @@
         frame.getContentPane().add(getDemoPanel(), BorderLayout.CENTER);
         getDemoPanel().setPreferredSize(new Dimension(PREFERRED_WIDTH, PREFERRED_HEIGHT));
         frame.pack();
-        frame.show();
+        frame.setVisible(true);
     }
 
     public JPanel createHorizontalPanel(boolean threeD) {
diff --git a/src/demo/share/jfc/SwingSet2/DirectionPanel.java b/src/demo/share/jfc/SwingSet2/DirectionPanel.java
index 9a18f64..4906590 100644
--- a/src/demo/share/jfc/SwingSet2/DirectionPanel.java
+++ b/src/demo/share/jfc/SwingSet2/DirectionPanel.java
@@ -147,10 +147,7 @@
             getAccessibleContext().setAccessibleName(direction);
             getAccessibleContext().setAccessibleDescription(description);
             setSelected(selected);
-        }
-
-        public boolean isFocusTraversable() {
-            return false;
+            setFocusable(false);
         }
 
         public void setBorder(Border b) {
diff --git a/src/demo/share/jfc/SwingSet2/FileChooserDemo.java b/src/demo/share/jfc/SwingSet2/FileChooserDemo.java
index 297e5cb..f851000 100644
--- a/src/demo/share/jfc/SwingSet2/FileChooserDemo.java
+++ b/src/demo/share/jfc/SwingSet2/FileChooserDemo.java
@@ -273,7 +273,7 @@
                 dialog.getContentPane().add(custom, BorderLayout.CENTER);
                 dialog.pack();
                 dialog.setLocationRelativeTo(getDemoPanel());
-                dialog.show();
+                dialog.setVisible(true);
             }
         };
         return createButton(a);
diff --git a/src/demo/share/jfc/SwingSet2/InternalFrameDemo.java b/src/demo/share/jfc/SwingSet2/InternalFrameDemo.java
index b9c5959..a02ec0b 100644
--- a/src/demo/share/jfc/SwingSet2/InternalFrameDemo.java
+++ b/src/demo/share/jfc/SwingSet2/InternalFrameDemo.java
@@ -59,9 +59,9 @@
     ImageIcon icon1, icon2, icon3, icon4;
     ImageIcon smIcon1, smIcon2, smIcon3, smIcon4;
 
-    public Integer FIRST_FRAME_LAYER  = new Integer(1);
-    public Integer DEMO_FRAME_LAYER   = new Integer(2);
-    public Integer PALETTE_LAYER     = new Integer(3);
+    public Integer FIRST_FRAME_LAYER  = Integer.valueOf(1);
+    public Integer DEMO_FRAME_LAYER   = Integer.valueOf(2);
+    public Integer PALETTE_LAYER     = Integer.valueOf(3);
 
     public int FRAME0_X        = 15;
     public int FRAME0_Y        = 280;
diff --git a/src/demo/share/jfc/SwingSet2/SliderDemo.java b/src/demo/share/jfc/SwingSet2/SliderDemo.java
index 15bd7c4..989fdaf 100644
--- a/src/demo/share/jfc/SwingSet2/SliderDemo.java
+++ b/src/demo/share/jfc/SwingSet2/SliderDemo.java
@@ -166,7 +166,7 @@
 
         @SuppressWarnings("unchecked")
 		Dictionary<Object, Object> labelTable = s.getLabelTable();
-        labelTable.put(new Integer(11), new JLabel(new Integer(11).toString(), JLabel.CENTER));
+        labelTable.put(Integer.valueOf(11), new JLabel(Integer.valueOf(11).toString(), JLabel.CENTER));
         s.setLabelTable( s.getLabelTable() );
 
         s.getAccessibleContext().setAccessibleName(getString("SliderDemo.minorticks"));
diff --git a/src/demo/share/jfc/SwingSet2/SplitPaneDemo.java b/src/demo/share/jfc/SwingSet2/SplitPaneDemo.java
index 9e92211..fba1a76 100644
--- a/src/demo/share/jfc/SwingSet2/SplitPaneDemo.java
+++ b/src/demo/share/jfc/SwingSet2/SplitPaneDemo.java
@@ -165,7 +165,7 @@
         JLabel                   label;
 
         divSize = new JTextField();
-        divSize.setText(new Integer(splitPane.getDividerSize()).toString());
+        divSize.setText(Integer.valueOf(splitPane.getDividerSize()).toString());
         divSize.setColumns(5);
         divSize.getAccessibleContext().setAccessibleName(getString("SplitPaneDemo.divider_size"));
         divSize.addActionListener(new ActionListener() {
diff --git a/src/demo/share/jfc/SwingSet2/SwingSet2.java b/src/demo/share/jfc/SwingSet2/SwingSet2.java
index 6a710b1..f553a7e 100644
--- a/src/demo/share/jfc/SwingSet2/SwingSet2.java
+++ b/src/demo/share/jfc/SwingSet2/SwingSet2.java
@@ -578,7 +578,7 @@
 
         // register key binding to activate popup menu
         InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
-        map.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, InputEvent.SHIFT_MASK),
+        map.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, InputEvent.SHIFT_DOWN_MASK),
                 "postMenuAction");
         map.put(KeyStroke.getKeyStroke(KeyEvent.VK_CONTEXT_MENU, 0), "postMenuAction");
         getActionMap().put("postMenuAction", new ActivatePopupMenuAction(this, popup));
@@ -686,7 +686,7 @@
                     screenInsets.top : centerHeight;
 
             f.setLocation(centerWidth, centerHeight);
-            f.show();
+            f.setVisible(true);
             numSSs++;
             swingSets.add(this);
         }
@@ -1213,7 +1213,7 @@
             } else {
                 aboutBox.setLocationRelativeTo(getFrame());
             }
-            aboutBox.show();
+            aboutBox.setVisible(true);
         }
     }
 
diff --git a/src/demo/share/jfc/SwingSet2/TableDemo.java b/src/demo/share/jfc/SwingSet2/TableDemo.java
index 130c4aa..48199c5 100644
--- a/src/demo/share/jfc/SwingSet2/TableDemo.java
+++ b/src/demo/share/jfc/SwingSet2/TableDemo.java
@@ -492,55 +492,55 @@
 
         // Create the dummy data (a few rows of names)
         final Object[][] data = {
-          {"Mike", "Albers",      green,       getString("TableDemo.brazil"), new Double(44.0), strawberry},
-          {"Mark", "Andrews",     blue,        getString("TableDemo.curse"), new Double(3), grapes},
-          {"Brian", "Beck",       black,       getString("TableDemo.bluesbros"), new Double(2.7182818285), raspberry},
-          {"Lara", "Bunni",       red,         getString("TableDemo.airplane"), new Double(15), strawberry},
-          {"Roger", "Brinkley",   blue,        getString("TableDemo.man"), new Double(13), peach},
-          {"Brent", "Christian",  black,       getString("TableDemo.bladerunner"), new Double(23), broccoli},
-          {"Mark", "Davidson",    darkgreen,   getString("TableDemo.brazil"), new Double(27), asparagus},
-          {"Jeff", "Dinkins",     blue,        getString("TableDemo.ladyvanishes"), new Double(8), kiwi},
-          {"Ewan", "Dinkins",     yellow,      getString("TableDemo.bugs"), new Double(2), strawberry},
-          {"Amy", "Fowler",       violet,      getString("TableDemo.reservoir"), new Double(3), raspberry},
-          {"Hania", "Gajewska",   purple,      getString("TableDemo.jules"), new Double(5), raspberry},
-          {"David", "Geary",      blue,        getString("TableDemo.pulpfiction"), new Double(3), watermelon},
-//        {"James", "Gosling",    pink,        getString("TableDemo.tennis"), new Double(21), donut},
-          {"Eric", "Hawkes",      blue,        getString("TableDemo.bladerunner"), new Double(.693), pickle},
-          {"Shannon", "Hickey",   green,       getString("TableDemo.shawshank"), new Double(2), grapes},
-          {"Earl", "Johnson",     green,       getString("TableDemo.pulpfiction"), new Double(8), carrot},
-          {"Robi", "Khan",        green,       getString("TableDemo.goodfellas"), new Double(89), apple},
-          {"Robert", "Kim",       blue,        getString("TableDemo.mohicans"), new Double(655321), strawberry},
-          {"Janet", "Koenig",     turquoise,   getString("TableDemo.lonestar"), new Double(7), peach},
-          {"Jeff", "Kesselman",   blue,        getString("TableDemo.stuntman"), new Double(17), pineapple},
-          {"Onno", "Kluyt",       orange,      getString("TableDemo.oncewest"), new Double(8), broccoli},
-          {"Peter", "Korn",       sunpurple,   getString("TableDemo.musicman"), new Double(12), sparegrass},
+          {"Mike", "Albers",      green,       getString("TableDemo.brazil"), Double.valueOf(44.0), strawberry},
+          {"Mark", "Andrews",     blue,        getString("TableDemo.curse"), Double.valueOf(3), grapes},
+          {"Brian", "Beck",       black,       getString("TableDemo.bluesbros"), Double.valueOf(2.7182818285), raspberry},
+          {"Lara", "Bunni",       red,         getString("TableDemo.airplane"), Double.valueOf(15), strawberry},
+          {"Roger", "Brinkley",   blue,        getString("TableDemo.man"), Double.valueOf(13), peach},
+          {"Brent", "Christian",  black,       getString("TableDemo.bladerunner"), Double.valueOf(23), broccoli},
+          {"Mark", "Davidson",    darkgreen,   getString("TableDemo.brazil"), Double.valueOf(27), asparagus},
+          {"Jeff", "Dinkins",     blue,        getString("TableDemo.ladyvanishes"), Double.valueOf(8), kiwi},
+          {"Ewan", "Dinkins",     yellow,      getString("TableDemo.bugs"), Double.valueOf(2), strawberry},
+          {"Amy", "Fowler",       violet,      getString("TableDemo.reservoir"), Double.valueOf(3), raspberry},
+          {"Hania", "Gajewska",   purple,      getString("TableDemo.jules"), Double.valueOf(5), raspberry},
+          {"David", "Geary",      blue,        getString("TableDemo.pulpfiction"), Double.valueOf(3), watermelon},
+//        {"James", "Gosling",    pink,        getString("TableDemo.tennis"), Double.valueOf(21), donut},
+          {"Eric", "Hawkes",      blue,        getString("TableDemo.bladerunner"), Double.valueOf(.693), pickle},
+          {"Shannon", "Hickey",   green,       getString("TableDemo.shawshank"), Double.valueOf(2), grapes},
+          {"Earl", "Johnson",     green,       getString("TableDemo.pulpfiction"), Double.valueOf(8), carrot},
+          {"Robi", "Khan",        green,       getString("TableDemo.goodfellas"), Double.valueOf(89), apple},
+          {"Robert", "Kim",       blue,        getString("TableDemo.mohicans"), Double.valueOf(655321), strawberry},
+          {"Janet", "Koenig",     turquoise,   getString("TableDemo.lonestar"), Double.valueOf(7), peach},
+          {"Jeff", "Kesselman",   blue,        getString("TableDemo.stuntman"), Double.valueOf(17), pineapple},
+          {"Onno", "Kluyt",       orange,      getString("TableDemo.oncewest"), Double.valueOf(8), broccoli},
+          {"Peter", "Korn",       sunpurple,   getString("TableDemo.musicman"), Double.valueOf(12), sparegrass},
 
-          {"Rick", "Levenson",    black,       getString("TableDemo.harold"), new Double(1327), raspberry},
-          {"Brian", "Lichtenwalter", jfcblue,  getString("TableDemo.fifthelement"), new Double(22), pear},
-          {"Malini", "Minasandram", beige,     getString("TableDemo.joyluck"), new Double(9), corn},
-          {"Michael", "Martak",   green,       getString("TableDemo.city"), new Double(3), strawberry},
-          {"David", "Mendenhall", forestgreen, getString("TableDemo.schindlerslist"), new Double(7), peach},
-          {"Phil", "Milne",       suspectpink, getString("TableDemo.withnail"), new Double(3), banana},
-          {"Lynn", "Monsanto",    cybergreen,  getString("TableDemo.dasboot"), new Double(52), peach},
-          {"Hans", "Muller",      rustred,     getString("TableDemo.eraserhead"), new Double(0), pineapple},
-          {"Joshua", "Outwater",  blue,        getString("TableDemo.labyrinth"), new Double(3), pineapple},
-          {"Tim", "Prinzing",     blue,        getString("TableDemo.firstsight"), new Double(69), pepper},
-          {"Raj", "Premkumar",    jfcblue2,    getString("TableDemo.none"), new Double(7), broccoli},
-          {"Howard", "Rosen",     green,       getString("TableDemo.defending"), new Double(7), strawberry},
+          {"Rick", "Levenson",    black,       getString("TableDemo.harold"), Double.valueOf(1327), raspberry},
+          {"Brian", "Lichtenwalter", jfcblue,  getString("TableDemo.fifthelement"), Double.valueOf(22), pear},
+          {"Malini", "Minasandram", beige,     getString("TableDemo.joyluck"), Double.valueOf(9), corn},
+          {"Michael", "Martak",   green,       getString("TableDemo.city"), Double.valueOf(3), strawberry},
+          {"David", "Mendenhall", forestgreen, getString("TableDemo.schindlerslist"), Double.valueOf(7), peach},
+          {"Phil", "Milne",       suspectpink, getString("TableDemo.withnail"), Double.valueOf(3), banana},
+          {"Lynn", "Monsanto",    cybergreen,  getString("TableDemo.dasboot"), Double.valueOf(52), peach},
+          {"Hans", "Muller",      rustred,     getString("TableDemo.eraserhead"), Double.valueOf(0), pineapple},
+          {"Joshua", "Outwater",  blue,        getString("TableDemo.labyrinth"), Double.valueOf(3), pineapple},
+          {"Tim", "Prinzing",     blue,        getString("TableDemo.firstsight"), Double.valueOf(69), pepper},
+          {"Raj", "Premkumar",    jfcblue2,    getString("TableDemo.none"), Double.valueOf(7), broccoli},
+          {"Howard", "Rosen",     green,       getString("TableDemo.defending"), Double.valueOf(7), strawberry},
           {"Ray", "Ryan",         black,       getString("TableDemo.buckaroo"),
-           new Double(3.141592653589793238462643383279502884197169399375105820974944), banana},
-          {"Georges", "Saab",     aqua,        getString("TableDemo.bicycle"), new Double(290), cantaloupe},
-          {"Tom", "Santos",       blue,        getString("TableDemo.spinaltap"), new Double(241), pepper},
-          {"Rich", "Schiavi",     blue,        getString("TableDemo.repoman"), new Double(0xFF), pepper},
-          {"Nancy", "Schorr",     green,       getString("TableDemo.fifthelement"), new Double(47), watermelon},
-          {"Keith", "Sprochi",    darkgreen,   getString("TableDemo.2001"), new Double(13), watermelon},
-          {"Matt", "Tucker",      eblue,       getString("TableDemo.starwars"), new Double(2), broccoli},
-          {"Dmitri", "Trembovetski", red,      getString("TableDemo.aliens"), new Double(222), tomato},
-          {"Scott", "Violet",     violet,      getString("TableDemo.raiders"), new Double(-97), banana},
-          {"Kathy", "Walrath",    darkgreen,   getString("TableDemo.thinman"), new Double(8), pear},
-          {"Nathan", "Walrath",   black,       getString("TableDemo.chusingura"), new Double(3), grapefruit},
-          {"Steve", "Wilson",     green,       getString("TableDemo.raiders"), new Double(7), onion},
-          {"Kathleen", "Zelony",  gray,        getString("TableDemo.dog"), new Double(13), grapes}
+           Double.valueOf(3.141592653589793238462643383279502884197169399375105820974944), banana},
+          {"Georges", "Saab",     aqua,        getString("TableDemo.bicycle"), Double.valueOf(290), cantaloupe},
+          {"Tom", "Santos",       blue,        getString("TableDemo.spinaltap"), Double.valueOf(241), pepper},
+          {"Rich", "Schiavi",     blue,        getString("TableDemo.repoman"), Double.valueOf(0xFF), pepper},
+          {"Nancy", "Schorr",     green,       getString("TableDemo.fifthelement"), Double.valueOf(47), watermelon},
+          {"Keith", "Sprochi",    darkgreen,   getString("TableDemo.2001"), Double.valueOf(13), watermelon},
+          {"Matt", "Tucker",      eblue,       getString("TableDemo.starwars"), Double.valueOf(2), broccoli},
+          {"Dmitri", "Trembovetski", red,      getString("TableDemo.aliens"), Double.valueOf(222), tomato},
+          {"Scott", "Violet",     violet,      getString("TableDemo.raiders"), Double.valueOf(-97), banana},
+          {"Kathy", "Walrath",    darkgreen,   getString("TableDemo.thinman"), Double.valueOf(8), pear},
+          {"Nathan", "Walrath",   black,       getString("TableDemo.chusingura"), Double.valueOf(3), grapefruit},
+          {"Steve", "Wilson",     green,       getString("TableDemo.raiders"), Double.valueOf(7), onion},
+          {"Kathleen", "Zelony",  gray,        getString("TableDemo.dog"), Double.valueOf(13), grapes}
         };
 
         // Create a model of the data.
diff --git a/src/demo/share/jfc/TableExample/JDBCAdapter.java b/src/demo/share/jfc/TableExample/JDBCAdapter.java
index 02d0d38..31e1113 100644
--- a/src/demo/share/jfc/TableExample/JDBCAdapter.java
+++ b/src/demo/share/jfc/TableExample/JDBCAdapter.java
@@ -125,12 +125,6 @@
         connection.close();
     }
 
-    @Override
-    protected void finalize() throws Throwable {
-        close();
-        super.finalize();
-    }
-
     //////////////////////////////////////////////////////////////////////////
     //
     //             Implementation of the TableModel Interface
diff --git a/src/demo/share/jfc/TableExample/TableExample3.java b/src/demo/share/jfc/TableExample/TableExample3.java
index 3ab77df..9f3c11f 100644
--- a/src/demo/share/jfc/TableExample/TableExample3.java
+++ b/src/demo/share/jfc/TableExample/TableExample3.java
@@ -73,27 +73,27 @@
         final String[] names = { "First Name", "Last Name", "Favorite Color",
             "Favorite Number", "Vegetarian" };
         final Object[][] data = {
-            { "Mark", "Andrews", "Red", new Integer(2), Boolean.TRUE },
-            { "Tom", "Ball", "Blue", new Integer(99), Boolean.FALSE },
-            { "Alan", "Chung", "Green", new Integer(838), Boolean.FALSE },
-            { "Jeff", "Dinkins", "Turquois", new Integer(8), Boolean.TRUE },
-            { "Amy", "Fowler", "Yellow", new Integer(3), Boolean.FALSE },
-            { "Brian", "Gerhold", "Green", new Integer(0), Boolean.FALSE },
-            { "James", "Gosling", "Pink", new Integer(21), Boolean.FALSE },
-            { "David", "Karlton", "Red", new Integer(1), Boolean.FALSE },
-            { "Dave", "Kloba", "Yellow", new Integer(14), Boolean.FALSE },
-            { "Peter", "Korn", "Purple", new Integer(12), Boolean.FALSE },
-            { "Phil", "Milne", "Purple", new Integer(3), Boolean.FALSE },
-            { "Dave", "Moore", "Green", new Integer(88), Boolean.FALSE },
-            { "Hans", "Muller", "Maroon", new Integer(5), Boolean.FALSE },
-            { "Rick", "Levenson", "Blue", new Integer(2), Boolean.FALSE },
-            { "Tim", "Prinzing", "Blue", new Integer(22), Boolean.FALSE },
-            { "Chester", "Rose", "Black", new Integer(0), Boolean.FALSE },
-            { "Ray", "Ryan", "Gray", new Integer(77), Boolean.FALSE },
-            { "Georges", "Saab", "Red", new Integer(4), Boolean.FALSE },
-            { "Willie", "Walker", "Phthalo Blue", new Integer(4), Boolean.FALSE },
-            { "Kathy", "Walrath", "Blue", new Integer(8), Boolean.FALSE },
-            { "Arnaud", "Weber", "Green", new Integer(44), Boolean.FALSE }
+            { "Mark", "Andrews", "Red", Integer.valueOf(2), Boolean.TRUE },
+            { "Tom", "Ball", "Blue", Integer.valueOf(99), Boolean.FALSE },
+            { "Alan", "Chung", "Green", Integer.valueOf(838), Boolean.FALSE },
+            { "Jeff", "Dinkins", "Turquois", Integer.valueOf(8), Boolean.TRUE },
+            { "Amy", "Fowler", "Yellow", Integer.valueOf(3), Boolean.FALSE },
+            { "Brian", "Gerhold", "Green", Integer.valueOf(0), Boolean.FALSE },
+            { "James", "Gosling", "Pink", Integer.valueOf(21), Boolean.FALSE },
+            { "David", "Karlton", "Red", Integer.valueOf(1), Boolean.FALSE },
+            { "Dave", "Kloba", "Yellow", Integer.valueOf(14), Boolean.FALSE },
+            { "Peter", "Korn", "Purple", Integer.valueOf(12), Boolean.FALSE },
+            { "Phil", "Milne", "Purple", Integer.valueOf(3), Boolean.FALSE },
+            { "Dave", "Moore", "Green", Integer.valueOf(88), Boolean.FALSE },
+            { "Hans", "Muller", "Maroon", Integer.valueOf(5), Boolean.FALSE },
+            { "Rick", "Levenson", "Blue", Integer.valueOf(2), Boolean.FALSE },
+            { "Tim", "Prinzing", "Blue", Integer.valueOf(22), Boolean.FALSE },
+            { "Chester", "Rose", "Black", Integer.valueOf(0), Boolean.FALSE },
+            { "Ray", "Ryan", "Gray", Integer.valueOf(77), Boolean.FALSE },
+            { "Georges", "Saab", "Red", Integer.valueOf(4), Boolean.FALSE },
+            { "Willie", "Walker", "Phthalo Blue", Integer.valueOf(4), Boolean.FALSE },
+            { "Kathy", "Walrath", "Blue", Integer.valueOf(8), Boolean.FALSE },
+            { "Arnaud", "Weber", "Green", Integer.valueOf(44), Boolean.FALSE }
         };
 
         // Create a model of the data.
diff --git a/src/demo/share/jfc/TableExample/TableExample4.java b/src/demo/share/jfc/TableExample/TableExample4.java
index 053c631..4d81a3d 100644
--- a/src/demo/share/jfc/TableExample/TableExample4.java
+++ b/src/demo/share/jfc/TableExample/TableExample4.java
@@ -75,27 +75,27 @@
         final String[] names = { "First Name", "Last Name", "Favorite Color",
             "Favorite Number", "Vegetarian" };
         final Object[][] data = {
-            { "Mark", "Andrews", "Red", new Integer(2), Boolean.TRUE },
-            { "Tom", "Ball", "Blue", new Integer(99), Boolean.FALSE },
-            { "Alan", "Chung", "Green", new Integer(838), Boolean.FALSE },
-            { "Jeff", "Dinkins", "Turquois", new Integer(8), Boolean.TRUE },
-            { "Amy", "Fowler", "Yellow", new Integer(3), Boolean.FALSE },
-            { "Brian", "Gerhold", "Green", new Integer(0), Boolean.FALSE },
-            { "James", "Gosling", "Pink", new Integer(21), Boolean.FALSE },
-            { "David", "Karlton", "Red", new Integer(1), Boolean.FALSE },
-            { "Dave", "Kloba", "Yellow", new Integer(14), Boolean.FALSE },
-            { "Peter", "Korn", "Purple", new Integer(12), Boolean.FALSE },
-            { "Phil", "Milne", "Purple", new Integer(3), Boolean.FALSE },
-            { "Dave", "Moore", "Green", new Integer(88), Boolean.FALSE },
-            { "Hans", "Muller", "Maroon", new Integer(5), Boolean.FALSE },
-            { "Rick", "Levenson", "Blue", new Integer(2), Boolean.FALSE },
-            { "Tim", "Prinzing", "Blue", new Integer(22), Boolean.FALSE },
-            { "Chester", "Rose", "Black", new Integer(0), Boolean.FALSE },
-            { "Ray", "Ryan", "Gray", new Integer(77), Boolean.FALSE },
-            { "Georges", "Saab", "Red", new Integer(4), Boolean.FALSE },
-            { "Willie", "Walker", "Phthalo Blue", new Integer(4), Boolean.FALSE },
-            { "Kathy", "Walrath", "Blue", new Integer(8), Boolean.FALSE },
-            { "Arnaud", "Weber", "Green", new Integer(44), Boolean.FALSE }
+            { "Mark", "Andrews", "Red", Integer.valueOf(2), Boolean.TRUE },
+            { "Tom", "Ball", "Blue", Integer.valueOf(99), Boolean.FALSE },
+            { "Alan", "Chung", "Green", Integer.valueOf(838), Boolean.FALSE },
+            { "Jeff", "Dinkins", "Turquois", Integer.valueOf(8), Boolean.TRUE },
+            { "Amy", "Fowler", "Yellow", Integer.valueOf(3), Boolean.FALSE },
+            { "Brian", "Gerhold", "Green", Integer.valueOf(0), Boolean.FALSE },
+            { "James", "Gosling", "Pink", Integer.valueOf(21), Boolean.FALSE },
+            { "David", "Karlton", "Red", Integer.valueOf(1), Boolean.FALSE },
+            { "Dave", "Kloba", "Yellow", Integer.valueOf(14), Boolean.FALSE },
+            { "Peter", "Korn", "Purple", Integer.valueOf(12), Boolean.FALSE },
+            { "Phil", "Milne", "Purple", Integer.valueOf(3), Boolean.FALSE },
+            { "Dave", "Moore", "Green", Integer.valueOf(88), Boolean.FALSE },
+            { "Hans", "Muller", "Maroon", Integer.valueOf(5), Boolean.FALSE },
+            { "Rick", "Levenson", "Blue", Integer.valueOf(2), Boolean.FALSE },
+            { "Tim", "Prinzing", "Blue", Integer.valueOf(22), Boolean.FALSE },
+            { "Chester", "Rose", "Black", Integer.valueOf(0), Boolean.FALSE },
+            { "Ray", "Ryan", "Gray", Integer.valueOf(77), Boolean.FALSE },
+            { "Georges", "Saab", "Red", Integer.valueOf(4), Boolean.FALSE },
+            { "Willie", "Walker", "Phthalo Blue", Integer.valueOf(4), Boolean.FALSE },
+            { "Kathy", "Walrath", "Blue", Integer.valueOf(8), Boolean.FALSE },
+            { "Arnaud", "Weber", "Green", Integer.valueOf(44), Boolean.FALSE }
         };
 
         // Create a model of the data.
diff --git a/src/demo/share/jfc/TableExample/TableSorter.java b/src/demo/share/jfc/TableExample/TableSorter.java
index 31898db..5ca83aa 100644
--- a/src/demo/share/jfc/TableExample/TableSorter.java
+++ b/src/demo/share/jfc/TableExample/TableSorter.java
@@ -339,7 +339,7 @@
                 int column = tableView.convertColumnIndexToModel(viewColumn);
                 if (e.getClickCount() == 1 && column != -1) {
                     System.out.println("Sorting ...");
-                    int shiftPressed = e.getModifiers() & InputEvent.SHIFT_MASK;
+                    int shiftPressed = e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK;
                     boolean ascending = (shiftPressed == 0);
                     sorter.sortByColumn(column, ascending);
                 }
-------------- next part --------------
diff --git a/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java b/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java
deleted file mode 100644
index 40678fd..0000000
--- a/src/demo/share/jfc/Font2DTest/Font2DTestApplet.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   - Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   - Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- *   - Neither the name of Oracle nor the names of its
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-/*
- */
-
-import java.awt.AWTPermission;
-import java.awt.Frame;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import javax.swing.*;
-
-/**
- * Font2DTestApplet.java
- *
- * @author Shinsuke Fukuda
- * @author Ankit Patel [Conversion to Swing - 01/07/30]
- */
-
-/// Applet version of Font2DTest that wraps the actual demo
-
-public final class Font2DTestApplet extends JApplet {
-    public void init() {
-        /// Check if necessary permission is given...
-        SecurityManager security = System.getSecurityManager();
-        if ( security != null ) {
-            try {
-                security.checkPermission( new AWTPermission( "showWindowWithoutWarningBanner" ));
-            }
-            catch ( SecurityException e ) {
-                System.out.println( "NOTE: showWindowWithoutWarningBanner AWTPermission not given.\n" +
-                                    "Zoom window will contain warning banner at bottom when shown\n" );
-            }
-            try {
-                security.checkPrintJobAccess();
-            }
-            catch ( SecurityException e ) {
-                System.out.println( "NOTE: queuePrintJob RuntimePermission not given.\n" +
-                                    "Printing feature will not be available\n" );
-            }
-        }
-
-        final JFrame f = new JFrame( "Font2DTest" );
-        final Font2DTest f2dt = new Font2DTest( f, true );
-        f.addWindowListener( new WindowAdapter() {
-            public void windowClosing( WindowEvent e ) { f.dispose(); }
-        });
-
-        f.getContentPane().add( f2dt );
-        f.pack();
-        f.setVisible(true);
-    }
-}
diff --git a/src/demo/share/jfc/SwingSet2/DemoModule.java b/src/demo/share/jfc/SwingSet2/DemoModule.java
index a080f58..a726cc2 100644
--- a/src/demo/share/jfc/SwingSet2/DemoModule.java
+++ b/src/demo/share/jfc/SwingSet2/DemoModule.java
@@ -51,7 +51,7 @@
  *
  * @author Jeff Dinkins
  */
-public class DemoModule extends JApplet {
+public class DemoModule extends JFrame {
 
     // The preferred size of the demo
     private int PREFERRED_WIDTH = 680;
diff --git a/src/demo/share/jfc/SwingSet2/SwingSet2.java b/src/demo/share/jfc/SwingSet2/SwingSet2.java
index f553a7e..13b3d63 100644
--- a/src/demo/share/jfc/SwingSet2/SwingSet2.java
+++ b/src/demo/share/jfc/SwingSet2/SwingSet2.java
@@ -71,12 +71,7 @@
 
     void loadDemos() {
         for(int i = 0; i < demos.length;) {
-            if(isApplet() && demos[i].equals("FileChooserDemo")) {
-               // don't load the file chooser demo if we are
-               // an applet
-            } else {
-               loadDemo(demos[i]);
-            }
+            loadDemo(demos[i]);
             i++;
         }
     }
@@ -126,9 +121,6 @@
     // Used only if swingset is an application
     private JFrame frame = null;
 
-    // Used only if swingset is an applet
-    private SwingSet2Applet applet = null;
-
     // To debug or not to debug, that is the question
     private boolean DEBUG = true;
     private int debugCounter = 0;
@@ -151,27 +143,21 @@
 
     private boolean dragEnabled = false;
 
-    public SwingSet2(SwingSet2Applet applet) {
-        this(applet, null);
+    public SwingSet2() {
+        this(null);
     }
 
     /**
      * SwingSet2 Constructor
      */
-    public SwingSet2(SwingSet2Applet applet, GraphicsConfiguration gc) {
-
-        // Note that applet may be null if this is started as an application
-        this.applet = applet;
-
+    public SwingSet2(GraphicsConfiguration gc) {
         String lafClassName = UIManager.getLookAndFeel().getClass().getName();
         lookAndFeelData = getInstalledLookAndFeelData();
         currentLookAndFeel = Arrays.stream(lookAndFeelData)
                 .filter(laf -> lafClassName.equals(laf.className))
                 .findFirst().get();
 
-        if (!isApplet()) {
-            frame = createFrame(gc);
-        }
+        frame = createFrame(gc);
 
         // set the layout
         setLayout(new BorderLayout());
@@ -198,7 +184,7 @@
         SwingUtilities.invokeLater(() -> {
             // Create SwingSet on the default monitor
             UIManager.put("swing.boldMetal", Boolean.FALSE);
-            SwingSet2 swingset = new SwingSet2(null, GraphicsEnvironment.
+            SwingSet2 swingset = new SwingSet2(GraphicsEnvironment.
                                          getLocalGraphicsEnvironment().
                                          getDefaultScreenDevice().
                                          getDefaultConfiguration());
@@ -218,11 +204,7 @@
 
         menuBar = createMenus();
 
-    if (isApplet()) {
-        applet.setJMenuBar(menuBar);
-    } else {
         frame.setJMenuBar(menuBar);
-    }
 
         // creates popup menu accessible via keyboard
         popupMenu = createPopupMenu();
@@ -309,13 +291,11 @@
                        "FileMenu.save_as_accessible_description", null);
 
 
-        if(!isApplet()) {
-            fileMenu.addSeparator();
+        fileMenu.addSeparator();
 
-            createMenuItem(fileMenu, "FileMenu.exit_label", "FileMenu.exit_mnemonic",
-                           "FileMenu.exit_accessible_description", new ExitAction(this)
-            );
-        }
+        createMenuItem(fileMenu, "FileMenu.exit_label", "FileMenu.exit_mnemonic",
+                       "FileMenu.exit_accessible_description", new ExitAction(this)
+        );
 
         // Create these menu items for the first SwingSet only.
         if (numSSs == 0) {
@@ -431,7 +411,6 @@
 
 
         // ***** create the multiscreen menu, if we have multiple screens
-    if (!isApplet()) {
         GraphicsDevice[] screens = GraphicsEnvironment.
                                     getLocalGraphicsEnvironment().
                                     getScreenDevices();
@@ -449,7 +428,6 @@
                 createMultiscreenMenuItem(multiScreenMenu, i);
             }
         }
-    }
 
         return menuBar;
     }
@@ -659,37 +637,34 @@
 
 
     /**
-     * Bring up the SwingSet2 demo by showing the frame (only
-     * applicable if coming up as an application, not an applet);
+     * Bring up the SwingSet2 demo by showing the frame
      */
     public void showSwingSet2() {
-        if(!isApplet() && getFrame() != null) {
-            // put swingset in a frame and show it
-            JFrame f = getFrame();
-            f.setTitle(getString("Frame.title"));
-            f.getContentPane().add(this, BorderLayout.CENTER);
-            f.pack();
+        // put swingset in a frame and show it
+        JFrame f = getFrame();
+        f.setTitle(getString("Frame.title"));
+        f.getContentPane().add(this, BorderLayout.CENTER);
+        f.pack();
 
-            Rectangle screenRect = f.getGraphicsConfiguration().getBounds();
-            Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(
-                    f.getGraphicsConfiguration());
+        Rectangle screenRect = f.getGraphicsConfiguration().getBounds();
+        Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(
+                f.getGraphicsConfiguration());
 
-            // Make sure we don't place the demo off the screen.
-            int centerWidth = screenRect.width < f.getSize().width ?
-                    screenRect.x :
-                    screenRect.x + screenRect.width/2 - f.getSize().width/2;
-            int centerHeight = screenRect.height < f.getSize().height ?
-                    screenRect.y :
-                    screenRect.y + screenRect.height/2 - f.getSize().height/2;
+        // Make sure we don't place the demo off the screen.
+        int centerWidth = screenRect.width < f.getSize().width ?
+                screenRect.x :
+                screenRect.x + screenRect.width/2 - f.getSize().width/2;
+        int centerHeight = screenRect.height < f.getSize().height ?
+                screenRect.y :
+                screenRect.y + screenRect.height/2 - f.getSize().height/2;
 
-            centerHeight = centerHeight < screenInsets.top ?
-                    screenInsets.top : centerHeight;
+        centerHeight = centerHeight < screenInsets.top ?
+                screenInsets.top : centerHeight;
 
-            f.setLocation(centerWidth, centerHeight);
-            f.setVisible(true);
-            numSSs++;
-            swingSets.add(this);
-        }
+        f.setLocation(centerWidth, centerHeight);
+        f.setVisible(true);
+        numSSs++;
+        swingSets.add(this);
     }
 
     // *******************************************************
@@ -713,21 +688,6 @@
     }
 
     /**
-     * Determines if this is an applet or application
-     */
-    public boolean isApplet() {
-        return (applet != null);
-    }
-
-    /**
-     * Returns the applet instance
-     */
-    public SwingSet2Applet getApplet() {
-        return applet;
-    }
-
-
-    /**
      * Returns the frame instance
      */
     public JFrame getFrame() {
@@ -763,8 +723,6 @@
         if(contentPane == null) {
             if(getFrame() != null) {
                 contentPane = getFrame().getContentPane();
-            } else if (getApplet() != null) {
-                contentPane = getApplet().getContentPane();
             }
         }
         return contentPane;
@@ -886,15 +844,11 @@
     }
 
     private void updateThisSwingSet() {
-        if (isApplet()) {
-            SwingUtilities.updateComponentTreeUI(getApplet());
+        JFrame frame = getFrame();
+        if (frame == null) {
+            SwingUtilities.updateComponentTreeUI(this);
         } else {
-            JFrame frame = getFrame();
-            if (frame == null) {
-                SwingUtilities.updateComponentTreeUI(this);
-            } else {
-                SwingUtilities.updateComponentTreeUI(frame);
-            }
+            SwingUtilities.updateComponentTreeUI(frame);
         }
 
         SwingUtilities.updateComponentTreeUI(popupMenu);
@@ -909,12 +863,8 @@
     public void updateLookAndFeel() {
         try {
             UIManager.setLookAndFeel(currentLookAndFeel.className);
-            if (isApplet()) {
-                updateThisSwingSet();
-            } else {
-                for (SwingSet2 ss : swingSets) {
-                    ss.updateThisSwingSet();
-                }
+            for (SwingSet2 ss : swingSets) {
+                ss.updateThisSwingSet();
             }
         } catch (Exception ex) {
             System.out.println("Failed loading L&F: " + currentLookAndFeel);
@@ -1142,12 +1092,8 @@
 
         public void actionPerformed(ActionEvent e) {
             boolean dragEnabled = ((JCheckBoxMenuItem)e.getSource()).isSelected();
-            if (isApplet()) {
-                setDragEnabled(dragEnabled);
-            } else {
-                for (SwingSet2 ss : swingSets) {
-                    ss.setDragEnabled(dragEnabled);
-                }
+            for (SwingSet2 ss : swingSets) {
+                ss.setDragEnabled(dragEnabled);
             }
         }
     }
@@ -1208,11 +1154,7 @@
                 button.addActionListener(new OkAction(aboutBox));
             }
             aboutBox.pack();
-            if (isApplet()) {
-                aboutBox.setLocationRelativeTo(getApplet());
-            } else {
-                aboutBox.setLocationRelativeTo(getFrame());
-            }
+            aboutBox.setLocationRelativeTo(getFrame());
             aboutBox.setVisible(true);
         }
     }
@@ -1231,13 +1173,13 @@
                                    getScreenDevices();
             if (screen == ALL_SCREENS) {
                 for (int i = 0; i < gds.length; i++) {
-                    SwingSet2 swingset = new SwingSet2(null,
+                    SwingSet2 swingset = new SwingSet2(
                                   gds[i].getDefaultConfiguration());
                     swingset.setDragEnabled(dragEnabled);
                 }
             }
             else {
-                SwingSet2 swingset = new SwingSet2(null,
+                SwingSet2 swingset = new SwingSet2(
                              gds[screen].getDefaultConfiguration());
                 swingset.setDragEnabled(dragEnabled);
             }
diff --git a/src/demo/share/jfc/SwingSet2/SwingSet2Applet.java b/src/demo/share/jfc/SwingSet2/SwingSet2Applet.java
deleted file mode 100644
index 945d1f1..0000000
--- a/src/demo/share/jfc/SwingSet2/SwingSet2Applet.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   - Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *
- *   - Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- *   - Neither the name of Oracle nor the names of its
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
-import javax.swing.border.*;
-import javax.swing.colorchooser.*;
-import javax.swing.filechooser.*;
-import javax.accessibility.*;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-import java.util.*;
-import java.io.*;
-import java.applet.*;
-import java.net.*;
-
-/**
- *
- *
- * @author Jeff Dinkins
- */
-
-public class SwingSet2Applet extends JApplet {
-    public void init() {
-        getContentPane().setLayout(new BorderLayout());
-        getContentPane().add(new SwingSet2(this), BorderLayout.CENTER);
-    }
-
-    public URL getURL(String filename) {
-        URL codeBase = this.getCodeBase();
-        URL url = null;
-
-        try {
-            url = new URL(codeBase, filename);
-            System.out.println(url);
-        } catch (java.net.MalformedURLException e) {
-            System.out.println("Error: badly specified URL");
-            return null;
-        }
-
-        return url;
-    }
-
-
-}
-------------- next part --------------




More information about the build-dev mailing list