program that displays the data in the user table that exists in database, a servlet program that creates a new user entry in the user table in database, Java program to display the details of a particular department from Access database, GUI application using Swings that has a button that uses JColorChooser to change the background of the application to the color choosen in JColorChooser, applet program that implements AdjustmentListener, applet program that allows parameter passing, applet with ‘n’ labels with ‘n’ different colours occupy ‘n’ grids, applet program that implements ItemListener, Java Script program that uses onMouseOver and onMouseOut events, program in Java Script for displaying the current date in the following format. FRIDAY, 3-May-2013, web application using different types of CSS, database using XML and display the content using XSL by validating through XML schema,
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
AIM : To design a student database using XML and display the content using XSL by validating through XML schema.
PROGRAM:
XML document<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="cse.xsl"?>
RESULT: Hence the program to design a student database using XML and display the content using XSL by validating through XML schema have been successfully completed
OUTPUT:
AIM : To design a web application using different types of CSS.
<p style="font-size:20pt;color:SteelBlue">this text has inline style <em>font-size</em><em> color</em> applied to it.</p>
<p>These have embedded styles applied</p> <div class="thin red solid">thin red Solid Border</div>
<hr> <div class="medium blue outset ">medium blue outset Border</div>
<p>These have external styles applied</p><div class="section">
<div class="floated"> External StyleSheets</div>A style sheet is linked using link element that uses rel attribute="stylesheet" means the linked document is a stylesheet for this document.
document.writeln("<h1>Today's date is</h1>");document.writeln(d[current.getDay()]);document.write(","+current.getDate());document.write("-"+m[current.getMonth()]);document.write("-"+current.getYear());
</script></head><body></body>
</html>
RESULT: Hence the program that displays the current date in the following format FRIDAY, 3-May-2013 has been successfully executed.
OUTPUT:
AIM: To write a Java Script program that uses onMouseOver and onMouseOut events
public class ItemListenerDemo extends Applet implements ItemListener{
Choice c;public void init(){
c = new Choice(); //create choice or combobox c.add("red"); //add items to the choice c.add("green"); c.add("blue"); c.add("pink");
add(c); //add choice or combobox c.addItemListener(this); //add item listener
} public void paint(Graphics g)
{ // To get selected item, use String getSelectedItem() method of AWT Choice class. g.drawString(c.getSelectedItem(),10, 70); } public void itemStateChanged(ItemEvent e)
{ repaint(); }}
RESULT: Hence the applet program that implements ItemListener has been successfully executed.
OUTPUT:
AIM: To design an applet with ‘n’ labels with ‘n’ different colours occupy ‘n’ grids.
public class AdjDemo extends Applet implements AdjustmentListener{
Scrollbar s1,s2,s3;TextField t1;
public void init(){
setLayout(new BorderLayout());s1 = new Scrollbar(0,125,15,0,255);s2 = new Scrollbar(Scrollbar.VERTICAL, 0, 51, 0, 255);s3 = new Scrollbar(0,205,15,0,255);t1 = new TextField(20);s1.setBackground(Color.YELLOW);s2.setBackground(Color.RED);s3.setBackground(Color.blue);s1.addAdjustmentListener(this);s2.addAdjustmentListener(this);s3.addAdjustmentListener(this);add(s1,BorderLayout.NORTH);add(s2,BorderLayout.WEST);add(s3,BorderLayout.SOUTH);add(t1,BorderLayout.EAST);
} public void adjustmentValueChanged(AdjustmentEvent e)
{ setBackground(new Color(s1.getValue(),s2.getValue(),s3.getValue()));t1.setText("value of s1,s2,s3 is"+s1.getValue()+s2.getValue()+s3.getValue());
}public void start(){
setSize(400,400);setVisible(true);
}}
RESULT: Hence the applet program that implements AdjustmentListener has been successfully executed.
OUTPUT:
AIM: To design an GUI application using Swings that has a button that uses JColorChooserto change the background of the application to the color choosen in JColorChooser.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:db1"); PreparedStatement st=con.prepareStatement("insert into user values (?,?)");
st.setString(1,login);st.setString(2,pwd);
int n = st.executeUpdate();con.close();
res.setContentType("text/html");PrintWriter out =res.getWriter();