Jump to content

  • Log In with Google      Sign In   
  • Create Account


n3oplasm

Member Since 05 Nov 2012
Offline Last Active Dec 15 2012 03:58 PM

Posts I've Made

In Topic: [HTML] Good PHP IDE ?

15 November 2012 - 09:17 AM

Check out the PDT Plugin for Eclipse: http://wiki.eclipse.org/index.php/PHP This is what I've used and it supports debugging via XDebug so that you can step through your code while it executes.

You'll need to download and install Eclipse before installing the plugin but both are free: http://www.eclipse.org/

In Topic: NullPointerException on DoubleBuffering

14 November 2012 - 02:39 PM

The call to this.getGraphics() will return null if the component is not visible (i.e. the panel has been added to a JFrame which is not currently set to visible at the time the thread is running). My guess is that finalGraphics is null at the time finalGraphics.drawImage(bfi,0,0,null); is being called. As far as I know, a call to getGraphics (or the preferred createGraphics as TheChubu pointed out) of a BufferedImage object should not return null.

Also, unless there's a reason you aren't currently, I'd consider using the BufferStrategy class that the Java library provides for double-buffering. See the links below for examples of usage in an active-rendering loop. Hope that helps!

http://docs.oracle.com/javase/tutorial/extra/fullscreen/bufferstrategy.html
http://www.gamedev.net/page/resources/_/technical/general-programming/java-games-active-rendering-r2418

In Topic: Programming Exercises

07 November 2012 - 01:46 PM

Here's a free online book on Java that has exercises at the end of each chapter and their solutions as well.

http://math.hws.edu/javanotes/

In Topic: Little Help with getting sounds to work in Java.

06 November 2012 - 08:10 AM

Check that soundUrl is not null, try debugging with System.out.println(soundUrl). ClassLoader.getResource() will return null without throwing an exception if the file name given is not valid. If the url is null make sure that the file you are referencing does indeed exist and that it is relative to the root of your source. For example, if audioFile was something like "audio/sound.wav", then the class loader expects the file to be in src/audio/sound.wav.

In Topic: settin enum constants

05 November 2012 - 06:17 PM

According to the Javadoc posted at the link, ValidationStringency enum is an inner enum of SAMFileReader and it contains the value for LENIENT. The code below should work as long as you add import net.sf.samtools.SAMFileReader.ValidationStringency; to your import statements.

[source lang="java"]SAMFileReader reader;reader.ValidationStringency(ValidationStringency.LENIENT);[/source]

You could also do without the import if you use SAMFileReader.ValidationStringency.LENIENT instead. Either one should work fine.

PARTNERS