skip to main | skip to sidebar

Java Programs and Examples with Output

Pages

  • Home
 
  • RSS
  • Twitter
Showing posts with label Java AWT Example. Show all posts
Showing posts with label Java AWT Example. Show all posts
Saturday, October 13, 2012

How to know which fonts are available in a local system

Posted by Raju Gupta at 5:00 AM – 0 comments
 
This Program will helps to know which fonts are available in our system

import java.awt.*;
class Fonts
  {
     public static void main(String args[])
         {
            //get the local graphics environment info into object ge

          GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();

           String fonts[]=ge.getAvailableFontFamilyNames();

           System.out.println("Available fonts on this system:");
 
          for(int i=0; i < fonts.length;i++)
            System.out.println(fonts[i]);

                 }
      }


[ Read More ]
Read more...
Sunday, February 12, 2012

Make BullsEye Target Using Java AWT and Swing Classes

Posted by Admin at 1:24 AM – 0 comments
 
Here is a Java Program to Make BullsEye Target Using Java AWT and Swing Classes

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

class BullseyeDemo {
 
    public static void main(String[] args) {
        JFrame target = new BullseyeWindow();
        target.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        target.setVisible(true);
    }
}

class BullseyeWindow extends JFrame {
    int initialRings = 10; // Number of rings to start with.
    Bullseye be;           // The panel that draws the bullseye

    public BullseyeWindow() {
        JSlider slide = new JSlider(JSlider.HORIZONTAL, 0, 30, initialRings);
        slide.setMajorTickSpacing(5); // sets numbers for biggest tick marks
        slide.setPaintLabels(true);   // display numbers on major ticks
        slide.setMinorTickSpacing(1); // smaller tick marks
        slide.setPaintTicks(true);    // display the ticks
        slide.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    int num = ((JSlider)(e.getSource())).getValue();
                    be.setRings(num);
                }
            });

        be = new Bullseye();
        be.setRings(initialRings);

        Container content = this.getContentPane();
        content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
        content.add(slide);
        content.add(be);
        
        this.setTitle("BullseyeDemo");
        this.pack();
        this.setResizable(false);
    }
}


class Bullseye extends JPanel {
    static final int SIZE = 300; // initial window size
    int rings = 5;  // Number of rings to draw in bullseye

    public Bullseye() {
        this.setBackground(Color.white);
        this.setPreferredSize(new Dimension(SIZE, SIZE));
    }
    
    public void setRings(int r) {
        rings = r;
        this.repaint();  // new value of rings - better repaint
    }
    
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        int x = SIZE/2;  // x,y of top left corner for drawing circles
        int y = SIZE/2;
        
        for (int i=rings; i>0; i--) {
            if (i%2 == 0) {
                g.setColor(Color.red);
            } else {
                g.setColor(Color.blue);
            }
            int radius = i * 100/rings;  // compute radius of this ring
            g.fillOval(x-radius, y-radius, radius*2, radius*2);
        }
    }
}

Output of Above Java Program



On Running The Program

When Move Slider to 24

[ Read More ]
Read more...

Make a Sleepy Face Using a Java AWT Class

Posted by Admin at 12:55 AM – 0 comments
 
Here is a Java Program to Make a Sleepy Face Using a AWT Class

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;


/***********class Sleepy*******************/
class Sleepy {

    public static void main(String[] args) {
        JFrame windo = new JFrame("Sleepy");
        windo.getContentPane().add(new SleepyPanel());
        windo.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        windo.pack();
        windo.show();
    }
}


class SleepyPanel extends JPanel {
    private Sleeper face = new Sleeper();

    SleepyPanel() {
        JButton awakeButton = new JButton("Awake");
        awakeButton.addActionListener(
            new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    face.setAwake(true);
                }
            }
        );
        JButton asleepButton = new JButton("Asleep");
        asleepButton.addActionListener(
            new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    face.setAwake(false);
                }
            }
        );

        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new FlowLayout());
        buttonPanel.add(awakeButton);
        buttonPanel.add(asleepButton);

        this.setLayout(new BorderLayout());
        this.add(buttonPanel, BorderLayout.NORTH);
        this.add(face, BorderLayout.CENTER);
    }
}

class Sleeper extends JPanel {

    private boolean awake = false;  // show face awake or asleep

    Sleeper() {
        this.setBackground(Color.lightGray);
        this.setPreferredSize(new Dimension(400, 400));  // size
    }

    public void setAwake(boolean awakeAsleep) {
        awake = awakeAsleep; // remember expression on face
        repaint();           // redraw it with new value
    }


    public void paintComponent(Graphics g) {
        super.paintComponent(g);  // MUST be first line

        //--- draw head
        g.setColor(Color.yellow);
        g.fillOval(8, 8, 384, 384);

        //--- draw eyes
        g.setColor(Color.black);
        if (awake) {
            g.fillOval(100, 150, 50, 100);  // left eye
            g.fillOval(250, 150, 50, 100);  // right eye
        }
        else {
            g.fillRect(50 , 200, 100, 4); // left eye
            g.fillRect(250, 200, 100, 4); // left eye
        }
    }
}

Output of Above Java Program



When Clicked on Awake Button


When Clicked on Asleep Button



[ Read More ]
Read more...

Find the Body Mass Index Using AWT and Swing Classes

Posted by Admin at 12:46 AM – 0 comments
 
Here is a Java Program to Find the Body Mass Index Using AWT and Swing Classes

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

class BMI extends JFrame {
    public static void main(String[] args) {
        BMI window = new BMI();
        window.setVisible(true);
    }


    private JTextField _mField   = new JTextField(4);  // height
    private JTextField _kgField  = new JTextField(4);  // weight
    private JTextField _bmiField = new JTextField(4);  // BMI

    /****************constructor********************/
    public BMI() {
        //Create button and add action listener.
        JButton bmiButton = new JButton("Compute BMI");
        bmiButton.addActionListener(new BMIListener());

        //Set layout and add components.
        JPanel content = new JPanel();
        content.setLayout(new FlowLayout());
        content.add(new JLabel("Weight in kilograms"));
        content.add(_kgField);
        content.add(new JLabel("Height in meters"));
        content.add(_mField);
        content.add(bmiButton);
        content.add(new JLabel("Your BMI is"));
        content.add(_bmiField);

        //Set the window characteristics.
        setContentPane(content);
        setTitle("Body Mass Index");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        pack();                          // Do layout.
        setLocationRelativeTo(null);     // Center window.
    }

    /******************* inner class BMIListener *********************/
    // Inner class is used to access components.
    // BMI is converted to int to eliminate excess "accuracy".
    private class BMIListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            double kilograms = Double.parseDouble(_kgField.getText());
            double meters    = Double.parseDouble(_mField.getText());
            int    bmi       = (int)computeBMI(kilograms, meters);
            _bmiField.setText("" + bmi);
        }
    }

    //logic method computeBMI
    public static double computeBMI(double weight, double height) {
        return weight / (height * height);
    }
}

Output of Above Java Program









[ Read More ]
Read more...
Tuesday, February 7, 2012

To Demonstate the AWT Frames in Java

Posted by Admin at 3:00 AM – 0 comments
 
Here is a Java Program to Demonstrate the Frame in AWT Java.

import java.awt.*;
import java.awt.event.*;

class MyFrame extends Frame implements WindowListener, ActionListener{
 Button b1,b2,b3,b4,b5;
 public MyFrame(String title) {
  super(title);
  setSize(200,100);
  setVisible(true);
  addWindowListener(this);
  
  setLayout(new BorderLayout());
  b1=new Button("North");
  add(b1,BorderLayout.NORTH);
  b2=new Button("South");
  add(b2,BorderLayout.SOUTH);
  b3=new Button("East");

  add(b3,BorderLayout.EAST);
  b4=new Button("West");
  add(b4,BorderLayout.WEST);
  b5=new Button("Center");
  add(b5,BorderLayout.CENTER);
  b1.addActionListener(this);
  b2.addActionListener(this);
  b3.addActionListener(this);
 }

 public void windowOpened(WindowEvent we){} 
 
 public void windowClosing(WindowEvent we){
  dispose();
 } 
 public void windowClosed(WindowEvent we) {}
 public void windowActivated(WindowEvent we) {}
 public void windowDeactivated(WindowEvent we) {}
 public void windowIconified(WindowEvent we) {}
 public void windowDeiconified(WindowEvent we){} 

 public void actionPerformed(ActionEvent ae) {
  if(ae.getSource()==b1)
   javax.swing.JOptionPane.showMessageDialog(this,"Left");

  if(ae.getSource()==b2)
   javax.swing.JOptionPane.showMessageDialog(this,"Center");

  if(ae.getSource()==b3)
   javax.swing.JOptionPane.showMessageDialog(this,"Right");
 }

 public static void main(String args[]) {
  MyFrame frm=new MyFrame("My Frame");
 }
}

Output of Above Java Program





[ Read More ]
Read more...
Wednesday, January 18, 2012

Create an application with a square window Using Swing Part 4

Posted by Admin at 8:54 AM – 0 comments
 
Add another item to the Edit drop-down menu, which itself has a drop-down menu, and provide
 accelerators for the items in the menu.

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
import java.awt.Toolkit;
import java.awt.Dimension;
import java.awt.BorderLayout;
import static java.awt.event.InputEvent.CTRL_DOWN_MASK;

@SuppressWarnings("serial")
public class SquareWindow extends JFrame {
  public SquareWindow(String title) {
    super(title);

    Toolkit theKit = this.getToolkit();
    Dimension wndSize = theKit.getScreenSize();

    // Calculate window side length as half the screen height
    int size = wndSize.height/2;

    setBounds((wndSize.width - size)/2, (wndSize.height-size)/2,     // Position
                           size, size);              // Size
    addButtons();                              // Add the buttons to the window
    addMenu();                                // Add the menubar & menus
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
  }

  // Creates and adds the buttons to the content pane
  public void addButtons() {
      Box vBox = Box.createVerticalBox();  // Create a box to hold the buttons

      vBox.add(Box.createVerticalStrut(10));     // Start with a strut for spacing
      vBox.add(Box.createVerticalGlue());        // then glue

      // Add the buttons separated by glue
      JButton button = null;;
      for(int i = 1 ; i <= 6 ; i++) {
        vBox.add(button = new JButton("Button" + i));
        vBox.add(Box.createVerticalGlue());
      }
      vBox.add(Box.createVerticalStrut(10));    // Add a strut for end spacing

      // Content pane has BorderLayout by default - add vBox to the WEST
      getContentPane().add(vBox, BorderLayout.WEST);
   }

   public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              SquareWindow myWindow = new SquareWindow("http://java-programs"
                              +"-examples.blogspot.com/");
            }
        });
   }

   // Create and add a  menubar
   private void addMenu() {
      JMenuBar menuBar = new JMenuBar();       // Create the menubar

      // Create the menu headings
      JMenu fileMenu = new JMenu("File");
      JMenu editMenu = new JMenu("Edit");
      JMenu windowMenu = new JMenu("Window");
      JMenu helpMenu = new JMenu("Help");

      // Create menu items to the Edit menu
      JMenuItem cut = new JMenuItem("Cut");
      JMenuItem copy = new JMenuItem("Copy");
      JMenuItem paste = new JMenuItem("Paste");
      JMenuItem selectAll = new JMenuItem("Select All");

      // Create Accelerators
      cut.setAccelerator(KeyStroke.getKeyStroke('X', CTRL_DOWN_MASK));
      copy.setAccelerator(KeyStroke.getKeyStroke('C', CTRL_DOWN_MASK));
      paste.setAccelerator(KeyStroke.getKeyStroke('V', CTRL_DOWN_MASK));
      selectAll.setAccelerator(KeyStroke.getKeyStroke('A', CTRL_DOWN_MASK));

      // Add menu items to the edit menu
      editMenu.add(cut);
      editMenu.add(copy);
      editMenu.add(paste);
      editMenu.addSeparator();
      editMenu.add(selectAll);

      // Create a dropdown menu within the edit dropdown menu
      JMenu findMenu = new JMenu("Find...");
      JMenuItem findInPage = new JMenuItem("In this page");
      JMenuItem findInDoc = new JMenuItem("In the document");
      findInPage.setAccelerator(KeyStroke.getKeyStroke('P', CTRL_DOWN_MASK));
      findInDoc.setAccelerator(KeyStroke.getKeyStroke('D', CTRL_DOWN_MASK));
      findMenu.add(findInPage);
      findMenu.add(findInDoc);
      editMenu.addSeparator();
      editMenu.add(findMenu);

      menuBar.add(fileMenu);
      menuBar.add(editMenu);
      menuBar.add(windowMenu);
      menuBar.add(helpMenu);

      setJMenuBar(menuBar);     // Add the menubar to the window
   }
}


Output of Above Java Program



[ Read More ]
Read more...

Create an application with a square window Using Swing - Creating Menu Part 3

Posted by Admin at 8:37 AM – 0 comments
 
 Add a menu bar containing the items File, Edit, Window, and Help. to Following Example
Create an application with a square window Using Swing Part 2

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import java.awt.Toolkit;
import java.awt.Dimension;
import java.awt.BorderLayout;

@SuppressWarnings("serial")
public class SquareWindow extends JFrame {
  public SquareWindow(String title) {
    super(title);

    Toolkit theKit = this.getToolkit();
    Dimension wndSize = theKit.getScreenSize();

    // Calculate window side length as half the screen height
    int size = wndSize.height/2;

    setBounds((wndSize.width - size)/2, (wndSize.height-size)/2,   // Position
                           size, size);                         // Size
    addButtons();                                 // Add the buttons to the window
    addMenu();                               // Add the menubar & menus
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
  }

  // Creates and adds the buttons to the content pane
  public void addButtons() {
      Box vBox = Box.createVerticalBox();  // Create a box to hold the buttons

      vBox.add(Box.createVerticalStrut(10));       // Start with a strut for spacing
      vBox.add(Box.createVerticalGlue());            // then glue

      // Add the buttons separated by glue
      JButton button = null;;
      for(int i = 1 ; i <= 6 ; i++) {
        vBox.add(button = new JButton("Button" + i));
        vBox.add(Box.createVerticalGlue());
      }
      vBox.add(Box.createVerticalStrut(10));   // Add a strut for end spacing

      // Content pane has BorderLayout by default - add vBox to the WEST
      getContentPane().add(vBox, BorderLayout.WEST);
   }

   public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              SquareWindow myWindow = new SquareWindow("http://java-programs"
                              +"-examples.blogspot.com/");
            }
        });
   }

   // Create and add a  menubar
   private void addMenu() {
      JMenuBar menuBar = new JMenuBar();      // Create the menubar

      // Create the menu headings
      JMenu fileMenu = new JMenu("File");
      JMenu editMenu = new JMenu("Edit");
      JMenu windowMenu = new JMenu("Window");
      JMenu helpMenu = new JMenu("Help");

      menuBar.add(fileMenu);
      menuBar.add(editMenu);
      menuBar.add(windowMenu);
      menuBar.add(helpMenu);

      setJMenuBar(menuBar);           // Add the menubar to the window
   }
}


Output of Above Java Program



[ Read More ]
Read more...

Create an application with a square window Using Swing Part 2

Posted by Admin at 8:08 AM – 0 comments
 
 Add six buttons to the application in the Following example in a vertical column on the left side of the application window.
Create an application with a square window Using Swing Part 1
Modification of this example is highlighted Here

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.Box;
import javax.swing.JButton;
import java.awt.Toolkit;
import java.awt.Dimension;
import java.awt.BorderLayout;

@SuppressWarnings("serial")
public class SquareWindow extends JFrame {
  public SquareWindow(String title) {
    super(title);

    Toolkit theKit = this.getToolkit();
    Dimension wndSize = theKit.getScreenSize();

    // Calculate window side length as half the screen height
    int size = wndSize.height/2;

    setBounds((wndSize.width - size)/2, (wndSize.height-size)/2,    // Position
                           size, size);         // Size
    addButtons();                              // Add the buttons to the window
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
  }

  // Creates and adds the buttons to the content pane
  public void addButtons() {
      Box vBox = Box.createVerticalBox();       // Create a box to hold the buttons

      vBox.add(Box.createVerticalStrut(10));    // Start with a strut for spacing
      vBox.add(Box.createVerticalGlue());      // then glue
      // Add the buttons separated by glue
      JButton button = null;;
      for(int i = 1 ; i <= 6 ; i++) {
        vBox.add(button = new JButton("Button" + i));
        vBox.add(Box.createVerticalGlue());
      }
      vBox.add(Box.createVerticalStrut(10));     // Add a strut for end spacing

      // Content pane has BorderLayout by default - add vBox to the WEST
      getContentPane().add(vBox, BorderLayout.WEST);
   }

   public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              SquareWindow myWindow = new SquareWindow("http://java-programs"
                              +"-examples.blogspot.com/");
            }
        });
   }
}


Output of Above Java Program



[ Read More ]
Read more...

Create an application with a square window Using Swing Part 1

Posted by Admin at 4:28 AM – 0 comments
 
Create an application with a square window in the center of the screen that is half the height of the screen by deriving your own window class from JFrame.

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import java.awt.Toolkit;
import java.awt.Dimension;

@SuppressWarnings("serial")
public class SquareWindow extends JFrame {
  public SquareWindow(String title) {
    super(title);

    Toolkit theKit = this.getToolkit();
    Dimension wndSize = theKit.getScreenSize();

    // Calculate window side length as half the screen height
    int size = wndSize.height/2;

    setBounds((wndSize.width - size)/2, (wndSize.height-size)/2,               // Position
                           size, size);                                        // Size

    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
  }

   public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              SquareWindow myWindow = new SquareWindow("http://java-programs-examples.blogspot.com/");
            }
        });
   }
}


Output of Above Java Program



[ Read More ]
Read more...
Older Posts
Subscribe to: Posts ( Atom )

List of Java Programs

  • Java Program to check Greater between the Two Number
  • Java Program to find that given number is Palindrome or not
  • Java Program to Demonstrate the Use of Pre and Post Operator
  • Java Program to Reverse the Given Number
  • Java Program to Print Number in the Given Data Type
  • Program to Demonstrate Skipping using Continue
  • Program to find whether entered character is a vowel or Consonant
  • Java Program to Calculate the Sum of Digits of Given Number
  • How to swap two numbers using only two variables
  • Checking the Given Number is Armstrong or Not
  • Average an Array of Values
  • Display ASCII Code Instead of Character
  • Comparison of Two Variable using If
  • Printing Table In java using While Loop
  • Generate Random Number Using Math.Random Function
  • To Find roots of Quadratic Equation
  • Performing Arithmetic Opration on Two Variable
  • Concatenation of Two String in Java
  • Command Line Argument in JAVA
  • Java Hello World Program
  • Calculate Circle Perimeter | Java Program
  • Calculate the Area of Circle | Java Program
  • To Find Whether Given Year is a Leap Year or not
  • Popular
  • Recent
  • Archives

Total Pageviews

Sparkline

Followers

Popular Posts of This Week

  • How to Create New Excel Sheet Using JSP
    In this program, we are going to create a new excel sheet using java .You can create any number of new excel sheets in a excel file. ...
  • Java program to create a Binary Heap and Perform various operation
    A binary heap (min-heap) is a complete binary tree with elements from a partially ordered set, such that the element at every node is less ...
  • Parsing CSV file
    It describes, parsing a CSV file without using StringTokenizer in java import java.io.*; public class Test { public static void main(St...
  • Java Stopwatch Implementation
    Java Stopwatch Implementation public class StopWatch implements java.io.Serializable { private long startTime = -1; private long ...
  • How to invoke an applet in JSP page
    This Program contains step by step details from developing an applet to deploying into server. It describes how to invoke an applet in...
  • Authentication through LDAP Exchange Server
    Attached is the class file which contains checkLogin function. Just pass your form file (LoginForm), which contains user credentials, it w...
  • UDP Client Server Communication using Java
    UDP uses a simple transmission model without implicit handshaking dialogues for providing reliability, ordering, or data integrity. Here ...
  • To Sort an Interger Array using Shell Sort
    To Sort an Interger Array using Shell Sort class ShellSort { public static int[] shellSort(int[] array) { int N = array.length; ...
  • Easy Implementation of Dynamic Caching in Web Application
    The Dynamic Cache is part of the IBM solution for improving performance of J2EE web applications running within Web Sphere Application Serv...
  • Program to Create a Rectangle objects defined by Two Points
    Define a class for rectangle objects defined by two points, the top-left and bottom-right corners of the rectangle. Include a constructor t...
Powered by Blogger.

Archives

  • ▼  2014 ( 4 )
    • ▼  August ( 4 )
      • Java program to create a Binary Heap and Perform v...
      • Create an Adjacency matrix Graph and perform Add a...
      • To Sort an Interger Array using Shell Sort
      • Sort an Integer array with Bucket Sort
  • ►  2013 ( 6 )
    • ►  August ( 1 )
    • ►  April ( 5 )
  • ►  2012 ( 673 )
    • ►  November ( 9 )
    • ►  October ( 223 )
    • ►  September ( 272 )
    • ►  August ( 2 )
    • ►  June ( 1 )
    • ►  February ( 67 )
    • ►  January ( 99 )
 

Our Blogs

  • Linux Tutorial
  • C Programming Tutorial

Labels

  • Agile Methodology ( 1 )
  • Algorithm ( 3 )
  • AntiSamy ( 1 )
  • Arithmetic Operation ( 1 )
  • Array Example ( 9 )
  • ArrayList Examples ( 11 )
  • Average an Array of Values ( 1 )
  • Barcode Example ( 1 )
  • Basic Java Programs ( 34 )
  • Bing API Example ( 2 )
  • BitSet Example ( 1 )
  • Boolean Example ( 1 )
  • Bouncy Castle API ( 1 )
  • Break Statement ( 2 )
  • BufferedReader Example ( 2 )
  • Calendar Example ( 1 )
  • Chart Generation Example ( 1 )
  • Command Line Argument ( 1 )
  • Comparator Example ( 1 )
  • Concatenation of String ( 1 )
  • Continue Statement ( 1 )
  • Control Structure ( 1 )
  • Copy File Example ( 1 )
  • CRC Example ( 1 )
  • CSV Example ( 6 )
  • Data Structure ( 5 )
  • Date Example ( 2 )
  • Directory Example ( 1 )
  • Do - While Loop Example ( 1 )
  • Domino Database ( 1 )
  • Email Example ( 8 )
  • Encryption Example ( 3 )
  • Excel Example ( 15 )
  • Factorial Example ( 1 )
  • File Upload Example ( 1 )
  • Find Roots of Quadratic Equation ( 1 )
  • FTP Example ( 2 )
  • Graph Examples ( 1 )
  • Greater between Two Numbers ( 1 )
  • GSON Library ( 1 )
  • HashMap Example ( 1 )
  • HashSet Example ( 1 )
  • Hello World Program ( 1 )
  • If Condition ( 2 )
  • Inner Class Example ( 1 )
  • iText Example ( 3 )
  • JAR File ( 1 )
  • JAVA Applet ( 1 )
  • Java Applications ( 1 )
  • Java AWT Example ( 9 )
  • Java Certification ( 1 )
  • Java Class Examples ( 15 )
  • Java Collection Example ( 1 )
  • Java Command Example ( 4 )
  • Java Constructor Examples ( 1 )
  • Java Currency Example ( 1 )
  • Java Database Example ( 3 )
  • Java Date and Time Example ( 3 )
  • Java DateFormat Example ( 3 )
  • Java Examples ( 2 )
  • Java Exception Example ( 5 )
  • Java File Example ( 22 )
  • Java GUI Example ( 1 )
  • Java Image Examle ( 3 )
  • Java Inheritance Example ( 3 )
  • Java Input Output Example ( 1 )
  • Java IO Example ( 3 )
  • Java Jar Example ( 1 )
  • Java JSON Example ( 3 )
  • Java Mail Examples ( 4 )
  • Java Map Example ( 5 )
  • Java MapReduce Example ( 2 )
  • Java MultiThreading Example ( 7 )
  • Java Network Example ( 9 )
  • Java Package ( 1 )
  • Java Programs ( 1 )
  • Java RMI ( 1 )
  • Java Robot Class Examples ( 2 )
  • Java Runtime Example ( 1 )
  • Java Swing Example ( 9 )
  • Java Util Example ( 1 )
  • Java Vector Example ( 4 )
  • Java Voice Example ( 1 )
  • Java Webservice Example ( 1 )
  • Java XML Example ( 3 )
  • Java Zip Class Examples ( 2 )
  • JDBC ( 9 )
  • JDK Version Comparison ( 1 )
  • JFrame Example ( 3 )
  • JOptionPane Dialog Example ( 1 )
  • JPanel Example ( 1 )
  • JSP Example ( 2 )
  • JSTL Example ( 1 )
  • jUnit Example ( 2 )
  • LinkedList Example ( 2 )
  • List Example ( 1 )
  • Long Variable ( 1 )
  • Lottery Nubmer ( 1 )
  • MD5 Hashing Example ( 3 )
  • Memory Management Example ( 1 )
  • Method Override ( 1 )
  • MIDI Sound ( 8 )
  • Module Operator Example ( 2 )
  • Multiplication Table ( 1 )
  • Observer Interface Example ( 1 )
  • Operator Example ( 5 )
  • Pagination ( 1 )
  • Palindrome Number ( 1 )
  • Pass By Reference Example ( 1 )
  • Pass By Value Example ( 1 )
  • PDF File Example ( 3 )
  • PDF Generation Example ( 4 )
  • Pre and Post Operator ( 2 )
  • Prime Number ( 3 )
  • Progress Bar Example ( 1 )
  • Property List Example ( 2 )
  • Random Function ( 7 )
  • Recursion Example ( 2 )
  • Regex Example ( 2 )
  • Remote Host Example ( 2 )
  • Robot Class ( 4 )
  • Searching Example ( 3 )
  • Slideshow ( 1 )
  • Sorting Example ( 7 )
  • SpringLayout Example ( 1 )
  • Stack Example ( 4 )
  • Static Variable ( 1 )
  • StreamTokenizer Example ( 2 )
  • String Example ( 19 )
  • Struts2 Example ( 1 )
  • Sum of Digits ( 1 )
  • Swap Two Numbers ( 1 )
  • Switch Case ( 3 )
  • Tapestry Components ( 1 )
  • Thumbnail Example ( 2 )
  • TimerTask Example ( 2 )
  • To Calculate Volume ( 1 )
  • To Check Armstrong Number ( 1 )
  • Tree Example ( 1 )
  • TreeMap Example ( 1 )
  • TreeSet Example ( 1 )
  • Two Dimensional Array Example ( 1 )
  • UUID ( 1 )
  • Validation Example ( 2 )
  • Variable Casting ( 1 )
  • While Loop ( 1 )
  • XML Parsing ( 7 )
  • XSS Attacks ( 1 )
  • Zip File ( 15 )

Popular Posts

  • Java program to create a Binary Heap and Perform various operation
    A binary heap (min-heap) is a complete binary tree with elements from a partially ordered set, such that the element at every node is less ...
  • Java Class to Calculate the Volume of Box
    Here is a Java Class to Calculate the Volume of Box. class Box { double width; double height; double depth; // This is the con...
  • To Sort an Interger Array using Shell Sort
    To Sort an Interger Array using Shell Sort class ShellSort { public static int[] shellSort(int[] array) { int N = array.length; ...
  • Implementation of a basic generic tree, with labels of type T - Data Structure
    // This implements a basic generic tree, with labels of type T, // pointer to the parent node, and a singly linked list of children nodes...
  • Merge-Sort Algorithm implementation in JAVA
    Merge-Sort Function void MergeSort(int low, int high) // a[low : high] is a global array to be sorted. // Small(P) is true if there...
  • Create an Adjacency matrix Graph and perform Add and Remove operation
    import java.util.ArrayList; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue; import...
  • writes file content to a Database CLOB
    This utility tool writes file content to a Database CLOB . The tool reads the list of files , creates CLOB of the files and updates the ...
  • Stack implemented as array - Data Structure
    // Stack implemented as array public class ArrayStack<T> { private T[] stack; private int numElements = 0; // points to s...
  • Sort an Integer array with Bucket Sort
    Here is a java program to Sort an Integer array with Bucket Sort class BucketSort { public int[] bucketSort(int[] array) { /...
  • Printing Table In java using While Loop
    Here is a Java Program to Print the Table public class Table { public static void main(String[] args) { int no = Integer.p...
 
 
© 2011 Java Programs and Examples with Output | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger