This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

How to draw antialiasing graphics if using Java 1.1 compiler?  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to draw antialiasing graphics, but I am using Java 1.1 compiler. Is there any way I can draw antialiasing graphics using 1.1 compiler? I know Graphics2D can draw antialiasing graphics, but 1.1 compiler cannot compile that.

Thanks!
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stanley Yu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.



Peter,

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!

Stanley
 
author and iconoclast
Posts: 24203
40
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Stanley Yu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?




Hi Ernest,

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.

Thanks!

Stanley
 
Stanley Yu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help or provide an example on how to code the following using reflection and is able to by compiled by Java 1.1?
Thanks so much!!

 
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
reflection offers API commands to look inside a Class, extract properties and execute methods.

You will NOT be able to use anit-aliasing as already said as this feature is not in 1.1

You are being asked to race in the Daytona 500 using a Ford Model-T!

WP
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!