Originally posted by Peter Lawrey:
You can use reflections to call any method or create an instance of any class if it exists and gracefully do something else if it does not.
Out of interest, do you really need to support 1.1 as 1.4 is EOL.
My company is still using compiler 1.1 and will not upgrade to a newer compiler anytime soon due to stability reason.
Do you have any example about how to use reflections?
Let say I am currently drawing an non antialiasing oval:
I would like to have the antialiasing feature like:
But the 1.1 compiler doesn't support Graphics2D and RenderingHints. How to use reflections to do that?
Thanks so much!
Originally posted by Ernest Friedman-Hill:
It's not the compiler that matters here so much, but the runtime. If you're using a Java 1.1 JVM to run your program, then the Graphics2D class simply won't be there.
"Stability" reasons? Like they need to run on an old, buggy JVM?
Yeah, you are right. For those using Java 1.1 JVM will not have the antialiasing feature. For those who use newer JVM will have this feature. I just need to compile the code with 1.1 compiler and users will different JVM are atill able to run it.