•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 427,635 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,495 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
•
•
•
•
•
•
•
•
The code below captures the screen and saves it.
Depending on your need, you can modify it to do just what you want
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.*;
import... (View Snippet)
I'm not sure if it has been done yet or not, but I thought this program might be helpful to those that want to practice SQL in Java, because it sure is helpful for me! =)
The assumption is that you're running Java 5+ and that you have a Database linked already.
You can provide your own Driver... (View Snippet)
A program that finds the day of the week you were born on. Once again, this was adapted from a homework assignment, but I rewrote the entire thing from scratch >.< but it was a lot of fun. (View Snippet)
A program that asks for a number, and uses that number to find the date that many days from today (or whatever day you're using it on). The code was adopted from a homework assignment, so that's why the variable names might not make a lot of sense, I was too lazy to change them. The program still... (View Snippet)
Finds all (integer) the triples from zero to max. won't return duplicates (ie. (3,4,5) and (4,3,5)) prints them
demonstrates:
nested loops,
multiple classes,
proper equals(Object) override (no hashcode though),
writing to file (View Snippet)
I made this minesweeper game earlier this summer. It shows many things, including:
array use,
1D array to 2D array,
gridlayout,
changing the way a JButton works depending on mouse button used,
floodfill,
loops,
GUI.
slightly long, 382 lines, can probably be condensed. (View Snippet)
Its a simple program giving the demo of intre thread communication based on MovingBalls.java program...
Hopng that its Useful For U? (View Snippet)
This particular snippet will display a chessboard in a new frame. Needless to say save it in a file named "chessboard.java". (View Snippet)
This is simple example how to get data reading from mobile phone's in-built sensor with JSR-256 and Java Microedition
SensorMidlet.java
/**
*
* @author Peter Miklosko
* @homepage http://www.peterscorner.co.uk
*/
import javax.microedition.midlet.MIDlet; (View Snippet)
This is a simple Search Engine that contains tokenized words as keys, in which they will return values associated with them in an ArrayList.
All that is required is a text file from a valid extension. (View Snippet)