Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-20-2007, 05:23 AM
Member
 
Join Date: Jul 2007
Posts: 2
Greedful is on a distinguished road
Updating Graphics
I was curious about a little problem I was having with updating a Graphics2D in a seperate method from the constructor or main. Pretty much I have a BufferedImage as a private Variable of the class which extends Frame/JFrame, and in the constructor I form it as a new BufferedImage with x and y dimensions.

Now I call upon a method a seperate method, which forms the Graphics2D component from the BufferedImage, and whenever I attempt to draw onto the Graphics2D I get a null pointer exception. Is there something I'm missing here?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-20-2007, 07:42 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Please paste the code here.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-20-2007, 08:12 PM
Member
 
Join Date: Jul 2007
Posts: 2
Greedful is on a distinguished road
No worries, I figured out what I was doing wrong. Sadly it was a beginner's mistake.

But I do have another question more towards optimization. What is the fastest way to draw an Image onto a Graphics component?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed with updating mysql database SilentCodingOne New To Java 1 12-11-2007 11:23 PM
Updating Local Content ibanez270dx Java Applets 1 11-02-2007 02:55 AM
Problems updating blob columns on Oracle 9 ljustiniano Database 0 08-14-2007 07:17 PM
dynamically updating clock malakaherath New To Java 2 08-01-2007 08:57 PM
Updating into 2 tables in the DB yuchuang New To Java 2 05-12-2007 07:54 AM


All times are GMT +3. The time now is 04:06 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org