Sunday, 29 June 2014

Program For JTabledemo In Java:-----


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

/*<applet code="JTabledemo" width=400 height=200></applet>*/

public class JTabledemo extends JApplet
{


public void init()
{
Container c=getContentPane();



c.setLayout(new BorderLayout());

String[] colHeads={"name","phone no","city"};

Object[][] data={
{"abc","9999999","pune"},
{"xyz","8888888","mumbai"}
};

JTable tb=new JTable(data,colHeads);




int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
JScrollPane jsp=new JScrollPane(tb,v,h);

c.add(jsp,BorderLayout.CENTER);



}


}




Program For JScrolldemo In Java;------



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

/*<applet code="JScrolldemo" width=200 height=200></applet>*/

public class JScrolldemo extends JApplet
{
public void init()
{

Container c=getContentPane();

c.setLayout(new BorderLayout());

JPanel jp=new JPanel();
jp.setLayout(new GridLayout(2,2));


JRadioButton b1=new JRadioButton("Indian Express");
jp.add(b1);
JRadioButton b2=new JRadioButton("Times of India");
jp.add(b2);
JRadioButton b3=new JRadioButton("Sakal");
jp.add(b3);
JRadioButton b4=new JRadioButton("Lokmat");
jp.add(b4);

ButtonGroup bg1=new ButtonGroup();
ButtonGroup bg2=new ButtonGroup();
bg1.add(b1);
bg1.add(b2);
bg2.add(b3);
bg2.add(b4);

int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
JScrollPane jsp=new JScrollPane(jp,v,h);

c.add(jsp,BorderLayout.CENTER);


}

}

Program For Frame In Java:----------


import javax.swing.*;
class FD extends JFrame
{
public static void main(String args[])
{
FD d=new FD();
d.setTitle("my swing frame");
d.setSize(200,250);
d.setVisible(true);
d.setLocation(20,30);
d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
java program  to  Insert Data Into MsAccess database////////////First u need to do database setting After Use //////////////////////This Program
import java.sql.*;
public class Exp11
{
    public static void main(String args[])
    {
        try
        {
             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
             System.out.println("Drivers are properly loaded");
             System.out.println("-------------------------------------");
             Connection con= DriverManager.getConnection("jdbc:odbc:D2");
             System.out.println("Connection established");
             System.out.println("-------------------------------------");
             String url= "INSERT into Emp values(01, 'Prashant','Mumbai','Maharastra',100000,777,'MD')";
             PreparedStatement stmt = con.prepareStatement(url);
             stmt.executeUpdate();
             System.out.println("first value is inserted");
             System.out.println("-------------------------------------");
             String url1="INSERT into Emp values(02, 'Prashanti','Haidrabad','Tamilnadu',10000,775,'AS_MD')";
             PreparedStatement stmt1 = con.prepareStatement(url1);
             stmt1.executeUpdate();
             System.out.println("second value is inserted");
             System.out.println("-------------------------------------");
             String url2="INSERT into Emp values(03, 'Prashantina','Pune','Maharastra',200000,774,'CEO')";
             PreparedStatement stmt2 = con.prepareStatement(url2);
             stmt2.executeUpdate();
             System.out.println("Third value is inserted");
             System.out.println("-------------------------------------");
             String url3="INSERT into Emp values(04, 'Pradynesh','Bandup','Maharastra',20000,773,'Manager')";
             PreparedStatement stmt3 = con.prepareStatement(url3);
             stmt3.executeUpdate();
             System.out.println("Forth value is inserted");
             System.out.println("-------------------------------------");
             String url4="INSERT into Emp values(05, 'Pradynesha','Mulund','Maharastra',25000,772,'AS_Manger')";
             PreparedStatement stmt4 = con.prepareStatement(url4);
             stmt4.executeUpdate();
             System.out.println("Fifth value is inserted");
             System.out.println("-------------------------------------");
             System.out.println("All Data is succesfully inserted");
             System.out.println("-------------------------------------");
             System.out.println("Connection closed");
           con.close();
        }
       catch (SQLException e)
        {
            System.err.println("SQL error has been occure");
        }
       catch (Exception e)
        {
            System.err.println("Error connection not established");
        }
     
    }
}


OutPut:---------




Some Project List For Final Year Project---

1. inventory management system 
2. jwellery shop management 
3. Library Management System 
4. management of department store 
5. manufacturing
6. marble company 
7. media marketing system 
8. Medical Agency Mgmt 
9. Medical Store Mgmt VBNET / SQL
10. Matrimonial Management System
11. Micro Blogging Enabled Social Networking Site
12. Mobile Purchase & Sales
13. Mobile sales & service
14. Motor Driving School
15. music store automation
16. muthoot groop
17. News Paper Agency Management System
18. old age home
19. onine college admission
20. Online Admission Management System ASPNET / SQL
21. online application for the Training and Placement Dept of the college
22. Online Auctioning system like eBaycom
23. Online Examination System ASPNET / SQL
24. Online Help Desk (OHD) for the facilities in the campus
25. Online Job search portal ASPNET / SQL
26. online Library Management System (LiMS
27. Online matrimonial portal ASPNET / SQL
28. online result
29. online theatre booking system
30. Online webmart system for jewellery ASPNET / SQL
31. Patel's Super Market
32. pathology lab
33. pathpedi mgmt
34. Pharma Ceutical
35. Pizza Shop
36. police support management
37. practical online leave management system (LMS
38. practical online on‐request courses coordination system (ORS
39. practical Online Survey Tool (OST
40. practical online Tickets reservation system for Cinema halls
41. practical Time table generation system for a college
42. press management system
43. printing press management
44. Printing Press Mgmt
45. productin management system
46. Property management
47. purchase system
48. Registration office management system
49. Reliance Gallary Management
50. Remote Desktop VBNET

Hope This Will Help U....
Difference Between Interface and Abstract Class
1. Main difference is methods of a Java interface are implicitly abstract and cannot have implementations. A Java abstract class can have instance methods that implements a default behaviour.
2. Variables declared in a Java interface is by default final. An abstract class may contain non-final variables.
3. Members of a Java interface are public by default. A Java abstract class can have the usual flavors of class members like private, protected, etc..
4. Java interface should be implemented using keyword “implements”; A Java abstract class should be extended using keyword “extends”.
5. An interface can extend another Java interface only, an abstract class can extend another Java class and implement multiple Java interfaces.
6. A Java class can implement multiple interfaces but it can extend only one abstract class.
7. Interface is absolutely abstract and cannot be instantiated; A Java abstract class also cannot be instantiated, but can be invoked if a main() exists.
8. In comparison with java abstract classes, java interfaces are slow as it requires extra indirection.
How can we implement an interface in JSP page :
1. Implement interface in a class, then use this class in JSP .
2.
<%!
interface MyInter { 
public String test(); 
}
class InterfaceImpl implements MyInter{ 
public String test(){ 
return "This is from MyInter - The Interface"; 
}
}
%>
<%
InterfaceImpl inter = new InterfaceImpl();
String str = inter.test();
out.println(str);
%>