For a personal project i needed to have a quick and easy system to save settings from a JFrame to preferences node using jdk preference api.
The first method, toLong(String), will convert the provided ip address to its long format. For instance, invoking toLong("255.255.255.255") will return 4294967295 whereas the second method, toString(long), will convert it back as "255.255.255.255", in other words, into a 32bit dotted format.
Editing the Windows Registry for whatever reason can be a tricky task using Java since it doesn't technically run in the OS environment, rather than a virtual machine. This makes accessing certain OS resources difficult if not impossible. However, through the magic of the Runtime class, which allows raw commands to be sent to the OS, you can edit the registry relatively easily, and efficiently.
create a maplet class and get URL parameter and put them in database by using JDBC and sql .maplet is a framework base on MVC. It make project shorter and cleaner. Since you dont need to create a sevlet for each jsp and you can process several jsp request in one maplet. Also it carry the URL from first request to the end of the pageworkflow. to use this snippet please download shine pattern and add..
This is my final project for APCS (Advanced Placement Computer Science). It's currently unfinished, we (my partner and I) still need to add a crash sequence as well as some modifications to make the game more difficult. Anyway, you can play this by copying the code below and pasting into JCreator or downloading the .zip with an .exe file and the images used in the game here:Helicopter Game .zip
This is a Pong game applet that I made in Java. It's player vs. computer, and the computer never loses. You just move the mouse up and down to control your paddle. I'd like to figure out how to change the speeds of the ball's x and y based on where it hits on the paddle, so it's not "predicted" where the ball will go.