Skip to content

Instantly share code, notes, and snippets.

@marchof
Last active October 23, 2019 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marchof/59923f8e2ebab0768ed76ffb5315a2c7 to your computer and use it in GitHub Desktop.
Save marchof/59923f8e2ebab0768ed76ffb5315a2c7 to your computer and use it in GitHub Desktop.
Fixing compiler warnings in src/demo/share/jfc
Building target 'images' in configuration 'linux-arm-server-release'
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
Warning: No SCM configuration present and no .src-rev
Compiling 1 files for BUILD_JFR_TOOLS
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)
Compiling 2 files for BUILD_JVMTI_TOOLS
Parsing 2 properties into enum-like class for jdk.compiler
Compiling 19 properties into resource bundles for jdk.compiler
Compiling 10 properties into resource bundles for jdk.javadoc
Compiling 12 properties into resource bundles for jdk.jdeps
Compiling 7 properties into resource bundles for jdk.jshell
Compiling 117 files for BUILD_java.compiler.interim
Compiling 401 files for BUILD_jdk.compiler.interim
Creating support/modules_libs/java.base/server/libjvm.so from 853 file(s)
Creating hotspot/variant-server/libjvm/gtest/libjvm.so from 116 file(s)
Creating hotspot/variant-server/libjvm/gtest/gtestLauncher from 1 file(s)
Compiling 218 files for BUILD_jdk.javadoc.interim
Compiling 171 files for BUILD_TOOLS_JDK
Compiling 188 files for BUILD_jdk.rmic.interim
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Compiling 31 files for BUILD_JRTFS
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 2 files for COMPILE_DEPEND
Creating support/modules_libs/java.base/jrt-fs.jar
Compiling 2 files for BUILD_BREAKITERATOR_BASE
Compiling 2 files for BUILD_BREAKITERATOR_LD
Compiling 11 properties into resource bundles for java.base
Compiling 6 properties into resource bundles for java.base
Compiling 11 properties into resource bundles for java.logging
Compiling 11 properties into resource bundles for jdk.jartool
Compiling 11 properties into resource bundles for jdk.management.agent
Compiling 3 properties into resource bundles for jdk.jdi
Compiling 5 properties into resource bundles for jdk.jlink
Compiling 3 properties into resource bundles for jdk.jlink
Compiling 1 properties into resource bundles for jdk.jlink
Compiling 224 properties into resource bundles for jdk.localedata
Compiling 3020 files for java.base
Compiling 89 properties into resource bundles for java.desktop
Compiling 67 files for COMPILE_CREATE_SYMBOLS
Creating ct.sym classes
Creating support/symbols/ct.sym
Compiling 117 files for java.compiler
Compiling 18 files for java.datatransfer
Compiling 1836 files for java.xml
Compiling 10 files for java.instrument
Compiling 35 files for java.logging
Compiling 330 files for java.management
Compiling 30 files for java.security.sasl
Compiling 129 files for java.rmi
Compiling 140 files for java.net.http
Compiling 15 files for java.scripting
Compiling 5 files for java.transaction.xa
Compiling 275 files for java.xml.crypto
Compiling 22 files for java.smartcardio
Compiling 61 files for jdk.internal.jvmstat
Compiling 120 files for jdk.charsets
Compiling 405 files for jdk.compiler
Compiling 22 files for jdk.crypto.ec
Compiling 68 files for jdk.dynalink
Compiling 3 files for jdk.internal.ed
Compiling 44 files for jdk.httpserver
Compiling 97 files for jdk.internal.le
Compiling 51 files for jdk.internal.opt
Compiling 33 files for jdk.jartool
Compiling 218 files for jdk.javadoc
Compiling 24 files for jdk.management
Compiling 133 files for jdk.jdeps
Compiling 1 files for jdk.jdwp.agent
Compiling 175 files for jdk.jfr
Compiling 4 files for jdk.jsobject
Compiling 11 files for jdk.jstatd
Compiling 1760 files for jdk.localedata
Compiling 9 files for jdk.net
Compiling 2 files for jdk.nio.mapmode
Compiling 1 files for jdk.pack
Compiling 188 files for jdk.rmic
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /workspace/src/jdk.rmic/share/classes/sun/tools/util/ModifierFilter.java uses or overrides a deprecated API that is marked for removal.
Note: Recompile with -Xlint:removal for details.
Compiling 593 files for jdk.scripting.nashorn
Compiling 33 files for jdk.sctp
Compiling 9 files for jdk.unsupported
Compiling 94 files for jdk.xml.dom
Compiling 16 files for jdk.zipfs
Note: Some input files use or override a deprecated API that is marked for removal.
Note: Recompile with -Xlint:removal for details.
Compiling 138 files for BUILD_NASGEN
Compiling 15 files for java.prefs
Compiling 197 files for java.naming
Running nasgen
Warning: rmic has been deprecated and is subject to removal in a future
release. Generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are encouraged
to migrate away from using this tool to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 77 files for java.sql
Compiling 15 files for jdk.attach
Compiling 74 files for jdk.crypto.cryptoki
Compiling 40 files for jdk.jcmd
Compiling 251 files for jdk.jdi
Compiling 78 files for jdk.jlink
Compiling 14 files for jdk.management.jfr
Compiling 16 files for jdk.naming.dns
Compiling 7 files for jdk.naming.rmi
Compiling 11 files for jdk.scripting.nashorn.shell
Note: Some input files use or override a deprecated API that is marked for removal.
Note: Recompile with -Xlint:removal for details.
Compiling 14 files for java.management.rmi
Compiling 218 files for java.security.jgss
Compiling 2781 files for java.desktop
Compiling 56 files for java.sql.rowset
Compiling 31 files for jdk.management.agent
Compiling 94 files for jdk.jshell
Warning: rmic has been deprecated and is subject to removal in a future
release. Generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are encouraged
to migrate away from using this tool to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 30 files for jdk.security.auth
Compiling 16 files for jdk.security.jgss
Warning: rmic has been deprecated and is subject to removal in a future
release. Generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are encouraged
to migrate away from using this tool to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Updating support/src.zip
Compiling 1 files for java.se
Compiling 18 files for jdk.accessibility
Compiling 3 files for jdk.editpad
Compiling 1010 files for jdk.hotspot.agent
Compiling 64 files for jdk.jconsole
Compiling 8 files for jdk.unsupported.desktop
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Creating support/modules_libs/java.base/libverify.so from 1 file(s)
Creating support/modules_libs/java.base/libjava.so from 56 file(s)
Creating support/native/java.base/libfdlibm.a from 57 file(s)
Creating support/modules_libs/java.base/libzip.so from 5 file(s)
Creating support/modules_libs/java.base/libjimage.so from 6 file(s)
Creating support/modules_libs/java.base/libjli.so from 8 file(s)
Creating support/modules_libs/java.base/libnet.so from 21 file(s)
Creating support/modules_libs/java.base/libnio.so from 19 file(s)
Creating support/modules_libs/java.base/libjsig.so from 1 file(s)
Creating support/modules_libs/java.prefs/libprefs.so from 1 file(s)
Creating support/native/java.base/java_objs/java from 1 file(s)
Creating support/modules_cmds/java.base/keytool from 1 file(s)
Creating support/modules_libs/java.base/jexec from 1 file(s)
Creating support/modules_libs/java.base/jspawnhelper from 1 file(s)
Creating support/modules_libs/java.instrument/libinstrument.so from 12 file(s)
Creating support/modules_libs/java.desktop/libmlib_image.so from 50 file(s)
Creating support/modules_libs/java.desktop/libawt.so from 73 file(s)
Creating support/modules_libs/java.desktop/libawt_xawt.so from 51 file(s)
Creating support/modules_libs/java.desktop/liblcms.so from 27 file(s)
Creating support/modules_libs/java.desktop/libjavajpeg.so from 46 file(s)
Creating support/modules_libs/java.desktop/libawt_headless.so from 26 file(s)
Creating support/modules_libs/java.desktop/libfontmanager.so from 61 file(s)
Creating support/modules_libs/java.desktop/libjawt.so from 1 file(s)
Creating support/modules_libs/java.desktop/libsplashscreen.so from 67 file(s)
Creating support/modules_libs/java.desktop/libjsound.so from 18 file(s)
Creating support/modules_libs/java.management/libmanagement.so from 9 file(s)
Creating support/modules_libs/java.rmi/librmi.so from 1 file(s)
Creating support/modules_cmds/java.rmi/rmid from 1 file(s)
Creating support/modules_cmds/java.rmi/rmiregistry from 1 file(s)
Creating support/modules_cmds/java.scripting/jrunscript from 1 file(s)
Creating support/modules_libs/java.security.jgss/libj2gss.so from 3 file(s)
Creating support/modules_libs/java.smartcardio/libj2pcsc.so from 2 file(s)
Creating support/modules_libs/jdk.attach/libattach.so from 1 file(s)
Creating support/modules_cmds/jdk.compiler/javac from 1 file(s)
Creating support/modules_cmds/jdk.compiler/serialver from 1 file(s)
Creating support/modules_libs/jdk.crypto.ec/libsunec.so from 28 file(s)
Creating support/modules_libs/jdk.crypto.cryptoki/libj2pkcs11.so from 14 file(s)
Creating support/modules_libs/jdk.hotspot.agent/libsaproc.so from 8 file(s)
Creating support/modules_cmds/jdk.hotspot.agent/jhsdb from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jar from 1 file(s)
Creating support/modules_cmds/jdk.javadoc/javadoc from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jarsigner from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jinfo from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jmap from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jps from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jstack from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jstat from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jcmd from 1 file(s)
Creating support/modules_libs/jdk.management/libmanagement_ext.so from 8 file(s)
Creating support/modules_libs/jdk.management.agent/libmanagement_agent.so from 1 file(s)
Creating support/modules_cmds/jdk.jconsole/jconsole from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/javap from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeps from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeprscan from 1 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libdt_socket.so from 2 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libjdwp.so from 42 file(s)
Creating support/modules_cmds/jdk.jdi/jdb from 1 file(s)
Creating support/modules_cmds/jdk.jfr/jfr from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jimage from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jlink from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jmod from 1 file(s)
Creating support/modules_cmds/jdk.jshell/jshell from 1 file(s)
Creating support/modules_cmds/jdk.jstatd/jstatd from 1 file(s)
Creating support/modules_libs/jdk.net/libextnet.so from 1 file(s)
Creating support/modules_libs/jdk.pack/libunpack.so from 7 file(s)
Creating support/modules_cmds/jdk.pack/pack200 from 1 file(s)
Creating support/modules_cmds/jdk.pack/unpack200 from 7 file(s)
Creating support/modules_cmds/jdk.rmic/rmic from 1 file(s)
Creating support/modules_cmds/jdk.scripting.nashorn.shell/jjs from 1 file(s)
Creating support/modules_libs/jdk.sctp/libsctp.so from 2 file(s)
Creating support/modules_libs/jdk.security.auth/libjaas.so from 1 file(s)
Updating images/sec-bin.zip
Compiling 4 files for BUILD_JIGSAW_TOOLS
Optimizing the exploded image
Creating interim java.logging.jmod
Creating java.compiler.jmod
Creating interim java.base.jmod
Creating java.datatransfer.jmod
Creating java.desktop.jmod
Creating java.instrument.jmod
Creating java.logging.jmod
Creating java.management.jmod
Creating java.management.rmi.jmod
Creating java.naming.jmod
Creating java.net.http.jmod
Creating java.prefs.jmod
Creating java.rmi.jmod
Creating java.scripting.jmod
Creating java.se.jmod
Creating java.security.jgss.jmod
Creating java.security.sasl.jmod
Creating java.smartcardio.jmod
Creating java.sql.jmod
Creating java.sql.rowset.jmod
Creating java.transaction.xa.jmod
Creating jdk.accessibility.jmod
Creating java.xml.crypto.jmod
Creating java.xml.jmod
Creating jdk.attach.jmod
Creating jdk.charsets.jmod
Creating jdk.compiler.jmod
Creating jdk.crypto.cryptoki.jmod
Creating jdk.crypto.ec.jmod
Creating jdk.dynalink.jmod
Creating jdk.editpad.jmod
Creating jdk.hotspot.agent.jmod
Creating jdk.httpserver.jmod
Creating jdk.internal.ed.jmod
Creating jdk.internal.jvmstat.jmod
Creating jdk.internal.le.jmod
Creating jdk.internal.opt.jmod
Creating jdk.jartool.jmod
Creating jdk.javadoc.jmod
Creating jdk.jcmd.jmod
Creating jdk.jconsole.jmod
Creating jdk.jdeps.jmod
Creating jdk.jdi.jmod
Creating jdk.jdwp.agent.jmod
Creating jdk.jfr.jmod
Creating jdk.jshell.jmod
Creating jdk.jsobject.jmod
Creating jdk.jstatd.jmod
Creating jdk.localedata.jmod
Creating jdk.management.jmod
Creating jdk.management.agent.jmod
Creating jdk.management.jfr.jmod
Creating jdk.naming.dns.jmod
Creating jdk.naming.rmi.jmod
Creating jdk.net.jmod
Creating jdk.nio.mapmode.jmod
Creating jdk.pack.jmod
Creating jdk.rmic.jmod
Creating jdk.scripting.nashorn.jmod
Creating jdk.scripting.nashorn.shell.jmod
Creating jdk.sctp.jmod
Creating jdk.security.auth.jmod
Creating jdk.security.jgss.jmod
Creating jdk.unsupported.jmod
Creating jdk.unsupported.desktop.jmod
Creating jdk.xml.dom.jmod
Creating jdk.zipfs.jmod
Compiling 3 files for BUILD_DEMO_CodePointIM
Creating interim jimage
Updating support/demos/image/jfc/CodePointIM/src.zip
Compiling 3 files for BUILD_DEMO_FileChooserDemo
Updating support/demos/image/jfc/FileChooserDemo/src.zip
Compiling 1 files for CLASSLIST_JAR
Compiling 29 files for BUILD_DEMO_SwingSet2
Updating support/demos/image/jfc/SwingSet2/src.zip
Creating support/classlist.jar
Creating jdk.jlink.jmod
Creating java.base.jmod
Compiling 3 files for BUILD_DEMO_Font2DTest
Updating support/demos/image/jfc/Font2DTest/src.zip
Compiling 64 files for BUILD_DEMO_J2Ddemo
Updating support/demos/image/jfc/J2Ddemo/src.zip
Compiling 15 files for BUILD_DEMO_Metalworks
Updating support/demos/image/jfc/Metalworks/src.zip
Compiling 2 files for BUILD_DEMO_Notepad
Updating support/demos/image/jfc/Notepad/src.zip
Compiling 5 files for BUILD_DEMO_Stylepad
Updating support/demos/image/jfc/Stylepad/src.zip
Compiling 5 files for BUILD_DEMO_SampleTree
Updating support/demos/image/jfc/SampleTree/src.zip
Compiling 8 files for BUILD_DEMO_TableExample
Updating support/demos/image/jfc/TableExample/src.zip
Compiling 1 files for BUILD_DEMO_TransparentRuler
Updating support/demos/image/jfc/TransparentRuler/src.zip
Creating support/demos/image/jfc/FileChooserDemo/FileChooserDemo.jar
Creating support/demos/image/jfc/CodePointIM/CodePointIM.jar
Creating support/demos/image/jfc/SwingSet2/SwingSet2.jar
Creating support/demos/image/jfc/Font2DTest/Font2DTest.jar
Creating support/demos/image/jfc/J2Ddemo/J2Ddemo.jar
Creating support/demos/image/jfc/Metalworks/Metalworks.jar
Creating support/demos/image/jfc/Notepad/Notepad.jar
Creating support/demos/image/jfc/Stylepad/Stylepad.jar
Creating support/demos/image/jfc/SampleTree/SampleTree.jar
Creating support/demos/image/jfc/TableExample/TableExample.jar
Creating support/demos/image/jfc/TransparentRuler/TransparentRuler.jar
Creating jdk image
Creating CDS archive for jdk image
Stopping sjavac server
Finished building target 'images' in configuration 'linux-arm-server-release'
Building target 'images' in configuration 'linux-arm-server-release'
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
Warning: No SCM configuration present and no .src-rev
Compiling 1 files for BUILD_JFR_TOOLS
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)
Compiling 2 files for BUILD_JVMTI_TOOLS
Parsing 2 properties into enum-like class for jdk.compiler
Compiling 19 properties into resource bundles for jdk.compiler
Compiling 10 properties into resource bundles for jdk.javadoc
Compiling 12 properties into resource bundles for jdk.jdeps
Compiling 7 properties into resource bundles for jdk.jshell
Compiling 117 files for BUILD_java.compiler.interim
Creating support/modules_libs/java.base/server/libjvm.so from 853 file(s)
Creating hotspot/variant-server/libjvm/gtest/libjvm.so from 116 file(s)
Compiling 401 files for BUILD_jdk.compiler.interim
Creating hotspot/variant-server/libjvm/gtest/gtestLauncher from 1 file(s)
Compiling 218 files for BUILD_jdk.javadoc.interim
Compiling 171 files for BUILD_TOOLS_JDK
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 2 files for COMPILE_DEPEND
Compiling 188 files for BUILD_jdk.rmic.interim
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Compiling 11 properties into resource bundles for jdk.jartool
Compiling 11 properties into resource bundles for jdk.management.agent
Compiling 3 properties into resource bundles for jdk.jdi
Compiling 5 properties into resource bundles for jdk.jlink
Compiling 3 properties into resource bundles for jdk.jlink
Compiling 1 properties into resource bundles for jdk.jlink
Compiling 224 properties into resource bundles for jdk.localedata
Compiling 31 files for BUILD_JRTFS
Creating support/modules_libs/java.base/jrt-fs.jar
Compiling 11 properties into resource bundles for java.base
Compiling 2 files for BUILD_BREAKITERATOR_BASE
Compiling 2 files for BUILD_BREAKITERATOR_LD
Compiling 6 properties into resource bundles for java.base
Compiling 11 properties into resource bundles for java.logging
Compiling 67 files for COMPILE_CREATE_SYMBOLS
Creating ct.sym classes
Compiling 3020 files for java.base
Creating support/symbols/ct.sym
Compiling 89 properties into resource bundles for java.desktop
Compiling 117 files for java.compiler
Compiling 18 files for java.datatransfer
Compiling 1836 files for java.xml
Compiling 10 files for java.instrument
Compiling 35 files for java.logging
Compiling 330 files for java.management
Compiling 30 files for java.security.sasl
Compiling 129 files for java.rmi
Compiling 140 files for java.net.http
Compiling 15 files for java.scripting
Compiling 5 files for java.transaction.xa
Compiling 275 files for java.xml.crypto
Compiling 22 files for java.smartcardio
Compiling 61 files for jdk.internal.jvmstat
Compiling 120 files for jdk.charsets
Compiling 405 files for jdk.compiler
Compiling 22 files for jdk.crypto.ec
Compiling 68 files for jdk.dynalink
Compiling 3 files for jdk.internal.ed
Compiling 44 files for jdk.httpserver
Compiling 97 files for jdk.internal.le
Compiling 51 files for jdk.internal.opt
Compiling 33 files for jdk.jartool
Compiling 218 files for jdk.javadoc
Compiling 24 files for jdk.management
Compiling 133 files for jdk.jdeps
Compiling 1 files for jdk.jdwp.agent
Compiling 175 files for jdk.jfr
Compiling 78 files for jdk.jlink
Compiling 4 files for jdk.jsobject
Compiling 11 files for jdk.jstatd
Compiling 1760 files for jdk.localedata
Compiling 14 files for jdk.management.jfr
Compiling 9 files for jdk.net
Compiling 2 files for jdk.nio.mapmode
Compiling 1 files for jdk.pack
Compiling 188 files for jdk.rmic
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /workspace/src/jdk.rmic/share/classes/sun/tools/util/ModifierFilter.java uses or overrides a deprecated API that is marked for removal.
Note: Recompile with -Xlint:removal for details.
Compiling 593 files for jdk.scripting.nashorn
Note: Some input files use or override a deprecated API that is marked for removal.
Note: Recompile with -Xlint:removal for details.
Compiling 138 files for BUILD_NASGEN
Running nasgen
Compiling 33 files for jdk.sctp
Compiling 9 files for jdk.unsupported
Compiling 94 files for jdk.xml.dom
Compiling 16 files for jdk.zipfs
Compiling 15 files for java.prefs
Compiling 197 files for java.naming
Warning: rmic has been deprecated and is subject to removal in a future
release. Generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are encouraged
to migrate away from using this tool to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 14 files for java.management.rmi
Compiling 218 files for java.security.jgss
Compiling 77 files for java.sql
Compiling 15 files for jdk.attach
Compiling 74 files for jdk.crypto.cryptoki
Compiling 40 files for jdk.jcmd
Compiling 31 files for jdk.management.agent
Compiling 251 files for jdk.jdi
Compiling 16 files for jdk.naming.dns
Compiling 7 files for jdk.naming.rmi
Compiling 11 files for jdk.scripting.nashorn.shell
Note: Some input files use or override a deprecated API that is marked for removal.
Note: Recompile with -Xlint:removal for details.
Compiling 30 files for jdk.security.auth
Compiling 16 files for jdk.security.jgss
Compiling 2781 files for java.desktop
Warning: rmic has been deprecated and is subject to removal in a future
release. Generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are encouraged
to migrate away from using this tool to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 56 files for java.sql.rowset
Compiling 18 files for jdk.accessibility
Compiling 3 files for jdk.editpad
Compiling 1010 files for jdk.hotspot.agent
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 64 files for jdk.jconsole
Compiling 94 files for jdk.jshell
Warning: rmic has been deprecated and is subject to removal in a future
release. Generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are encouraged
to migrate away from using this tool to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 8 files for jdk.unsupported.desktop
Updating support/src.zip
Compiling 1 files for java.se
Creating support/modules_libs/java.base/libverify.so from 1 file(s)
Creating support/modules_libs/java.base/libjava.so from 56 file(s)
Creating support/native/java.base/libfdlibm.a from 57 file(s)
Creating support/modules_libs/java.base/libzip.so from 5 file(s)
Creating support/modules_libs/java.base/libjimage.so from 6 file(s)
Creating support/modules_libs/java.base/libjli.so from 8 file(s)
Creating support/modules_libs/java.base/libnet.so from 21 file(s)
Creating support/modules_libs/java.base/libnio.so from 19 file(s)
Creating support/modules_libs/java.base/libjsig.so from 1 file(s)
Creating support/modules_libs/java.prefs/libprefs.so from 1 file(s)
Creating support/native/java.base/java_objs/java from 1 file(s)
Creating support/modules_cmds/java.base/keytool from 1 file(s)
Creating support/modules_libs/java.base/jexec from 1 file(s)
Creating support/modules_libs/java.base/jspawnhelper from 1 file(s)
Creating support/modules_libs/java.instrument/libinstrument.so from 12 file(s)
Creating support/modules_libs/java.desktop/libmlib_image.so from 50 file(s)
Creating support/modules_libs/java.desktop/libawt.so from 73 file(s)
Creating support/modules_libs/java.desktop/libawt_xawt.so from 51 file(s)
Creating support/modules_libs/java.desktop/liblcms.so from 27 file(s)
Creating support/modules_libs/java.desktop/libjavajpeg.so from 46 file(s)
Creating support/modules_libs/java.desktop/libawt_headless.so from 26 file(s)
Creating support/modules_libs/java.desktop/libfontmanager.so from 61 file(s)
Creating support/modules_libs/java.desktop/libjawt.so from 1 file(s)
Creating support/modules_libs/java.desktop/libsplashscreen.so from 67 file(s)
Creating support/modules_libs/java.desktop/libjsound.so from 18 file(s)
Creating support/modules_libs/java.management/libmanagement.so from 9 file(s)
Creating support/modules_libs/java.rmi/librmi.so from 1 file(s)
Creating support/modules_cmds/java.rmi/rmid from 1 file(s)
Creating support/modules_cmds/java.rmi/rmiregistry from 1 file(s)
Creating support/modules_cmds/java.scripting/jrunscript from 1 file(s)
Creating support/modules_libs/java.security.jgss/libj2gss.so from 3 file(s)
Creating support/modules_libs/java.smartcardio/libj2pcsc.so from 2 file(s)
Creating support/modules_libs/jdk.attach/libattach.so from 1 file(s)
Creating support/modules_cmds/jdk.compiler/javac from 1 file(s)
Creating support/modules_cmds/jdk.compiler/serialver from 1 file(s)
Creating support/modules_libs/jdk.crypto.ec/libsunec.so from 28 file(s)
Creating support/modules_libs/jdk.crypto.cryptoki/libj2pkcs11.so from 14 file(s)
Creating support/modules_libs/jdk.hotspot.agent/libsaproc.so from 8 file(s)
Creating support/modules_cmds/jdk.hotspot.agent/jhsdb from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jar from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jarsigner from 1 file(s)
Creating support/modules_cmds/jdk.javadoc/javadoc from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jinfo from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jmap from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jps from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jstack from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jstat from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jcmd from 1 file(s)
Creating support/modules_libs/jdk.management/libmanagement_ext.so from 8 file(s)
Creating support/modules_libs/jdk.management.agent/libmanagement_agent.so from 1 file(s)
Creating support/modules_cmds/jdk.jconsole/jconsole from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/javap from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeps from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeprscan from 1 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libdt_socket.so from 2 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libjdwp.so from 42 file(s)
Creating support/modules_cmds/jdk.jdi/jdb from 1 file(s)
Creating support/modules_cmds/jdk.jfr/jfr from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jimage from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jlink from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jmod from 1 file(s)
Creating support/modules_cmds/jdk.jshell/jshell from 1 file(s)
Creating support/modules_cmds/jdk.jstatd/jstatd from 1 file(s)
Creating support/modules_libs/jdk.net/libextnet.so from 1 file(s)
Creating support/modules_libs/jdk.pack/libunpack.so from 7 file(s)
Creating support/modules_cmds/jdk.pack/pack200 from 1 file(s)
Creating support/modules_cmds/jdk.pack/unpack200 from 7 file(s)
Creating support/modules_cmds/jdk.rmic/rmic from 1 file(s)
Creating support/modules_cmds/jdk.scripting.nashorn.shell/jjs from 1 file(s)
Creating support/modules_libs/jdk.sctp/libsctp.so from 2 file(s)
Creating support/modules_libs/jdk.security.auth/libjaas.so from 1 file(s)
Updating images/sec-bin.zip
Compiling 4 files for BUILD_JIGSAW_TOOLS
Optimizing the exploded image
Creating java.compiler.jmod
Creating interim java.logging.jmod
Creating interim java.base.jmod
Creating java.datatransfer.jmod
Creating java.desktop.jmod
Creating java.instrument.jmod
Creating java.logging.jmod
Creating java.management.jmod
Creating java.management.rmi.jmod
Creating java.naming.jmod
Creating java.net.http.jmod
Creating java.prefs.jmod
Creating java.rmi.jmod
Creating java.scripting.jmod
Creating java.se.jmod
Creating java.security.jgss.jmod
Creating java.security.sasl.jmod
Creating java.smartcardio.jmod
Creating java.sql.jmod
Creating java.sql.rowset.jmod
Creating java.transaction.xa.jmod
Creating java.xml.jmod
Creating java.xml.crypto.jmod
Creating jdk.accessibility.jmod
Creating jdk.attach.jmod
Creating jdk.charsets.jmod
Creating jdk.compiler.jmod
Creating jdk.crypto.cryptoki.jmod
Creating jdk.crypto.ec.jmod
Creating jdk.dynalink.jmod
Creating jdk.editpad.jmod
Creating jdk.httpserver.jmod
Creating jdk.hotspot.agent.jmod
Creating jdk.internal.ed.jmod
Creating jdk.internal.jvmstat.jmod
Creating jdk.internal.le.jmod
Creating jdk.internal.opt.jmod
Creating jdk.jartool.jmod
Creating jdk.javadoc.jmod
Creating jdk.jcmd.jmod
Creating jdk.jconsole.jmod
Creating jdk.jdeps.jmod
Creating jdk.jdi.jmod
Creating jdk.jdwp.agent.jmod
Creating jdk.jfr.jmod
Creating jdk.jsobject.jmod
Creating jdk.jshell.jmod
Creating jdk.jstatd.jmod
Creating jdk.localedata.jmod
Creating jdk.management.jmod
Creating jdk.management.agent.jmod
Creating jdk.management.jfr.jmod
Creating jdk.naming.dns.jmod
Creating jdk.naming.rmi.jmod
Creating jdk.net.jmod
Creating jdk.nio.mapmode.jmod
Creating jdk.pack.jmod
Creating jdk.rmic.jmod
Creating jdk.scripting.nashorn.jmod
Creating jdk.scripting.nashorn.shell.jmod
Creating jdk.sctp.jmod
Creating jdk.security.auth.jmod
Creating jdk.security.jgss.jmod
Creating jdk.unsupported.jmod
Creating jdk.unsupported.desktop.jmod
Creating jdk.xml.dom.jmod
Creating jdk.zipfs.jmod
Creating interim jimage
Compiling 3 files for BUILD_DEMO_CodePointIM
Updating support/demos/image/jfc/CodePointIM/src.zip
Compiling 3 files for BUILD_DEMO_FileChooserDemo
Updating support/demos/image/jfc/FileChooserDemo/src.zip
Note: /workspace/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /workspace/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 1 files for CLASSLIST_JAR
Compiling 30 files for BUILD_DEMO_SwingSet2
Updating support/demos/image/jfc/SwingSet2/src.zip
Compiling 4 files for BUILD_DEMO_Font2DTest
Updating support/demos/image/jfc/Font2DTest/src.zip
Creating support/classlist.jar
Creating jdk.jlink.jmod
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 64 files for BUILD_DEMO_J2Ddemo
Updating support/demos/image/jfc/J2Ddemo/src.zip
Creating java.base.jmod
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 15 files for BUILD_DEMO_Metalworks
Updating support/demos/image/jfc/Metalworks/src.zip
Note: /workspace/src/demo/share/jfc/Metalworks/MetalworksPrefs.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 2 files for BUILD_DEMO_Notepad
Updating support/demos/image/jfc/Notepad/src.zip
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 5 files for BUILD_DEMO_Stylepad
Updating support/demos/image/jfc/Stylepad/src.zip
Compiling 5 files for BUILD_DEMO_SampleTree
Updating support/demos/image/jfc/SampleTree/src.zip
Compiling 8 files for BUILD_DEMO_TableExample
Updating support/demos/image/jfc/TableExample/src.zip
Note: /workspace/src/demo/share/jfc/Stylepad/Stylepad.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Compiling 1 files for BUILD_DEMO_TransparentRuler
Updating support/demos/image/jfc/TransparentRuler/src.zip
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /workspace/src/demo/share/jfc/TableExample/TableExample4.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Creating support/demos/image/jfc/CodePointIM/CodePointIM.jar
Creating support/demos/image/jfc/FileChooserDemo/FileChooserDemo.jar
Creating support/demos/image/jfc/SwingSet2/SwingSet2.jar
Creating support/demos/image/jfc/Font2DTest/Font2DTest.jar
Creating support/demos/image/jfc/J2Ddemo/J2Ddemo.jar
Creating support/demos/image/jfc/Metalworks/Metalworks.jar
Creating support/demos/image/jfc/Notepad/Notepad.jar
Creating support/demos/image/jfc/Stylepad/Stylepad.jar
Creating support/demos/image/jfc/SampleTree/SampleTree.jar
Creating support/demos/image/jfc/TableExample/TableExample.jar
Creating support/demos/image/jfc/TransparentRuler/TransparentRuler.jar
Creating jdk image
Creating CDS archive for jdk image
Stopping sjavac server
Finished building target 'images' in configuration 'linux-arm-server-release'
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 in this repo: 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.
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
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);
}
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;
- }
-
-
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment