[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

  • From: trhouse < >
  • To:
  • Subject: [nbusers] Re: Using g.DrawRect and paint functions in Netbeans
  • Date: Fri, 26 Oct 2012 20:56:08 -0700

Yeah you know I think you're right.. GraphicsContext object associated with Applet development at some point.... that's it! :)



On 10/26/2012 5:39 PM, Edson Richter wrote:
Em 27/10/2012 00:05, trhouse escreveu:
I for one am always happiest when I am shown to have been wrong because it means someone else did needed footwork and I don't have to run into some important fact later when it matters and is in a position to make me sorry ! :):):)

That being said, this:

On 10/26/2012 3:43 PM, Edson Richter wrote:
paint(GraphicsContext graphics)

I think is wrong although ...although ...although... I myself did write exactly that in my original but unsent reply to this thread but changed it after I decided to double check it because I have been away from GUI stuff for a while. I was wrong ! I don't know why we both have this idea.. GraphicsContext does not appear to be any kind of object (class) at all in Swing or the JDK. Refer to the "all classes" section and search for Graphic(s)Context !
http://docs.oracle.com/javase/7/docs/api/index.html

And yet it still seems to me that it is, or was once, or something of this nature. What is going on Edson? Why do we both think this same thing?

:-)
Actually, I was lost in my memories about Applet programming, and then abstracted the API itself, and concentrated in the terminology...
It's impossible to someone to know all the classes available - and I confess that I don't do any Applet programming for years now...

Looking API, the right method signature is:

public void paint(Graphics g);


And you will find it in Applet class (among others), that you will extend from when creating your application.
A good (and easy to understand) explanation about Graphics use on Applets can be found here: http://docs.oracle.com/javase/tutorial/deployment/applet/lifeCycle.html

Also, you can use Graphics when using BufferedImages and other graphic related classes, that are even more important than Applets, because they allow you to do fast off-screen rendering, essential for Sprite/Stop motion alike animations..

Regards,

Edson



[nbusers] Using g.DrawRect and paint functions in Netbeans

nagatopain17 10/26/2012

[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

Benno Markiewicz 10/26/2012

[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

trhouse 10/26/2012

[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

Edson Richter 10/26/2012

[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

trhouse 10/26/2012

[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

Edson Richter 10/27/2012

[nbusers] Re: Using g.DrawRect and paint functions in Netbeans

trhouse 10/27/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close