aspose file tools
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
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.
wood burning stoves
subject: Serialization and Graphics