Popular Java Codes

Thread Inner Classes

Description This code shows the implementation of threads with inner classes. Source Code class InnerThread1 { private int countDown = 5; private Inner inner; private class Inner extends Thr ...

0 Comments. 3153 views since Sep 10, 2008

Simplified DES (SDES) Algorithm

Description This is a Java code for Encryption, Decryption and Key generation in Simplified DES (SDES) algorithm used in Cryptography and Network Security. Sample output: >SKT_SDES 0000011111 01000111 Key K1: 01101011 Key K2: 101 ...

7 Comments. 2656 views since Sep 22, 2008

JTree: File and Directory Tree

Description This is a sample code of JTree. By using this code you can make the Tree of Diretories and Files for Example: Windows File Explorer. Source Code import java.awt.*; import java.io.File; import ...

0 Comments. 1257 views since Aug 16, 2008

Swing and Thread for Length Operation

Description This code shows the lengthy process for searching a particular bank account's remaining balance. Source Code package yfrindia; import java.awt.BorderLayout; import java.awt.FlowLayout; ...

0 Comments. 1186 views since Sep 10, 2008

Counter with Swing & Thread

Description This code shows a circle which on pressing of start button starts filling the circle with red colour and on pressing stop, stops the activity. Source Code import java.awt.BorderLayout; impor ...

0 Comments. 900 views since Sep 10, 2008

JComboBox: Date & Time

Description This is a Code which demonstrates how to add Listeners to a ComboBox & shows Date &/or Time according to the System Date & Timings in different formats based on the selection in the ComboBox. Source Code <pre name="code" ...

0 Comments. 810 views since Aug 21, 2008

Applet: Hello World

Description applet programming in java Source Code import java.applet.Applet; import java.awt.*; import java.awt.event.*; /* &lt;APPLET CODE=applet.class WIDTH=200 HEIGHT=200 &gt; &lt;/APPLET&gt; ...

0 Comments. 701 views since May 28, 2009

JList: Add|Remove Items

Description This is a Code which Adds or Removes the Items from a JList at runtime. Source Code import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ListUpdation extends JFrame ...

0 Comments. 685 views since Aug 19, 2008

File Chooser

Description This code shows how to select files from your pc with a file browser. Source Code import static javax.swing.JFileChooser.APPROVE_OPTION; import static javax.swing.JFileChooser.APPROVE_SELEC ...

0 Comments. 642 views since Sep 30, 2008

Change Look and Feel

Description This is a very useful code fragment which improves your Java application's Look and Feel better. There are various methods provided by the Java. Most of them are following. Besides using these methods you can also use third party ...

0 Comments. 629 views since Jul 9, 2008