Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


[java] Using drawRect() inside a GUI application?

This topic is 5534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would I use the various AWT drawing commands inside of a GUI application? Any assistance would be appreciated. CPops57

Share this post

Link to post
Share on other sites
Never tried it myself, but maybe make an Image object and add it to the content pane?

JFrame frame = new JFrame();
Container content = frame.getContentPane();

Image img = new Image(various constructors);
Graphics gBuffer = img.getGraphics();

I don''t know if you can add an Image object to the content pane though, cause an Image really isn''t a swing component. Ah well, I''m too tired to dig through the API documentation right now.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!