<div style='background-color: none transparent;'></div>

World News

Entertainment

Bubble Sort in Java

Here is a simple program to sort numbers in ascending as well as descending order using bubble sort

import java.io.*;

public class Bubble {

static int arr[] = new int[5];
static String str[] = new String[5];

static void display()
{
for(int i=0;i<arr.length;i++)
{
System.out.print(" "+arr[i]);
}
}

public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub

System.out.println("Enter 5 numbers to sort : ");
for(int i=0,j=1;i<arr.length;i++)
{
System.out.print(j+") ");
str[i] = new BufferedReader(new InputStreamReader(System.in)).readLine();
j++;
}
for(int i=0;i<str.length;i++)
{
String str1 = str[i];
int val = Integer.parseInt(str1);
arr[i] = val;
}
display();

System.out.print("
Select Sorting Order (ascending(a)/descending(d) : ");
String str2 = new BufferedReader(new InputStreamReader(System.in)).readLine();
if(str2.equalsIgnoreCase("a"))
{
for(int i=0;i<=arr.length-1;i++)
{
for(int j=0;j<=arr.length-1;j++)
{
if(arr[i] < arr[j])
{
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
}
}
display();
}
if(str2.equalsIgnoreCase("d"))
{
for(int i=0;i<=arr.length-1;i++)
{
for(int j=0;j<=arr.length-1;j++)
{
if(arr[i] > arr[j])
{
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
}
}
display();
}
}
}
Continue Reading | comments

Creating a Log file

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class ErrorLog
{
private static ErrorLog singleton=new ErrorLog();
private PrintWriter writer;
private static SimpleDateFormat sdf = null;
private static String dateaTime = null;

private ErrorLog()
{
String dirPath="D:/tests";
try
{
if (dirPath!=null)
{
writer = new PrintWriter(new FileOutputStream("D:/tests/file.log", true), true);
}
else
{
System.out.println("Fatal error, can~t create error log.");
}
}
catch (IOException exp)
{
System.out.println("Fatal error, can~t create error log - "+exp.getMessage());
exp.printStackTrace();
}
}


public static synchronized void log(String toLog)
{
try
{
sdf = new SimpleDateFormat("yyyy~ ~MM~ ~dd~ ~ hh:mm:ss aaa");
dateaTime = sdf.format((Calendar.getInstance().getTime()));

System.out.println("dateaTime"+dateaTime);
singleton.writer.write(dateaTime+" --> ");
singleton.writer.write(toLog);
singleton.writer.write("\n");
singleton.writer.flush();
}
catch (Exception exp)
{
System.out.println("Fatal error, can~t write to log - "+exp.getMessage());
exp.printStackTrace();
}
}
}

/*
usage: ErrorLog.log("my string message");
*/


Continue Reading | comments

Reverse the characters of a given string

Reverse the characters of a given string




public class Temp {

public static void main(String[] args) {

String a = "Hello Java Galaxy";
System.out.println("
Original string: " + a);

StringBuffer b = new StringBuffer(a).reverse();
System.out.println("Reverse character string: " + b);

System.out.println("
");

}

}
Continue Reading | comments

Count total number of occurences of a String in a text file





/**
Count total number of occurrences of a String and print the line numbers that have
matched the user "search criteria"

Searching for "good bye" is hardcoded in this file
*/

import java.io.File;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;

public class WordCounter {
public static void main(String args[]) throws Exception {
if(args.length != 1) {
System.out.println("Invalid number of arguments!");
return;
}
String sourcefile = args[0];
String searchFor = "good bye";
int searchLength=searchFor.length();
String thisLine;
try {
BufferedReader bout = new BufferedReader (new FileReader (sourcefile));
String ffline = null;
int lcnt = 0;
int searchCount = 0;
while ((ffline = bout.readLine()) != null) {
lcnt++;
for(int searchIndex=0;searchIndex int index=ffline.indexOf(searchFor,searchIndex);
if(index!=-1) {
System.out.println("Line number " + lcnt);
searchCount++;
searchIndex+=index+searchLength;
} else {
break;
}
}
}
System.out.println("SearchCount = "+searchCount);
} catch(Exception e) {
System.out.println(e);
}
}
}

Continue Reading | comments

Get Stack trace into a string

import java.io.PrintWriter;


import java.io.StringWriter;

public class Temp {
public static void main(String args[]) {
try {
int x = 10 / 0;
} catch (Exception e) {
StringWriter writer = new StringWriter();
e.printStackTrace(new PrintWriter(writer));
String trace = writer.toString();
System.out.println(trace);
}
}


}
Continue Reading | comments

Viewing txt files on command prompt




---------------


import java.io.*;

public class File1
{
public static void main (String[] args)
{
String file_name;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter file name eg: (d:\\test.txt) ");
try
{
file_name = br.readLine(); // getting file name from user
InputStream fileIn = new FileInputStream(file_name);
File ff = new File(file_name);
long lon_size = ff.length(); //getiing the length of the file
int buff_size = (int)lon_size;
System.out.println("Size of File " + lon_size);
byte buff[] = new byte[buff_size];
int i = fileIn.read(buff);
String s = new String(buff);
System.out.println(s);
}

catch(FileNotFoundException e)
{
System.out.println("File not found.");
}

catch(IOException e)
{
e.printStackTrace();
}

} //main
}//class


-----------------


Continue Reading | comments

Calender in java




-------------------
import java.util.*;

public class DemoCalendar{
public static void main(String args[]){
String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);

if (ids.length == 0)
System.exit(0);

// begin output
System.out.println("Current Time");

// create a Pacific Standard Time time zone
SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);

// set up rules for daylight savings time
pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);

// create a GregorianCalendar with the Pacific Daylight time zone
// and the current date and time
Calendar calendar = new GregorianCalendar(pdt);
Date trialTime = new Date();
calendar.setTime(trialTime);

// print out a bunch of interesting things
System.out.println("ERA: " + calendar.get(Calendar.ERA));
System.out.println("YEAR: " + calendar.get(Calendar.YEAR));
System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
System.out.println("WEEK_OF_YEAR: " + calendar.get(Calendar.WEEK_OF_YEAR));
System.out.println("WEEK_OF_MONTH: " + calendar.get(Calendar.WEEK_OF_MONTH));
System.out.println("DATE: " + calendar.get(Calendar.DATE));
System.out.println("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
System.out.println("DAY_OF_YEAR: " + calendar.get(Calendar.DAY_OF_YEAR));
System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
System.out.println("DAY_OF_WEEK_IN_MONTH: "
+ calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
System.out.println("AM_PM: " + calendar.get(Calendar.AM_PM));
System.out.println("HOUR: " + calendar.get(Calendar.HOUR));
System.out.println("HOUR_OF_DAY: " + calendar.get(Calendar.HOUR_OF_DAY));
System.out.println("MINUTE: " + calendar.get(Calendar.MINUTE));
System.out.println("SECOND: " + calendar.get(Calendar.SECOND));
System.out.println("MILLISECOND: " + calendar.get(Calendar.MILLISECOND));
System.out.println("ZONE_OFFSET: "
+ (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000)));
System.out.println("DST_OFFSET: "
+ (calendar.get(Calendar.DST_OFFSET)/(60*60*1000)));

System.out.println("Current Time, with hour reset to 3");
calendar.clear(Calendar.HOUR_OF_DAY); // so doesn't override
calendar.set(Calendar.HOUR, 3);
System.out.println("ERA: " + calendar.get(Calendar.ERA));
System.out.println("YEAR: " + calendar.get(Calendar.YEAR));
System.out.println("MONTH: " + calendar.get(Calendar.MONTH));
System.out.println("WEEK_OF_YEAR: " + calendar.get(Calendar.WEEK_OF_YEAR));
System.out.println("WEEK_OF_MONTH: " + calendar.get(Calendar.WEEK_OF_MONTH));
System.out.println("DATE: " + calendar.get(Calendar.DATE));
System.out.println("DAY_OF_MONTH: " + calendar.get(Calendar.DAY_OF_MONTH));
System.out.println("DAY_OF_YEAR: " + calendar.get(Calendar.DAY_OF_YEAR));
System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));
System.out.println("DAY_OF_WEEK_IN_MONTH: "
+ calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
System.out.println("AM_PM: " + calendar.get(Calendar.AM_PM));
System.out.println("HOUR: " + calendar.get(Calendar.HOUR));
System.out.println("HOUR_OF_DAY: " + calendar.get(Calendar.HOUR_OF_DAY));
System.out.println("MINUTE: " + calendar.get(Calendar.MINUTE));
System.out.println("SECOND: " + calendar.get(Calendar.SECOND));
System.out.println("MILLISECOND: " + calendar.get(Calendar.MILLISECOND));
System.out.println("ZONE_OFFSET: "
+ (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000))); // in hours
System.out.println("DST_OFFSET: "
+ (calendar.get(Calendar.DST_OFFSET)/(60*60*1000))); // in hours
}
}




Continue Reading | comments

price calculation



public class FinalPrice{
private static double percent_markedup= 25;
private static double original_price = 100;
private static double sales_tax_rate = 2;

public void calculatePrice(){
double storeSalPrice = original_price*percent_markedup/100;
double tempSalPrice = original_price+storeSalPrice;
double tempTaxPrice = tempSalPrice*sales_tax_rate/100;
double taxSalPrice = tempSalPrice+tempTaxPrice;
double finalPrice = tempSalPrice+tempTaxPrice;
System.out.println("The original price="+original_price);
System.out.println("The markedup percentage="+percent_markedup);
System.out.println("The store Selling price="+tempSalPrice);
System.out.println("The sales tax rate="+ sales_tax_rate);
System.out.println("The sales tax price="+ tempTaxPrice);
System.out.println("The final Price="+ finalPrice);
}
public static void main(String args[]){
FinalPrice finalPrice = new FinalPrice();
finalPrice.calculatePrice();
}
}


Continue Reading | comments

Pattern printing in java simple




public class Print{
public static void main(String[] args){
int i=1;
int j;
while(i<=7){
for(j=1;j<=i;j++)
System.out.print("*");
i=i+2;
System.out.println();
}
i=5;
while(i>=1){
for(j=1;j<=i;j++)
System.out.print("*");
i=i-2;
System.out.println();
}
}
}


Continue Reading | comments

Getting Started with Java




A Java program is a collection of one or more java classes. A Java source file can contain more than one class definition and has a .java extension. Each class definition in a source file is compiled into a separate class file. The name of this compiled file is comprised of the name of the class with .class as an extension. Before we proceed further in this section, I would recommend you to go through the ‘Basic Language Elements’.

Below is a java sample code for the traditional Hello World program. Basically, the idea behind this Hello World program is to learn how to create a program, compile and run it. To create your java source code you can use any editor( Text pad/Edit plus are my favorites) or you can use an IDE like Eclipse.

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}//End of main
}//End of HelloWorld Class

Output
Hello World




Compiling and Running an Application

To compile and run the program you need the JDK distributed by Sun Microsystems. The JDK contains documentation, examples, installation instructions, class libraries and packages, and tools. Download an editor like Textpad/EditPlus to type your code. You must save your source code with a .java extension. The name of the file must be the name of the public class contained in the file.

Steps for Saving, compiling and Running a Java

Step 1:Save the program With .java Extension.
Step 2:Compile the file from DOS prompt by typing javac .
Step 3:Successful Compilation, results in creation of .class containing byte code
Step 4:Execute the file by typing java



PATH and CLASSPATH

The following are the general programming errors, which I think every beginning java programmer would come across. Here is a solution on how to solve the problems when running on a Microsoft Windows Machine.

1. ‘javac’ is not recognized as an internal or external command, operable program or batch file

When you get this error, you should conclude that your operating system cannot find the compiler (javac). To solve this error you need to set the PATH variable.

How to set the PATH Variable?

Firstly the PATH variable is set so that we can compile and execute programs from any directory without having to type the full path of the command. To set the PATH of jdk on your system (Windows XP), add the full path of the jdk\bin directory to the PATH variable. Set the PATH as follows on a Windows machine:

a. Click Start > Right Click “My Computer” and click on “Properties”
b. Click Advanced > Environment Variables.
c. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:

C:\jdk\bin (jdk
If there are already some entries in the PATH variable then you must add a semicolon and then add the above value (Version being replaced with the version of JDK). The new path takes effect in each new command prompt window you open after setting the PATH variable.

2. Exception in thread “main” java.lang.NoClassDefFoundError: HelloWorld

If you receive this error, java cannot find your compiled byte code file, HelloWorld.class.If both your class files and source code are in the same working directory and if you try running your program from the current working directory than, your program must get executed without any problems as, java tries to find your .class file is your current directory. If your class files are present in some other directory other than that of the java files we must set the CLASSPATH pointing to the directory that contain your compiled class files.CLASSPATH can be set as follows on a Windows machine:

a. Click Start > Right Click “My Computer” and click on “Properties”
b. Click Advanced > Environment Variables.

Add the location of classes’ folder containing all your java classes in User Variables.

If there are already some entries in the CLASSPATH variable then you must add a semicolon and then add the new value . The new class path takes effect in each new command prompt window you open after setting the CLASSPATH variable.

Java 1.5

The Java 1.5 released in September 2004.

Goals

Less code complexity
Better readability
More compile-time type safety
Some new functionality (generics, scanner)

New Features

Enhanced for loop
Enumerated types
Autoboxing & unboxing
Generic types
Scanner
Variable number of arguments (varargs)
Static imports
Annotations


Continue Reading | comments

AIRLINE RESERVATION SYSTEM

PROJECT : AIRLINE RESERVATION SYSTEM
PART 1 : PROJECT DETAILS
PART 2 :MAINMENU MODULE
PART 3 : Reservation MODULE
PART 4 : TICKET MODULE
PART 5: WAITING MODULE
PART 6 : WARNING MODULE
PART 7: CONFIRM MODULE
THE COMPLETE SOURCE CODE OF CONFIRM MODULE IS HERECREATE A JAVA FILE NAMED CONFIRM .java AND COPY THE below

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

public class Confirmed extends Frame
{
Confirmed()
{
addWindowListener(new W());
}
class W extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
setVisible(false);
//dispose();
System.exit(0);

}
}
}


Continue Reading | comments

payroll using java free java academic project download module 1. class MainMenu



import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Toolkit;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.text.DateFormat;
import java.util.Date;
import java.text.*;
import java.lang.*;
import java.beans.PropertyVetoException;


public class MainMenu extends JFrame implements ActionListener{
JDesktopPane desktop = new JDesktopPane();
String sMSGBOX_TITLE = "Payroll System V. 1.0";


// Menu Bar Variables

JMenuBar menubar = new JMenuBar();

JMenu menuFile = new JMenu("File");
JMenu menuEmployee = new JMenu("Employee");
JMenu menuTools = new JMenu("Tools");
JMenu menuReports = new JMenu("Reports");
JMenu menuHelp = new JMenu("Help");

// Menu Item

JMenuItem itemExit = new JMenuItem();

JMenuItem itemAdd = new JMenuItem();
JMenuItem itemEdit = new JMenuItem();
JMenuItem itemDelete = new JMenuItem();

JMenuItem itemSettings = new JMenuItem();
JMenuItem itemCalculator = new JMenuItem();
JMenuItem itemNotePad = new JMenuItem();

JMenuItem itemEmprpt = new JMenuItem();

JMenuItem itemAuthor = new JMenuItem();
JMenuItem itemHelp = new JMenuItem();



// JPanel

JPanel panel_Bottom = new JPanel();
JPanel panel_Top = new JPanel();

// Label

JLabel lblUsername = new JLabel("User Name:");
JLabel lblLogDetails = new JLabel("Time Login :");
JLabel lblTimeNow = new JLabel();

// TextField
JTextField username = new JTextField();
JTextField logtime = new JTextField();

// JInternalFrame variables

Addwindow FormAddwindow;
Editwindow FormEditwindow;
Deletewindow FormDeletewindow;
//Settingswindow FormSettingswindow;



Emprptwindow FormEmprptwindow;

Settingswindow FormSettingswindow;

Authorwindow FormAuthorwindow;
Helpwindow FormHelpwindow;

// Connection Variables

Connection conn;

// Date variables

static Date td = new Date();

// String Variables

static Statement stmtLogin;


//Class Variables
clsSettings settings = new clsSettings();

//// User Details
static String sUser = "";
static String sLogin = DateFormat.getDateTimeInstance().format(td);


public MainMenu(String user, Date date) {
super("PayRoll Accounting System [Version 1.0]");
sUser = user;
td = date;

JTextField username = new JTextField();
username.setEditable(false);
JTextField logtime = new JTextField();
logtime.setEditable(false);
username.setText(sUser);
logtime.setText(sLogin);

panel_Bottom.setLayout(new FlowLayout());
panel_Bottom.setPreferredSize(new Dimension(10,25));
// panel_Bottom.add(lblUserIcon);
panel_Bottom.add(lblUsername);
panel_Bottom.add(username);
panel_Bottom.add(lblLogDetails);
panel_Bottom.add(logtime);


panel_Top.setLayout(new BorderLayout());
panel_Top.setPreferredSize(new Dimension(10,65));
panel_Top.add(createJToolBar(),BorderLayout.PAGE_START);

desktop.setBackground(Color.WHITE);
desktop.setAutoscrolls(true);
desktop.setBorder(BorderFactory.createLoweredBevelBorder());
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);

getContentPane().add(panel_Top,BorderLayout.PAGE_START);
getContentPane().add(desktop,BorderLayout.CENTER);
getContentPane().add(panel_Bottom,BorderLayout.PAGE_END);



addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent e)
{
UnloadWindow();
}
});

setJMenuBar(CreateJMenuBar());
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setIconImage(new ImageIcon("images/Business.png").getImage());
setSize(700,700);
setLocation(2,2);
show();

}

protected JMenuBar CreateJMenuBar()
{


// creating Submenu
// Menu File
menuFile.add(settings.setJMenuItem(itemExit,"Quit","images/exit.png"));

itemExit.addActionListener(this);

// MEnu Employee
menuEmployee.add(settings.setJMenuItem(itemAdd,"Add Employee","images/employee.png"));
menuEmployee.add(settings.setJMenuItem(itemEdit,"Edit Employee","images/edit.png"));
menuEmployee.addSeparator();
menuEmployee.add(settings.setJMenuItem(itemDelete,"Delete Employee","images/delete.png"));


itemAdd.addActionListener(this);
itemEdit.addActionListener(this);
itemDelete.addActionListener(this);

// setting tool bar
menuTools.add(settings.setJMenuItem(itemSettings,"Settings","images/setting.png"));
menuTools.add(settings.setJMenuItem(itemCalculator,"Calculator","images/calc.png"));
menuTools.addSeparator();
menuTools.add(settings.setJMenuItem(itemNotePad,"NotePad","images/notepad.png"));


itemSettings.addActionListener(this);
itemCalculator.addActionListener(this);
itemNotePad.addActionListener(this);

// setting Reports bar

menuReports.add(settings.setJMenuItem(itemEmprpt,"Employee Report","images/emp_rpt.png"));
menuTools.addSeparator();
menuTools.addSeparator();
itemEmprpt.addActionListener(this);

// setting Help

menuHelp.add(settings.setJMenuItem(itemAuthor,"About Author","images/xp.png"));
menuHelp.add(settings.setJMenuItem(itemHelp,"Help","images/help.png"));

itemAuthor.addActionListener(this);
itemHelp.addActionListener(this);

// adding menuitem to menubar

menubar.add(settings.setJMenu(menuFile));
menubar.add(settings.setJMenu(menuEmployee));
menubar.add(settings.setJMenu(menuTools));
menubar.add(settings.setJMenu(menuReports));
menubar.add(settings.setJMenu(menuHelp));
return menubar;

}

protected JToolBar createJToolBar()
{
JToolBar toolbar = new JToolBar("Toolbar");

toolbar.add(settings.CreateJToolbarButton("Exit", "images/exit.png", "File_Exit",
JToolBarActionListener));
toolbar.addSeparator();
toolbar.addSeparator();

toolbar.add(settings.CreateJToolbarButton("Add - Employee", "images/employee.png", "Emp_Add",
JToolBarActionListener));

toolbar.add(settings.CreateJToolbarButton("Edit - Employee", "images/edit.png", "Emp_Edit",
JToolBarActionListener));
toolbar.addSeparator();

toolbar.add(settings.CreateJToolbarButton("Delete - Employee", "images/delete.png","Emp_Delete",
JToolBarActionListener));
toolbar.addSeparator();
toolbar.addSeparator();



toolbar.add(settings.CreateJToolbarButton("Employee Position Settings", "images/setting.png","Settings",
JToolBarActionListener));
toolbar.add(settings.CreateJToolbarButton("Calculator", "images/calc.png","Tools_Calculator",
JToolBarActionListener));
toolbar.add(settings.CreateJToolbarButton("NotePad", "images/notepad.png","Tools_NotePad",
JToolBarActionListener));
toolbar.addSeparator();
toolbar.addSeparator();


toolbar.add(settings.CreateJToolbarButton("Employee - Report", "images/emp_rpt.png","Reports_Employee",
JToolBarActionListener));



toolbar.add(settings.CreateJToolbarButton("Help - Author", "images/xp.png","Help_Author",
JToolBarActionListener));

toolbar.add(settings.CreateJToolbarButton("Help - Help", "images/help.png","Help_Help",
JToolBarActionListener));
return toolbar;

}

ActionListener JToolBarActionListener = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String source = e.getActionCommand();

if (source == "File_Exit")
{
loadJInternalFrame(2);
}
else if (source == "Emp_Add")
{
loadJInternalFrame(3);
}
else if (source == "Emp_Edit")
{
loadJInternalFrame(4);
}
else if (source == "Emp_Delete")
{
loadJInternalFrame(5);
}
else if (source == "Settings")
{
loadJInternalFrame(6);
}
else if (source == "Tools_Calculator")
{
loadJInternalFrame(7);
}
else if (source == "Tools_NotePad")
{
loadJInternalFrame(8);
}
else if (source == "Reports_Employee")
{
loadJInternalFrame(9);
}

else if (source == "Help_Author")
{
loadJInternalFrame(11);
}
else if (source == "Help_Help")
{
loadJInternalFrame(12);
}
}

};


public void actionPerformed(ActionEvent event)
{
Object object = event.getSource();

if (object == itemExit)
{
loadJInternalFrame(2);
}
else if (object == itemAdd)
{
loadJInternalFrame(3);
}
else if ( object == itemEdit)
{
loadJInternalFrame(4);
}
else if (object == itemDelete)
{
loadJInternalFrame(5);
}
else if (object == itemSettings)
{
loadJInternalFrame(6);
}
else if (object == itemCalculator)
{
loadJInternalFrame(7);

}
else if (object == itemNotePad)
{
loadJInternalFrame(8);
}
else if (object == itemEmprpt)
{
loadJInternalFrame(9);
}

else if (object == itemAuthor)
{
loadJInternalFrame(12);
}
else if (object == itemHelp)
{
loadJInternalFrame(13);
}
}
private void loadJInternalFrame(int intWhich)
{
switch(intWhich)
{

case 2:
System.exit(0);
break;

case 3:
try {
FormAddwindow = new Addwindow(this);
loadForm("Add Employee", FormAddwindow);
}
catch(Exception e)
{
System.out.println("\nError");
}
break;

case 4:
try {
FormEditwindow = new Editwindow(this);
loadForm("Edit Employee", FormEditwindow);
}
catch(Exception e)
{
System.out.println("\nError");
}
break;

case 5:
try {
FormDeletewindow = new Deletewindow(this);
loadForm("Delete Employee", FormDeletewindow);
}
catch(Exception e)
{
System.out.println("\nError");
}
break;

case 6:
try {
FormSettingswindow = new Settingswindow(this);
loadForm("Settings of Employee", FormSettingswindow);
}
catch(Exception e)
{
System.out.println("\nError");
}
break;

case 7:
runComponents("Calc.exe");
break;

case 8:
runComponents("Notepad.exe");
break;

case 9:
try{
FormEmprptwindow = new Emprptwindow(this);
loadForm("Employee PaySlip", FormEmprptwindow);

}
catch(Exception e)
{
System.out.println("\nError" + e );
}
break;


case 12:
//FormAuthorwindow = new Authorwindow(this);
break;

case 13:
//FormHelpwindow = new Helpwindow(this);
break;


}

}
protected void runComponents(String sComponents)
{
Runtime rt = Runtime.getRuntime();
try{rt.exec(sComponents);}
catch(IOException evt){JOptionPane.showMessageDialog(null,evt.getMessage(),"Error Found",JOptionPane.ERROR_MESSAGE);}
}

protected void loadForm(String Title, JInternalFrame clsForm)
{

boolean xForm = isLoaded(Title);
if (xForm == false)
{
desktop.add(clsForm);
clsForm.setVisible(true);
clsForm.show();
}
else
{
try {
clsForm.setIcon(false);
clsForm.setSelected(true);

}
catch(PropertyVetoException e)
{}
}
} // Complete Load Form methode


protected boolean isLoaded(String FormTitle)
{
JInternalFrame Form[] = desktop.getAllFrames();
for ( int i = 0; i < Form.length; i++)
{
if (Form[i].getTitle().equalsIgnoreCase(FormTitle))
{
Form[i].show();
try
{
Form[i].setIcon(false);
Form[i].setSelected(true);

}
catch(PropertyVetoException e)
{

}
return true;
}
}
return false;
} // Complete to Verify Form loaded or not

protected void UnloadWindow()
{
try
{
int reply = JOptionPane.showConfirmDialog(this,"Are you sure to exit?",sMSGBOX_TITLE,JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE);
if (reply == JOptionPane.YES_OPTION)
{

setVisible(false);
System.exit(0);
}
}
catch(Exception e)
{}

}// Close the Windows


public static void setlogin(String sUsername, Date sDate)
{
sUser = sUsername;
td = sDate;


}//Set Login





}
--------


Continue Reading | comments

online banking system java file - class ADetail

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;

public class logincheck1 extends HttpServlet{
Connection con;
Statement st;
ResultSet rs;

public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:bank");
st=con.createStatement();

int rano=Integer.parseInt(req.getParameter("accno"));
String ruid=req.getParameter("usrid");
String rupwd=req.getParameter("pswrd");

rs=st.executeQuery("SELECT * FROM USERTAB WHERE ACCOUNTNO="+rano+" AND USERID=\'"+ruid+"\' AND USERPWD=\'"+rupwd+"\'");
if (rs.next()){
res.setContentType("text/html");
PrintWriter out=res.getWriter();

String lname=rs.getString("lastname");
String fname=rs.getString("firstname");

out.println("Welcome Page");
out.println("

");
out.println("Welcome");
out.println(fname+" "+lname);
out.println("

");
out.println("");
out.println("Thank you for banking with us.

");
out.println("

Remember your Account No, User ID and Password.");
out.println("

");
out.println("

Your Account Number is :");
out.println(" ");
out.println(rano);
out.println("

");
out.println("

Your User ID is ");
out.println(" : ");
out.println(ruid);
out.println("

");
out.println("

Please click below to proceed

");
out.println("

");
out.println("Consumer Banking

");
}
else
res.sendRedirect("http:\\\\localhost:8080\\examples\\servlets\\login1.html");
}
catch(SQLException sqle4){
System.out.println("Sql Exception "+sqle4); }

catch(ClassNotFoundException cnfe){
System.out.println("Class Not Found "+cnfe);
}
}//END OF doPost
}

Continue Reading | comments

how to configure this online banking using java academic project in your tomcat server

configuring tomcat with online banking system academic project
please copy the project folder named "online banking" in your tomacat webapps folder
and please try to connect the the database with your system.please follow the instructions given below.

for establishing database connectivity in windows 98 please do the instruction given below.



http://localhost:8080/online banking/htmls/firstload.html
Continue Reading | comments

Online Banking System academic project in java j2ee btech,mtech.mca,msc,bca,bsc final year project free downloads

online banking System using java/j2ee full source code with documentation free downloads.just click the download link and save in your system and run the project using the help documents inside the rar file which your downloading. step by step procedure to run the project is mentioned in the help documents.and the entire project documentation also inside the rar file. so why you are waiting enjoyyyy!!! this online banking System using java/j2ee can be used for final year academic projects for b.tech,mtech,msc,mca,bca computer science candidates.this free downloadable java jsp academic project is free of cost and it is only for education purpuse .all rights reserved.



Here there are 5 folders:

1. classes
2. htmls
3. obank
4. project document
5. servlets




The classes folder contains the necessary java class files.

The htmls folder contains the necessary html files and an image folder called images.

The obank is the folder that contains the database for the project.

The folder project document contains project report(Covering all Outcomes), onlinebank-details, technical guide and user guide.

The servlets folder contains the java servlet files.



Note:


Whenever copying a file from cd to any other location, by default it has affected by Read-only or archive attribute. After copying the files to the desired locations (mentioned in the user manual) kindly verify whether it has any attribute. Suppose it is selected kindly change it into de-selected (remove the tick mark). Otherwise it will never allow to add a new user in the database, only existing user can be supported by the database.

the main 24 java servlet files used in this online banking system application are given below.

1.class ADetail
2.class Deposit
3.class Loan
4.class OnLineEntry
5.class ProcessDetails
6.class UpdateLoan
7.class UpDepositLoan
8.class ViewLoans
9.class Calc
10.class DepositFixed
11.logincheck1
12.class Option
13.class SendMail
14.UPDeposit
15.UPDetails
16.class Welcome
17.class Cpass
18.class DepositLoan
19.class Mail
20.class Ppass
21.class signup1
22.class UpDepositFixed
23.class ViewDeposits
24.class WithDraw
Continue Reading | comments (11)

how to compile and running java program using bat file and crone tab scheduler

or compile and running a bat file in command prompt open command prompt cd C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\fi_sh\WEB-INF\classes then

step 1: set java home as below
set JAVA_HOME="C:\Program Files\Java\jdk1.5.0"

step 2: compile the jar files and java file as below

%JAVA_HOME%\bin\javac -classpath ../lib/company.jar;../lib/company_db.jar;../lib/project7.jar;../lib/mysql-connector-java-5.1.6-bin.jar;../lib/activation.jar;../lib/mail.jar;../lib/log4j-1.2.15.jar;../lib/smtp.jar;../lib/pop3.jar;. com/company/project/user/ChangePasswordAlert.java



step 3: for running the compiled file as below

%JAVA_HOME%\bin\java -classpath ../lib/company.jar;../lib/company_db.jar;../lib/project7.jar;../lib/mysql-connector-java-5.1.6-bin.jar;../lib/activation.jar;../lib/mail.jar;../lib/log4j-1.2.15.jar;../lib/smtp.jar;../lib/pop3.jar;. com.company.project.user.ChangePasswordAlert "en"


OR CREATE A BAT FILE AND COPY THE BELOW CONTENT IN IT AND CALL THE BAT FILE IN COMMAND PROMPT

set JAVA_HOME="C:\Program Files\Java\jdk1.5.0"

%JAVA_HOME%\bin\java -classpath ../lib/company.jar;../lib/company_db.jar;../lib/project7.jar;../lib/mysql-connector-java-5.1.6-bin.jar;../lib/activation.jar;../lib/mail.jar;../lib/log4j-1.2.15.jar;../lib/smtp.jar;../lib/pop3.jar;. com.company.project.user.ChangePasswordAlert "en"


Continue Reading | comments

HOW TO CONVERT A PDF FILE TO PNG FORMAT USING JAVA PROGRAM

this program is very much useful to convert a pdf file to png format using java
you can use this java program for converting pdf files to png file format.
free download and use this programe. java using pdf convertion to png file format
/**
*
*
*/

import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;

import com.sun.media.jai.codec.ImageCodec;

import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.ImageEncoder;
import com.sun.media.jai.codec.PNGEncodeParam;
import com.sun.media.jai.codec.SeekableStream;
import com.sun.media.jai.codec.TIFFDecodeParam;
import com.sun.media.jai.codec.TIFFDirectory;

import multivalent.Behavior;
import multivalent.Context;
import multivalent.Document;
import multivalent.Node;
import multivalent.std.adaptor.pdf.PDF;

public class PDFToPNG extends HttpServlet {

/**
*
*/
private static final long serialVersionUID = 1L;

public byte[] ConvertToPngImage(byte[] tiffRawData, HttpServletResponse res)
throws Exception {
Vector pngs = new Vector();
// set stream to the tiff url
SeekableStream tiffStream = SeekableStream.wrapInputStream(
new ByteArrayInputStream(tiffRawData), true);

// how many pages in one tiff
int pageNumber = TIFFDirectory.getNumDirectories(tiffStream);

TIFFDecodeParam decodeParam = new TIFFDecodeParam();
decodeParam.setDecodePaletteAsShorts(true);

ImageDecoder tiffDecoder = ImageCodec.createImageDecoder("tiff",
tiffStream, decodeParam);

// for (int p = 0; p < pageNumber; p ++) {
// render the current page
RenderedImage tiffPage = tiffDecoder.decodeAsRenderedImage();

PNGEncodeParam png = PNGEncodeParam.getDefaultEncodeParam(tiffPage);

// The png stream is outputted to a file. Change the directory
// accordingly.
ByteArrayOutputStream baos = new ByteArrayOutputStream();

// Gets a PNG encoder.
ImageEncoder pngEncoder = ImageCodec.createImageEncoder("PNG", baos,png);

// Encodes the RenderedImage object.
pngEncoder.encode(tiffPage);

byte[] content = baos.toByteArray();
baos.close();
return content;
}

public static void main(String args[]) {
File outfile = new File("c:\\file.png");

try {

PDF pdf = (PDF) Behavior.getInstance("AdobePDF", "AdobePDF", null,
null, null);
File file = new File("c:\\somepdf.pdf");
pdf.setInput(file);

Document doc = new Document("doc", null, null);
pdf.parse(doc);
doc.clear();

doc.putAttr(Document.ATTR_PAGE, Integer.toString(1));
pdf.parse(doc);

Node top = doc.childAt(0);
doc.formatBeforeAfter(200, 200, null);
int w = top.bbox.width;
int h = top.bbox.height;
BufferedImage img = new BufferedImage(w, h,
BufferedImage.TYPE_INT_RGB);
Graphics2D g = img.createGraphics();
g.setClip(0, 0, w, h);

g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
Context cx = doc.getStyleSheet().getContext(g, null);
top.paintBeforeAfter(g.getClipBounds(), cx);

ImageIO.write(img, "png", outfile);
doc.removeAllChildren();
cx.reset();
g.dispose();

pdf.getReader().close();
outfile = null;

doc = null;
} catch (Exception e) {

}
}
}
----------

Continue Reading | comments

HOW TO CONVERT A PDF FILE TO PNG FORMAT USING JAVA PROGRAM

this program is very much useful to convert a pdf file to png format using java
you can use this java program for converting pdf files to png file format.
free download and use this programe. java using pdf convertion to png file format
/**
*
*
*/

import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;

import com.sun.media.jai.codec.ImageCodec;

import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.ImageEncoder;
import com.sun.media.jai.codec.PNGEncodeParam;
import com.sun.media.jai.codec.SeekableStream;
import com.sun.media.jai.codec.TIFFDecodeParam;
import com.sun.media.jai.codec.TIFFDirectory;

import multivalent.Behavior;
import multivalent.Context;
import multivalent.Document;
import multivalent.Node;
import multivalent.std.adaptor.pdf.PDF;

public class PDFToPNG extends HttpServlet {

/**
*
*/
private static final long serialVersionUID = 1L;

public byte[] ConvertToPngImage(byte[] tiffRawData, HttpServletResponse res)
throws Exception {
Vector pngs = new Vector();
// set stream to the tiff url
SeekableStream tiffStream = SeekableStream.wrapInputStream(
new ByteArrayInputStream(tiffRawData), true);

// how many pages in one tiff
int pageNumber = TIFFDirectory.getNumDirectories(tiffStream);

TIFFDecodeParam decodeParam = new TIFFDecodeParam();
decodeParam.setDecodePaletteAsShorts(true);

ImageDecoder tiffDecoder = ImageCodec.createImageDecoder("tiff",
tiffStream, decodeParam);

// for (int p = 0; p < pageNumber; p ++) {
// render the current page
RenderedImage tiffPage = tiffDecoder.decodeAsRenderedImage();

PNGEncodeParam png = PNGEncodeParam.getDefaultEncodeParam(tiffPage);

// The png stream is outputted to a file. Change the directory
// accordingly.
ByteArrayOutputStream baos = new ByteArrayOutputStream();

// Gets a PNG encoder.
ImageEncoder pngEncoder = ImageCodec.createImageEncoder("PNG", baos,png);

// Encodes the RenderedImage object.
pngEncoder.encode(tiffPage);

byte[] content = baos.toByteArray();
baos.close();
return content;
}

public static void main(String args[]) {
File outfile = new File("c:\\file.png");

try {

PDF pdf = (PDF) Behavior.getInstance("AdobePDF", "AdobePDF", null,
null, null);
File file = new File("c:\\somepdf.pdf");
pdf.setInput(file);

Document doc = new Document("doc", null, null);
pdf.parse(doc);
doc.clear();

doc.putAttr(Document.ATTR_PAGE, Integer.toString(1));
pdf.parse(doc);

Node top = doc.childAt(0);
doc.formatBeforeAfter(200, 200, null);
int w = top.bbox.width;
int h = top.bbox.height;
BufferedImage img = new BufferedImage(w, h,
BufferedImage.TYPE_INT_RGB);
Graphics2D g = img.createGraphics();
g.setClip(0, 0, w, h);

g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
Context cx = doc.getStyleSheet().getContext(g, null);
top.paintBeforeAfter(g.getClipBounds(), cx);

ImageIO.write(img, "png", outfile);
doc.removeAllChildren();
cx.reset();
g.dispose();

pdf.getReader().close();
outfile = null;

doc = null;
} catch (Exception e) {

}
}
}
----------

Continue Reading | comments

ONLINE UNIVERSITY DATABASE CREATION

To create a new Database, open the MS Access and select ‘Blank Access Database’ and click at OK. This is shown below:
User Maintenance Manual

This project titled ‘On-Line University’ has been built using JSP, which is a server side program. So to run this program on a personal computer, a web server such as Java Web Server2.0 or Apache Tomcat 4.0’, is needed. Here ‘Tomcat’ is used.

In this CD, there is a folder named ‘University’ and inside this folder there are another three folder named ‘htmls’, ‘jsps’ and ‘database’. The ‘htmls’ contains html codes, the ‘jsps’ contains jsp codes and ‘database’ contains databases created on MS Access.

Procedures for Apache Tomcat 4.0 web server

The folder ‘University’ should be included inside the ‘Tomcat’ as follows:

Note:

Copy University Folder and paste it under

C:\Program Files\Apache Tomcat 4.0\webapps\examples\jsp







Then another window will be opened as shown below. In this window we can select the Drive where we want to save this database file.




After selecting the Drive, assign a name to the Database file, which we are going to create and click at the button. Then another window will be opened as shown below:





In the above figure, we can see that three ways to create a database. Among this, select the second one (as shown in the picture) and double click on it. Then another window will be selected as shown below:




Here we can select the subject for the ‘Sample Tables’ by choosing ‘Business or Personal’. Here I chose ‘Book’ as the subject for the Sample Tables. If we choose a


Subject for the Sample Tables, its possible attributes will be appeared on the ‘Sample Fields’. From this field we can choose the fields that we would like to have. Here I selected ‘BookID, Title and Copyright Year’. This can be done by clicking the button while keeping a sample field is selected. After this, click next and another window will be opened as shown below:

User Maintenance Manual

This project titled ‘On-Line University’ has been built using JSP, which is a server side program. So to run this program on a personal computer, a web server such as Java Web Server2.0 or Apache Tomcat 4.0’, is needed. Here ‘Tomcat’ is used.

In this CD, there is a folder named ‘University’ and inside this folder there are another three folder named ‘htmls’, ‘jsps’ and ‘database’. The ‘htmls’ contains html codes, the ‘jsps’ contains jsp codes and ‘database’ contains databases created on MS Access.

Procedures for Apache Tomcat 4.0 web server

The folder ‘University’ should be included inside the ‘Tomcat’ as follows:

Note:

Copy University Folder and paste it under

C:\Program Files\Apache Tomcat 4.0\webapps\examples\jsp





User Maintenance Manual

This project titled ‘On-Line University’ has been built using JSP, which is a server side program. So to run this program on a personal computer, a web server such as Java Web Server2.0 or Apache Tomcat 4.0’, is needed. Here ‘Tomcat’ is used.

In this CD, there is a folder named ‘University’ and inside this folder there are another three folder named ‘htmls’, ‘jsps’ and ‘database’. The ‘htmls’ contains html codes, the ‘jsps’ contains jsp codes and ‘database’ contains databases created on MS Access.

Procedures for Apache Tomcat 4.0 web server

The folder ‘University’ should be included inside the ‘Tomcat’ as follows:

Note:

Copy University Folder and paste it under

C:\Program Files\Apache Tomcat 4.0\webapps\examples\jsp







Here also click ‘Next’ and the next window is shown below:



Here click at ‘Finish. Then another window will be opened as shown below

In this window, we can enter the values for the attributes such as ‘Book ID, ‘Title and Copyright Year’. After entering all the values to the fields, press ‘Ctrl + W’ for saving the file

ONLINE UNIVERSITY - SYSTEM ANALYSIS
Operations in the Existing System


Registration

The students those who are looking for pursuing a course at any college under the ABCD University has to pass the qualifying examination or any other examination, recognized by this University as equivalent to it, with a minimum of 55% marks. Relaxation of marks will be allowed to SC/ST students. Even if the student has passed the qualifying course he/she must also have attained the minimum age prescribed for admission to the course.


Apart from this at the time of admission the students are required to present their transfer certificate (T.C) and a conduct certificate from the institution they have last studied. If student is an over aged private S.S.L.C holder then that student is exempted from producing the Transfer Certificate at the time of admission in the affiliated colleges and also for Private Registrations. If the student had studied in an institution outside the territorial jurisdiction of this University and presently he/she wish to seek admission to a College/Institution or any of the University’s Departments of Study and Research in this University, in addition to the above said requirements they should also produce a Migration Certificate.

The students shall also produce an Eligibility Certificate that can be had from the Registrar by submitting an application form with a prescribed fee. Candidates who migrate from other Universities should register as matriculates of this University at the time of admission by paying the prescribed fee. If one fails to produce the Migration Certificate as requested by the University, then he/she will not be allowed to take any examination of this University. Admission to colleges or other institutions under the University will not be permitted after two months from the date of reopening of the college or University Department concerned, except with the previous permission of this University. However, he/she may be permitted to join the certain part-time courses conducted by the University or by a college affiliated to this University or by a Center for study and research of this University. No Candidate who has passed an examination from this University or from any other University shall be permitted to take an examination of this University or to join the course leading to that Examination or part or parts thereof which is considered lower than the one he has passed


Draw backs of the Existing System
The main problem with the existing system is that it takes so long for completing the registration process. Also there may cause the problem of losing application or registration forms while sending the forms to and fro. Besides all that, all the databases of these students have to be entered in to the computer by the data entry operator and it is a tedious as well as a time consuming process. Here also errors-like unfilled columns in the forms, losing data, etc may occur while creating the databases for the students. If anyone’s form is not filled completely, his or her registration or application form will not be taken into consideration.
In the case of admission, students are not aware of the number of seats available in each college for a certain course. Difficulty arises when the student came to know that the college to which he/she applied for a certain course does not have sufficient number of seats. In such cases, again, the student has to submit another admission form, for which he/she has to follow all the rules and formalities that the student had done when applied for the first time. As far as a student is concerned, it is all time consuming processes and they have to wait till for a replay from the University/College authorities.
While applying for an exam, students have to submit all the examination forms and the exam fee receipt before the date. This is very difficult for the students those who are coming from very long distance and from outside state.


Proposed System and its Advantages
If the University has On-Line services, the above-mentioned problems will be solved to some extend. Students can register for a course through on-line thereby they can avoid the missing of forms, waiting so long for the replay, etc. Through on-line, students can fill up the registration form and it can be send within a fraction of a second. While doing on-line registration, students cannot leave any columns as blank, as the system reminds them of that. So the students can avoid such mistakes that might be leading to the cancellation of their registration. As soon as the students registered for the course, they will get the further information from the University at once.
With the help of On-Line registration, the students need not wait for days or weeks for the result. While doing On-Line registration, the students will be informed of their college, their course, their admission number, their registration number etc. Also when students are registering through On-Line, they have to fill up their academic details, personal details, mark lists, etc in the registration form. So the details in the forms are directly going to the server of the University so that the university needn’t have to create a separate database for the student.
The proposed system offers on - line facilities like viewing the Course details, College details, Exam results, Registration for both Admission and Examinations etc. In the administration side, the administrator can enter new details such as adding new colleges, allotting seats, entering new course details, entering exam results etc.
Continue Reading | comments

ONLINE UNIVERSITY - HOW TO DEPLOY AND RUN

User Maintenance Manual

This project titled ‘On-Line University’ has been built using JSP, which is a server side program. So to run this program on a personal computer, a web server such as Java Web Server2.0 or Apache Tomcat 4.0’, is needed. Here ‘Tomcat’ is used.

In this CD, there is a folder named ‘University’ and inside this folder there are another three folder named ‘htmls’, ‘jsps’ and ‘database’. The ‘htmls’ contains html codes, the ‘jsps’ contains jsp codes and ‘database’ contains databases created on MS Access.

Procedures for Apache Tomcat 4.0 web server

The folder ‘University’ should be included inside the ‘Tomcat’ as follows:

Note:

Copy University Folder and paste it under

C:\Program Files\Apache Tomcat 4.0\webapps\examples\jsp

Continue Reading | comments

how to do watermarking on images using java and jsp

dear friends we can make watermarking on images or logos using java .this code is useful for somebody want to write their logo or their company name on their images published on their website.this watermarking code is free and you can use this code for education purpose only. this watermarking code can be applied on jsp also.

------------------------------------------------
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Random;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;

public class Watermark
{
public static void main(String[] args)
{
try
{
Font font;
File _file = new File("C:/car.jpg");
Image src = ImageIO.read(_file);
int width = src.getWidth(null);
int height = src.getHeight(null);
System.out.println("X = "+width+" and Y = "+height);
BufferedImage image = new BufferedImage(width, height
, BufferedImage.TYPE_INT_RGB);
Graphics g = image.createGraphics();
g.drawImage(src, 0, 0, width, height, null);
// g.setBackground(Color.white);
g.setColor(Color.red);
g.setFont(new Font("Verdana", Font.BOLD, 20));

g.drawString("www.yourname.com", 5, height - (new
Font("Arial", Font.BOLD, 20)).getSize() / 2 - 5);
g.dispose();

FileOutputStream out = new FileOutputStream("C:/car2.jpg");
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(image);
out.close();
} catch (Exception ee)
{
System.out.println("Error Occurred : "+ee);
}
}
}
------------------------------

Continue Reading | comments

DOWNLOAD FREE JAVA/JSP PROJECTS

Here you can download free java,jsp ,servlet,apache struts,spring projects.the projects including final year academic and professional software applications.
these free download java project source code is fully tested and fully free and easily downloadable .this website is absolutely free and you can download these academic and professional applications and software without paying any amount.it is absolutely free

this website contains 120 java,jsp projects including fully working source code and database.you can easily download these academic projects.the free downloadable java source code academin projects can be used as a final year academin projects for students in b.tech and mca.

this free java software website contains free java software and free downloadable java projects.it is fully functional and working.

just click the download link in the free java downlodable projects and save the full projects in your system

click to download here




freejavaprojects,btech final yearprojects downloads,mcaprojects,btechcomputerscienceacademicprojects,freedownloadsjavaprojects,java academin projects

Continue Reading | comments

free downloads sample struts free tutorial projects

hai friends here iam giving a free downloads sample struts tutorial project.these project is very much useful for learning struts for beginners.these sample struts tutorial projects areabsolutely free including source code.these free downlodable sample projects contains free java projects,free academic projects for btech and mca computer science students.you can easily downlods these frojects by clicking on the free downlods link and present these java projects source code as your final year engineering,mca,bsc computer science,msc computer science academic project



Continue Reading | comments (1)
 
Copyright © 2011. B.Sc B.Tech MCA Ploytechnic Mini,Main Projects | Free Main Projcets Download | MCA |B.tech . All Rights Reserved
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Template Modify by Creating Website. Inpire by Darkmatter Rockettheme Proudly powered by Blogger