Java

Creating a Simple Paint Program in Java

Submitted by mehfuza on
Introduction In this tutorial, a simple Paint program is created, which enables us to draw anything to screen. It's a basic program to understand the logic behind creating a paint program. Here main concept is implementing MouseMotionListener which handles mouse events. Whenever mouse is dragged a mouse event is sent to Java which finds the event listener in the program in order to take any action. We need to implement only mouseDragged() of many functions of MouseMotionListener class to draw to the Panel.

Word Counter in Java

Submitted by tutgeeks on
Here is a Java program I made in Java that counts the number of words and number of lines in of an inputted String. Check this out! import java.util.Scanner; public class PrintPerWord { public static void main(String[] args) { Scanner read = new Scanner(System.in); String myString = new String(); System.out.print("Please enter any string: "); myString = read.nextLine(); int line = 0, let = 0, size

Saving the Objects in Java

Submitted by mehfuza on
Our programs reside on Hard Disk. Every program is brought into Main memory(RAM) for execution. Variables, Objects are runtime entity which means they are saved in RAM. Once you run the Program, variables, objects come into existence but once we close our program they are deleted from the Main Memory. In order to save the state(instance variable) of objects they must be saved on Secondary Memory(Hard Disk). Following are steps for serializing(saving) the objects.

Easy Way to implement A Dynamic Clock in Java using Threads

Submitted by mehfuza on
Introduction: In this Tutorial, creation of clock which updates every second is explained. Here we create an Application for clock. It shows Hour, minutes and seconds which updates every second. Main Idea: The Dynamic clock can be created using Java's Timer thread but here we will see how to use our own thread and accomplish the task. This tutorial can clear any doubts you have in Java Threads.

Palyndrome in Java

Submitted by tutgeeks on
This code will show you if the word is Palyndrome or not. import java.util.Scanner; public class Palyndrome { public static void main(String[] args) { Scanner read = new Scanner(System.in); int ctr = 0; System.out.print("Enter any string: "); String str = read.next(); if(str.length()+1>3) { for(int x=0,y=str.length()-1;x

Registration Simulator

Submitted by blackwoods on
I'm not pro, I'm still a beginner so if you find somethin' that is wrong in my code, please don't hesitate to correct it. Just tell me so that I'll know what should i do. Here's a code, that resembles a registration simulator. It organizes the name, that you enter in the proper case as well as the location.

Login System in Netbeans Using SQL Database

Submitted by Josphatwa on
For database connectivity just create a class open the project in netbeans and go to sql.java and change on the host the username and password of your server Then in the zipped folder unzip and restore the database to your server After that you can run the .jar in the dist folder. For queries just comment here.