Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Demonstrate Buttons
- import java.awt.*;
- import java.awt.event.*;
- import java.applet.*;
- /*
- <applet code="pro12" width=250 height=150>
- </applet>
- */
- public class pro12 extends Applet implements AdjustmentListener
- {
- Color c;
- Scrollbar rs,gs,bs;
- public void init()
- {
- rs=new Scrollbar(Scrollbar.HORIZONTAL,255,5,0,255);
- gs=new Scrollbar(Scrollbar.HORIZONTAL,255,5,0,255);
- bs=new Scrollbar(Scrollbar.HORIZONTAL,255,5,0,255);
- add(rs);
- add(gs);
- add(bs);
- rs.addAdjustmentListener(this);
- gs.addAdjustmentListener(this);
- bs.addAdjustmentListener(this);
- }
- public void adjustmentValueChanged(AdjustmentEvent ae)
- {
- int r=rs.getValue();
- int g=gs.getValue();
- int b=bs.getValue();
- c=new Color(r,g,b);
- repaint();
- }
- public void paint(Graphics g)
- {
- g.setColor(c);
- g.fillRect(100,80,50,50);
- }
- }
- // Demonstrate Buttons
- import java.awt.*;
- import java.awt.event.*;
- import java.applet.*;
- /*
- <applet code="pro7" width=250 height=150>
- </applet>
- */
- public class pro7 extends Applet implements ActionListener
- {
- Button red, green, blue;
- public void init()
- {
- red = new Button("Red");
- green = new Button("Green");
- blue = new Button("Blue");
- add(red);
- add(green);
- add(blue);
- red.addActionListener(this);
- green.addActionListener(this);
- blue.addActionListener(this);
- }
- public void actionPerformed(ActionEvent ae)
- {
- String str = ae.getActionCommand();
- if(str.equals("Red"))
- {
- setBackground(Color.red);
- }
- else if(str.equals("Green"))
- {
- setBackground(Color.green);
- }
- else
- {
- setBackground(Color.blue);
- }
- repaint();
- }
- }
- import java.applet.Applet;
- import java.awt.*;
- /*
- <applet code=as11_5 width=600 height=600>
- </applet>
- */
- public class as11_5 extends Applet
- {
- public void paint(Graphics g)
- {
- // Font f=new Font("Arial",Font.BOLD,14);
- g.setFont(f);
- g.drawRect(100,100,400,400);//outer rect
- g.drawOval(150,125,150,150);//circle
- g.drawString("Circle",200,175);
- g.drawRect(325,125,150,150);//sqare
- g.drawString("Square",375,175);
- g.drawOval(200,350,250,100);//oval
- g.drawString("Oval",300,400);
- }
- }
- import java.applet.Applet;
- import java.awt.*;
- /*
- <applet code='As11_2'
- width=600
- height=600>
- </applet>
- */
- public class As11_2 extends Applet
- {
- public void paint(Graphics g)
- {
- g.drawOval(100,100,400,400);//face
- g.setColor(Color.GRAY);
- g.fillOval(170,200,50,50);//left eye
- g.fillOval(400,200,50,50);//right eye
- g.drawLine(300,300,270,340);//nose horizontal arrow
- g.drawLine(270,340,310,340);//nose vertical arrow
- g.drawArc(200,400,200,80,10,170);
- }
- }
- import java.applet.Applet;
- import java.awt.*;
- /*
- <applet code='as11_1'
- width=600
- height=600>
- </applet>
- */
- public class as11_1 extends Applet
- {
- public void paint(Graphics g)
- {
- g.drawOval(100,100,400,400);//face
- g.setColor(Color.black);
- g.fillOval(170,200,50,50);//left eye
- g.fillOval(400,200,50,50);//right eye
- g.drawLine(300,300,270,340);//nose horizontal arrow
- g.drawLine(270,340,310,340);//nose vertical arrow
- g.drawArc(200,350,200,70,-10,-170);
- }
- }
- <?php
- require 'connect.php';
- $id=$_GET['sid'];
- $sqlq="delete from student_info where sid=$id";
- echo $sqlq;
- mysqli_query($conn,$sqlq);
- mysqli_close($conn);
- //header('Location: all_stud_info.php');
- ?>
- <?php
- require 'connect.php';
- $sid=$_GET['sid'];
- $sqlq="select * from student_info where sid=$sid";
- $r=mysqli_query($conn,$sqlq);
- $row=mysqli_fetch_array($r);
- mysqli_close($conn);
- ?>
- <html>
- <head>
- <title> Upload </title>
- </head>
- <body>
- <form method="POST">
- <table>
- <tr>
- <td>Name:</td>
- <td><input type="text" name="txt_nm" value="<?php echo $row[1];?>"/></td>
- </tr>
- <tr>
- <td>Dept Name</td>
- <td><input type="text" name="txt_dept" value="<?php echo $row[2];?>"/></td>
- </tr>
- <tr>
- <td>address:</td>
- <td><textarea name="txta_add" ><?php echo $row[3];?></textarea></td>
- </tr>
- <tr>
- <td>Email:</td>
- <td><input type="text" name="txt_mail" value="<?php echo $row[4];?>"/> </td>
- </tr>
- <!-- <tr>
- <td>Contact no:</td>
- <td><input type="text" name="txt_cont" value="//< echo $row[5];?>"/></td>
- </tr> -->
- <tr>
- <td>Dob:</td>
- <td><input type="date" name="date_dob" value="<?php echo $row[5];?>"/></td>
- </tr>
- <tr>
- <td>Course Name:</td>
- <td><input type="text" name="txt_course" value="<?php echo $row[6];?>"/></td>
- </tr>
- <tr>
- <td align="center"> <input type="submit" value="update" name='btn_sub'></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
- <?php
- $r=$_GET["sid"];
- if($r!=null)
- {
- $con=mysqli_connect("localhost","root","") or die("Can't connect");
- mysqli_select_db($con,'student_master');
- $sql="select * from student_info where sid=$r";
- $result = mysqli_query($con,$sql);
- $row=mysqli_fetch_array($result);
- }
- if(isset($_POST['btn_sub']))
- {
- $name=$_POST['txt_nm'];
- $dept=$_POST['txt_dept'];
- $add=$_POST['txta_add'];
- $mail=$_POST['txt_mail'];
- // $contact=$_POST['txt_cont'];
- $dob=$_POST['date_dob'];
- $course=$_POST['txt_course'];
- if(!(empty($name)and empty($dept)and empty($add)and empty($mail) and empty($contact) and empty($dob) and empty($course)))
- {
- $sqlq="update student_info set name='$name',dept='$dept',address='$add',email='$mail',birth_date='$dob',course_name='$course' where sid=$r";
- echo $sqlq;
- mysqli_query($con,$sqlq);
- mysqli_close($con);
- // header('Location: student_info.php');
- }
- }
- ?>
- <?php
- $servername = "127.0.0.1";
- $username = "root";
- $password = "";
- $database = "student_master";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $database);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully <br>";
- ?>
Add Comment
Please, Sign In to add comment