java - Call a function based on JVM version -
I have a JFram object, and I have to support two JVM 1.5 on Mac OS X and 1.6 on Windows. On windows I need to use the setIconImages function to set several icons for the size of the application, but this function is not available at 1.5. Is it possible to call this function with reflection within the JFram?
Application JFrame {. . Void init () {// check version // call setIconImages}}
I would Do something like the following (wont 'compile, but you should start):
Create a section called Freemult and give it the following method:
Public static zero set icon Images (last java.W. window window, extends the final list & lt;; image & gt; symbols) {try {method setIconImagesMethod; SetIconImagesMethod = // set Use reflection to get copy images. SetIconImagesMethod.invoke (window, icon); } Hold (last NoSuchMethodException pre) {// fall back on an image method window .set IconImage (icons.get (0)); }}
Comments
Post a Comment