Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

View RSS Feed

All Blog Entries

  1. Minitip #2: Determining if a key is being pressed [WINDOWS SPECIFIC]

    Sometimes it's valuable to determine if a certain key is being pressed. This is especially valuable if you have multiple Swing components and you don't want to mess with keeping track of boolean flags across different objects, but is absolutely necessary if you're trying to get keypresses which are not received by any of your Swing components.

    In the forums, I've recommended writing JNI code which would allow the Java code to poll the hardware for key states, but never actually got ...

    Updated June 4th, 2011 at 02:08 by helloworld922

  2. Logging

    Logging is a great method to monitor the progress of a program while at the same time maintaining flexibility to control the output. Simply put, logging is just printing out statements during the runtime of an application. In another blog I described a simplistic method for logging - using System.out.println. More advanced logging libraries however go beyond just printing to the console - their flexibility allows control of when, how, and where to log.

    Many logging libraries exist, ...

    Updated May 31st, 2011 at 19:32 by copeg

  3. Minitip #1: Static imports

    So I'm going to try something new here: small, miniature tips which can help people improve their code. The focus will probably be towards the beginner/intermediate level, though there may be a few advanced tips every now and then.

    So let's get started!

    Static imports allow you to import static members of another class into your class. The main reason for this is to allow you to use those members without the long, drawn-out declaration of where that static member came ...
  4. The Monty Hall Problem

    The Monty Hall problem is a statistical problem which originates from the television Game show Lets Make a Deal, hosted by Monty Hall. The game is simple: a contestant is presented 3 closed doors, behind one of which is a valuable prize (oftentimes described as a car, whereas the other doors have goats behind them). A contestant chooses a door. The host then opens one of the doors you did not choose, which does NOT contain the prize. Then the host asks - do you want to change your decision? What ...

    Updated May 16th, 2011 at 19:32 by copeg

  5. Complimentary Multiply with Carry: A better way to generate pseudo-random Numbers

    Java's "default" API pseudo-random number generator is a Linear congruential generator, but has a host of problems (such as a fairly short period, and series correlation). For normal day-to-day use, these problems aren't an issue, and the simplicity of this generator makes it a good choice to implement and use. However, when you start entering the domain of Monte Carlo simulations or other stochastic methods which require millions or more "uncorrelated" random numbers, the LCG ...
Page 12 of 14 FirstFirst ... 21011121314 LastLast