This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Serialization and Graphics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Serialization and Graphics" Watch "Serialization and Graphics" New topic

Serialization and Graphics

Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
My question is...
"why Graphics class do not implement serializable interface".
like Color or others in java.awt

Jason Kingsley

Joined: Feb 21, 2004
Posts: 18
because a graphics context is usually quite unique to a machine/address space/device and serialising it over the wire makes absolutely no sense to the receiving context.

Basically, wanting to draw onto a remote graphics context is a very very bad idea. If you are wanting to say remotely control/cause to draw things between some client and server then you are better off looking at some form of protocol/messaging system between the two entities. This would abstract away the physical devices and provide adequate seperation.
I agree. Here's the link:
subject: Serialization and Graphics
It's not a secret anymore!