 |
This is a basic digital clock in Java that works off your operating system time, it works in a multithreaded environment and have coded it to put my own background in.
import java.awt.*;
import javax.swing.*;
import java.util.*;
class Clock extends JFrame implements Runnable
{
...
By Systemerror
Last Message By rkudoz
|
6 54,719 |
 |
Introduction
This Code snippet is used to capture Screenshot automatically and save it.
The below code performs the function of taking screenshots automatically making use of the class java.awt.Robot .The package java.awt contains all of the classes for creating user interfaces and for...
By sameer_havakajoka
Last Message By rasd123
|
7 3,064 |
 |
Introduction
The solution is mainly used in Error website wherein you have to generate reports which gives the number of solutions uploaded in a specific period(Reports by calendar) or the number of solutions posted by particular employee (reports by employee id).
Background
My...
By sameer_havakajoka
Last Message By rasd123
|
10 2,977 |
 |
Introduction
How to split a file in to equal parts without knowing the number of records in the input file?
Background
Suppose you don't know how many records are in a dataset, but you want to divide the records as equal as possible among the output datasets. We can split a file into...
By naimish
Last Message By shabbir
|
1 7,415 |
 |
Google pagination used to find initial and final index for the search done using google3 for website application.
GoogleAppSearch.java
import net.sf.gsaapi.GSAClient;
import net.sf.gsaapi.GSAQuery;
import net.sf.gsaapi.GSAResponse;
import net.sf.gsaapi.GSAQuery.GSAQueryTerm;
import...
By naimish
Last Message By shabbir
|
7 5,195 |
 |
Compiler Problems
1. 'javac' is not recognized as an internal or external command, operable program or batch file
If you receive this error, it means that Windows is not able to find the compiler (javac). Here's one way to tell Windows where to find javac. Set the PATH as follows on...
By Sanskruti
Last Message By diyarana
|
2 11,798 |
 |
The Decimal Format class is not very well documented, so I will try and exmplain it with an example.
Firstly, you need to import the DecimalFormat class:
import java.text.DecimalFormat; Create an instance the format object. This object can be used with doubles, as it uses a decimal. It uses a...
By pradeep
Last Message By kiddo
|
1 5,848 |
 |
A thread, by definition is a light weight process. They are used to increase functionality and performance by performing multiple tasks at the same time, i.e. concurrently. There are two methods for implementing threads in Java,
Implementing an interface
Extending a class
I'd assume that...
By pradeep
Last Message By frank239
|
7 10,627 |
 |
JSTL is a collection of tags similar to HTML that lets you produce dynamic web pages without needing to learn Java.
Why JSTL?
JavaServer Pages (JSP) technology makes it easy to embed bits of Java code (or scriptlets) in HTML documents. This solution, however, may not be suitable for all HTML...
By Sanskruti
Last Message By bapsbps
|
2 7,110 |
 |
Comparing Strings
To compare strings function equals() is used.
String str1 = "XYZ";
String str2 = "xyz";
boolean result = str1.equals(str2);
boolean result2 = str1.equalsIgnoreCase(str2);Output
By Sanskruti
Last Message By bapsbps
|
6 13,702 |
 |
Introduction
Have you ever searched for files and folders in Windows operating system? Generally most of the users try to search various .doc files, .pdf files etc. We generally search by giving *.doc or *.pdf in the text box of the search window of the windows OS. Of course windows OS provides...
By Debadatta Mishra
Last Message By JVposter
|
5 15,052 |
 |
Introduction
The 'main()' method in Java is referred to the thread that is running, whenever a Java program runs. It calls the main thread because it is the first thread that starts running when a program begins. Other threads can be spawned from this main thread. The main thread must be the...
By Sanskruti
Last Message By swaran
|
4 37,527 |
 |
There are four types of JSP tags, which are important and often required.
1. Directives
These types of tags are used primarily to import packages. Altenatively you can also use these tags to define error handling pages and for session information of JSP page.
<%@page language="java" %>
...
By Sanskruti
Last Message By juresh
|
2 10,433 |
 |
Using Regular Expressions in Java
JDK versions 1.4.0 and later have comprehensive support for regular expressions through the standard java.util.regex package. Because Java lacked a regex package for so long, there are also many 3rd party regex packages available for Java. I will only discuss...
By pradeep
Last Message By elec.shabnam
|
13 26,271 |
 |
Spring Framework Features
Spring is a layered Java/J2EE application framework, based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002).
Spring includes:
- The most complete lightweight container, providing centralized, automated configuration...
By Sanskruti
Last Message By mvairavan
|
1 6,965 |
 |
LDAP - The Lightweight Directory Access Protocol
This directory access protocol which can either act as a gateway to other service or provide service itself. LDAP follows standardized way of managing directory information solutions of X.500.
The Lightweight Directory Access Protocol, better...
By thiruganeshkumar@gma
Last Message By pradeep
|
1 56,619 |
 |
People generally have doubt that when we use Hibernate we simply use configuration to create SessionFactory(). Using that we create session for JDBC connection. But all these SessionFactory and Session class are interfaces. But there is no class available with this name which implements methods of...
By abhishekshahi
Last Message By shabbir
|
1 7,134 |
 |
By msi_333
|
- - |
 |
Struts is a free open-source framework for creating Java web applications.
Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines...
By Sanskruti
|
0 3,433 |
 |
A thread can be created in Java programs in two ways – by extending Thread class and by implementing Runnable interface. In case, where the class extends a Tread class, it must override run() method of the Thread class. The program may override the other methods also. If the program uses Runnable...
By Sanskruti
|
0 23,036 |