A single line of code to get Windows (System directory) of your PC folder path in Java. Get Windows Directory class GetWindowsDir { ...
Read More
Home » Archive for November 2012
Get Java Installation Directory In Java
Single statement to get the directory where Java is installed in your computer. Java Installation Directory class JavaInstallationD...
Read More
Get Operating System Name In Java
Single statement is enough for getting OS name in Java. So simple. Get OS Name class OSName { public static void main(String a...
Read More
Subtract Elements In Array In Java
An example code on subtracting elements in array in Java in decreasing order in 3 main steps. This simple logic can also be used on any pro...
Read More
Sort Array In Increasing Order In Java
An example code on sorting an array of (any numeric datatype) in increasing order in a single statement. Sorting Array in Increasing ...
Read More
Add All Elements In Array In Java
An example on adding all the elements in an array that user gives. A really simple logic involving 2 main steps. Add all Elements in Arr...
Read More
Stringtokenizer In Java Example
An example on using java.util.StringTokenizer for counting no.of tokens split by a delimeter, using the methods hasMoreTokens() , nextToke...
Read More
Java Code To Play Mp3 File
An example code on playing not only mp3 but any audio file in Java in just 2 statements. Your first step to create an audio player. Inst...
Read More
Split String By Length In Java
An example on splitting a string after 'n' characters i.e. into chunks with n characters each in Java. Let's Split im...
Read More
Set Classpath In Java Permanently
Setting classpath is the most essential part that every Java starter has to know because not just Java gives the developer the capability t...
Read More
Capitalize A String In Java
An example on making the characters after the space capital if they are not, in Java. Here is a logic that i've written and that's ...
Read More
Catch The Rat: Simple Game In Java
A simple, shortest and easiest game that could be written in Java using Swing components and event handling. What's your opinion a...
Read More
Create Your Own Javadoc From Command Prompt
You can learn Java, understand each and every method, constructor with the help of some files that you may already have seen on docs.oracle...
Read More
Check Alphabets And Digits In String Using Regex
An example on checking whether a string contains only alphabets and numbers using Regular Expressions in Java. Example // For Patter...
Read More
Paste Image From Clipboard On Jframe In Java
The following illustrates pasting an image from clipboard in Java and setting it as background image for JFrame. // Import for BorderL...
Read More
Get Data From Clipboard In Java
Here is how to get text from clipboard in Java and print it in two simple statements. import java.awt.*; import java.awt.datatransfer...
Read More
Convert Images In Java
An example on converting images between JPG, PNG, GIF formats in Java in two simple steps. Example // Import for ImageIO class impo...
Read More
Get Screen Center Point In Java
An example on getting screen center in Java in a single statement! import java.awt.*; class GetCenter { public static void main(St...
Read More
Get All Installed Fonts In A Pc
An example on getting the list of all installed fonts in your PC in Font[] and String[]. import java.awt.*; class GetFonts { public...
Read More
Create Beep Sound In Java
An example on generating beep sound using Java agenda in AWT. Example import java.awt.*; class BeepSound { public static void main(...
Read More
Get Screen Size And Resolution In Java
An example on getting and printing screen size and resolution (dots per pixel) in Java. Example import java.awt.*; class GetScreenS...
Read More
Center Jdialog On Screen & Jframe In Java Swing
An example on keeping JDialog on the center of the screen and on the center of JFrame in Java. Example import javax.swing.*; impor...
Read More
Subscribe to:
Posts (Atom)