A
PROJECT REPORT
                                  ON
                          “Paint Application”
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD
                                 OF
                            DIPLOMA IN
                        COMPUTER ENGINEERING
                   SUBMITTED TO
   MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
                      MUMBAI
                           SUBMITTED BY
Name of Student                        Enrollment Number
  1)Thite Purva                         1809920146
  2)Varhadi Vaishnavi                   1809920147
  3)Tambe Priyanka                       1809920163
                              GUIDED BY
                          (Prof.Pokharkar.M.S)
                  SAMARTH POLYTECHNIC, BELHE
                       SAMARTH POLYTECHNIC, BELHE
                             CERTIFICATE
        This is to certify that the project report entitled “Paint Application” Was
  successfully completed by Student of Fifth semester Diploma in computer
  engineering.
            1)Thite Purva                              2)Varhadi Vaishnavi
                               3)Tambe Priyanka
in partial fulfillment of the requirements for the award of the Diploma in
Computer engineering and submitted to the Department of Computer of
Samarth Polytechnic, Belhe work carried out during a period for the academic
year 2020- 21 as per curriculum.
  Prof. Pokharkar M.S.       Prof. Pokharkar M.S.            Prof. Kapile A.S.
   (Subject Teacher)               (H.O.D)                       (Principal)
                           ACKNOWLEDGMENT
This project is done as a semester project, as a part course titled “Waste Management ”.
We are really thankful to our course the Principal Prof. Kapile A. S. and the HOD Prof.
Pokharkar M.S. Samarth Polytechnic, Belhe for his invaluable guidance and assistance,
without which the accomplishment of the task would have never been possible. We also
thank Prof. Pokharkar M.S. for giving this opportunity to explore into the real world and
realize the interrelation without which a Project can never progress. In our present project
we have chosen the topic- “Paint Application”. We are also thankful to parents, friend
and all staff of Computer engineering department, for providing us relevant information
and necessary clarifications, and great support.
                                                                   1)Thite Purva
                                                                    2)Varhadi Vaishnavi
                                                                   3)Tambe Priyanka
                            INDEX
     Sr.No.                  Name of Chapter               Page No.
Chapter 1     Synopsis
              1.1 Project Title
              1.2 Project Option
                                                              1
              1.3 Internal Guide
              1.4 Problem Statement
Chapter 2     Abstract                                        2
Chapter 3     Hardware & Software requirement                 3
Chapter 4     Introduction                                    4
Chapter 5     Program Source Code                             5
Chapter 6     Outcome of Micro-Project                       10
Chapter 7     Benefits of the Micro-Project                  11
Chapter 8     Skill developed /learning outcomes of this     12
                            micro-project
Chapter 9     Conclusion                                     13
Chapter 10    Reference                                      14
                                                                         Paint Application
                                               CHAPTER 1
                                                  SYNOPSIS
1.1.   Project Title
                                               Paint Application
                                           1.2.   Project Option
                                                        None
                       1.3.   Internal Guide
                                               Prof. Pokharkar M.S.
                                         1.4. Problem Statement
                                        To study the Paint Application
       Samarth Polytechnic, Belhe                                                    Page 1
                                                                                            Paint Application
                                                CHAPTER 2
                                                 Abstract
Writing graphics applications in Java using Swing can be quite a daunting experience which requires
understanding of some large libraries, and fairly advanced aspects of Java. In a graphical system, a windowing
toolkit is usually responsible for providing a framework to make it relatively painless for a graphical user interface
(GUI) to render the right bits to the screen at the right time. Both the AWT (abstract windowing toolkit) and
Swing provide such a framework. In this report, we designed and developed a simple painter project used to
enable user to draw any shape and any integrated graphic with any color using FreeHand (move the mouse using
your hand to draw any shape and specify the coordinate in JPanel). Several tools such as Undo and Redo process,
Clear JPanel, Set Background Color & set Foreground Color, Save paint (Panel) to file ( *. JPG; *. GIF; *.* ), and
Open paint from image file are considered. The purpose of this project is to give you practice with graphical user
interface programming in Java. This project implemented using the components from Java's awt and swing library
in the Java programming language (NetBenas IDE7.2.1). As the final result of our project is enabling you to use
Free Hand to draw as an easy way to draw the Circle, Line, Rectangle, Square, and Oval , and integrated graphics
such as a car , a street , a football stadium , traffic signals and others.
Samarth Polytechnic, Belhe                                                                                 Page 2
                                                         Paint Application
                                      CHAPTER 3
                                HARDWARE & SOFTWARE
               Hardware Requirement:
              i. i3 Processor Based Computer or higher
          ii. Memory: 1 GB RAM
         iii. Hard Drive: 50 GB
         iv. Internet Connection
               Software Requirement:
         i.        Windows 7
        ii.        Microsoft Word
       iii.        Internet
Samarth Polytechnic, Belhe                                           Page 3
                                                                                            Paint Application
 CHAPTER 4
                                            INTRODUCTION
    The history of painting reaches back in time to artefacts from pre-historic humans, and spans all
    cultures. It represents a continuous, though periodically disrupted, tradition from Antiquity. Across
    cultures, and spanning continents and millennia, the history of painting is an ongoing river of creativity,
    that continues into the 21st century. Until the early 20th century it relied primarily on representational,
    religious and classical motifs, after which time more purely abstract and conceptual approaches gained
    favour.
    Developments in Eastern painting historically parallel those in Western painting, in general, a few
    centuries earlier. African art, Jewish art, Islamic art, Indian art, Chinese art, and Japanese art each had
    significant influence on Western art, and vice versa.
                 Initially serving utilitarian purpose, followed by imperial, private, civic, and religious
    patronage, Eastern and Western painting later found audiences in the aristocracy and the middle class.
    From the Modern era, the Middle Ages through the Renaissance painters worked for the church and a
    wealthy aristocracy. Beginning with the Baroque era artists received private commissions from a more
    educated and prosperous middle class. Finally in the West the idea of "art for art's sake" began to find
    expression in the work of the Romantic painters like Francisco de Goya, John Constable, and J. M. W.
    Turner. The 19th century saw the rise of the commercial art gallery, which provided patronage in the
    20th century.
Samarth Polytechnic, Belhe                                                                                 Page 4
                                                                          Paint Application
                                               CHAPTER 5
Program Source Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class paint
{
public static void main(String[] args)
{
Icon iconB = new ImageIcon("blue.gif");
//the blue image icon, ImageIcon is constructor and Icon is an iterface
Icon iconM = new ImageIcon("magenta.gif");
//magenta image icon
Icon iconR = new ImageIcon("red.gif");
//red image icon
Icon iconBl = new ImageIcon("black.gif");
//black image icon
Icon iconG = new ImageIcon("green.gif");
//finally the green image icon
//These will be the images for our colors.
JFrame frame = new JFrame("Paint It");
//Creates a frame with a title of "Paint it"
Container content = frame.getContentPane();
//Creates a new container
content.setLayout(new BorderLayout());
//sets the layout
final PadDraw drawPad = new PadDraw();
//creates a new padDraw, which is pretty much the paint program
content.add(drawPad, BorderLayout.CENTER);
//sets the padDraw in the center
JPanel panel = new JPanel();
//creates a JPanel
panel.setPreferredSize(new Dimension(32, 68));
panel.setMinimumSize(new Dimension(32, 68));
panel.setMaximumSize(new Dimension(32, 68));
//This sets the size of the panel
JButton clearButton = new JButton("Clear");
//creates the clear button and sets the text as "Clear"
clearButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
Samarth Polytechnic, Belhe                                                            Page 5
                                                                   Paint Application
drawPad.clear();
}
});
//this is the clear button, which clears the screen. This pretty
//much attaches an action listener to the button and when the
//button is pressed it calls the clear() method
JButton redButton = new JButton(iconR);
//creates the red button and sets the icon we created for red
redButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
drawPad.red();
}
});
//when pressed it will call the red() method. So on and so on =]
JButton blackButton = new JButton(iconBl);
//same thing except this is the black button
blackButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
drawPad.black();
}
});
JButton magentaButton = new JButton(iconM);
//magenta button
magentaButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
drawPad.magenta();
}
});
JButton blueButton = new JButton(iconB);
//blue button
blueButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
drawPad.blue();
}
});
JButton greenButton = new JButton(iconG);
//green button
greenButton.addActionListener(new ActionListener()
{
Samarth Polytechnic, Belhe                                                     Page 6
                                                         Paint Application
public void actionPerformed(ActionEvent e)
{
drawPad.green();
}
});
blackButton.setPreferredSize(new Dimension(16, 16));
magentaButton.setPreferredSize(new Dimension(16, 16));
redButton.setPreferredSize(new Dimension(16, 16));
blueButton.setPreferredSize(new Dimension(16, 16));
greenButton.setPreferredSize(new Dimension(16,16));
//sets the sizes of the buttons
panel.add(greenButton);
panel.add(blueButton);
panel.add(magentaButton);
panel.add(blackButton);
panel.add(redButton);
panel.add(clearButton);
//adds the buttons to the panel
content.add(panel, BorderLayout.WEST);
//sets the panel to the left
frame.setSize(300, 300);
//sets the size of the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//makes it so you can close
frame.setVisible(true);
//makes it so you can see it
}
}
class PadDraw extends JComponent
{
Image image;
//this is gonna be your image that you draw on
Graphics2D graphics2D;
//this is what we'll be using to draw on
int currentX, currentY, oldX, oldY;
//these are gonna hold our mouse coordinates
//Now for the constructors
public PadDraw()
{
setDoubleBuffered(false);
addMouseListener(new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
oldX = e.getX();
oldY = e.getY();
}
Samarth Polytechnic, Belhe                                           Page 7
                                                                         Paint Application
});
//if the mouse is pressed it sets the oldX & oldY
//coordinates as the mouses x & y coordinates
addMouseMotionListener(new MouseMotionAdapter()
{
public void mouseDragged(MouseEvent e)
{
currentX = e.getX();
currentY = e.getY();
if(graphics2D != null)
graphics2D.drawLine(oldX, oldY, currentX, currentY);
repaint();
oldX = currentX;
oldY = currentY;
}
});
//while the mouse is dragged it sets currentX & currentY as the mouses
x and y
//then it draws a line at the coordinates
//it repaints it and sets oldX and oldY as currentX and currentY
}
public void paintComponent(Graphics g)
{
if(image == null)
{
image = createImage(getSize().width, getSize().height);
graphics2D = (Graphics2D)image.getGraphics();
graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
clear();
}
g.drawImage(image, 0, 0, null);
}
//this is the painting bit
//if it has nothing on it then
//it creates an image the size of the window
//sets the value of Graphics as the image
//sets the rendering
//runs the clear() method
//then it draws the image
public void clear()
{
graphics2D.setPaint(Color.white);
graphics2D.fillRect(0, 0, getSize().width, getSize().height);
graphics2D.setPaint(Color.black);
repaint();
}
Samarth Polytechnic, Belhe                                                           Page 8
                                         Paint Application
//this is the clear
//it sets the colors as white
//then it fills the window with white
//thin it sets the color back to black
public void red()
{
graphics2D.setPaint(Color.red);
repaint();
}
//this is the red paint
public void black()
{
graphics2D.setPaint(Color.black);
repaint();
}
//black paint
public void magenta()
{
graphics2D.setPaint(Color.magenta);
repaint();
}
//magenta paint
public void blue()
{
graphics2D.setPaint(Color.blue);
repaint();
}
//blue paint
public void green()
{
graphics2D.setPaint(Color.green);
repaint();
}
//green paint
}
Samarth Polytechnic, Belhe                           Page 9
                                                Paint Application
                          CHAPTER 6
                     Outcome of Micro-Project
Samarth Polytechnic, Belhe                                  Page 10
                                                                                        Paint Application
 CHAPTER 7
                                 Benefits of the Micro-Project
 This Micro-Project aims at
    1) To understand the concept of AWT (Abstract Windowing Toolkit).
    2) To understand the concept of Swing Component.
    3) To make the existing system more efficient.
    4) To provide a user friendly environment where user can be serviced better.
                                                                                   CH
Samarth Polytechnic, Belhe                                                                          Page 11
                                                                                       Paint Application
                                                APTER 8
             Skill developed /learning outcomes of this micro-project
 This system enhances the different concept of Java Programming like AWT Components and Swing
Component .Event handling in java programming language.
We also learnt how to make user friendly and environment friendly program through this project of paint
application using AWT and Swing Component.
Samarth Polytechnic, Belhe                                                                           Page 12
                                                                                        Paint Application
                                           CHAPTER 9
                                          CONCLUSION
This report presents an introduction to Java and how Java is used to build graphics and what are
the tools that can be used to develop graphics and drawing required shapes.
This was an introduction to the main goal of our report that presented that is design and
development a simple Painter project used to draw any shape (Circle, Line, Rectangle, Square,
and Oval using FreeHand, Undo and Redo process, Clear JPanel, Set Background Color & set
Foreground Color, Save paint (Panel) to file ( *. JPG; *. GIF; *.* ), and Open paint from image
file are considered. The system enables you to use Free Hand to draw as an easy way to draw the
integrated paint, for example, a car , a street , traffic signals and others.
Samarth Polytechnic, Belhe                                                                          Page 13
                                                     Paint Application
                                   CHAPTER 10
                                    REFERENCE
     https://www.javatpoint.com/java-tutorial
     https://en.wikipedia.org/wiki/
     Java_(programming_language)
     https://www.w3schools.com/java/java_intro.asp
Samarth Polytechnic, Belhe                                       Page 14
                                  Micro-Project Proposal Micro
                                  Project for information about
                                      Paint Application
    Aims of the Micro-Project
      a) To create various types of report and get more knowledge about how to make report.
           We have chosen this micro project to get knowledge about waste management.
      b) Because of the micro project now we have get deep knowledge.
    Course Outcomes Addressed
         a) Implement Event handling with AWT & Swing Component
         b) Develop a programs using AWT Component.
         c) Develop a program using Swing component like JFrame.
         d) Apply the concept of built in packages for code reusability. .
3.0 Proposed Methodology
       Collect the information of all the industrial acts with its different objectives and necessity.
       The os security also include the purpose and various type in detail.
       I searched the micro project topics related to subject. Then selected micro project title. After
       selection of topic searched and collected information related to selected topic. Then
       completed proposal of micro project.
4.0        ActionPlan
                                                    Planned          Planned Name of Responsible
Sr.No                     Details of activity           Start       Finish date Team Members
                                                        Date
             Decide individual micro project
     1                                               14/12/2020     21/12/2020 Thite Purva
             Search micro project topics related
     2                                               21/12/2020     28/12/2020   Varhadi Vaishnavi
                        To subject.
     3       Selection of micro project title        28/12/2020     04/01/2021   Tambe priyanka
            Search information related to
     4                                               04/01/2021     11/01/2021   Varhadi Vaishnavi
                 selected topic
         Collect information related to
5                    selected topic                11/01/2021     18/01/2021 Thite Purva
               Completion of micro project topic
     6                                                 18/01/2021    25/01/2021    Tambe Priyanka
                             Proposal
              Analyze collected data For
     7                                                25/01/2021     01/02/2021    Varhadi Vaishnavi
                  microProject report.
           Finalize collected data For micro-
     8                                                01/02/2021     08/02/2021    Thite Purva
                     Project report.
              Finalize Design & flow of
     9                                              08/02/2021      15/02/2021     Tambe Priyanka
                    Implementation
10                                                  15/02/2021      22/02/2021     Varhadi Vaishnavi
                 Flow of Implementation
11                                                  22/02/2021      29/02/2021     Tambe Priyanka
                 Implementation of report.
 12                                                   29/02/2021     07/03/2021    Thite Purva
                     Report preparation
 13                                                   07/03/2021     14/03/2021 Varhadi Vaishnavi
                     Finalization of report
 14                                                   06/04/2021     06/04/2021    Thite Purva
                     Submission of report
Resources Required
         Sr.         Name of Resource              Specifications                   Qty.         Remarks
          No.        /Material
                                                      Processor 3.00 GHZ,RAM 4
             1             Computer System                                                 1        Used
                                                           GB,HDD 500 GB
             2             Operating System                 Windows 7                               Used
                                                                                           1
             3                 Text editor                 Microsoft Word                           Used
                                                                                           1
             4                  Browser            Mozilla Firefox, GoogleChrome                    Used
                                                                                           1
             5                   Printer                     HP Laser Jet                           Used
                                                                                           1
             6               Other resource              Internet Connection                        Used
                                                                                           1
         Names of Team Members with Roll Nos.
                1. Thite Purva Ganesh                       Roll No.62
                2. Varhadi Vaishnavi Sharad                 Roll No.68
                3. Tambe Priyanka Dilip                      Roll No.60
                                                               (To be Approved by the concerned teacher)
                                              ******************
                                                        ANNEXURE II
                                            Evaluation Sheet for Micro Project
 Academic Year:-2020-21                    Name of Faculty :- Prof. Pokharkar M.S.                     Course:-AJP
 Course Code:- 22517                                                               Semester :-V
  Title of Project :- Paint Application
 Cos addressed by the Micro Project :-
     1.…………………………………………………………………………………………………………
     2.…………………………………………………………………………………………………………
     3.…………………………………………………………………………………………………………
     4.………………………………………………………………………………………………… Major Learning Outcomes
       achieved by students by doing the project :-
a) Practical Outcomes………………………………………………………………………………………..
………………………………………………………………………………………………………………….b) Unit Outcomes in Cognitive
domain…………………………………………………………………..
…………………………………………………………………………….
………………………...................................................................................................................................
............
……………………………………………………………………………………………………
c)Outcomes in Afffective
Domain………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………
………….
Comments /suggestions about team work/leadership/inter-personal communication (if any)
                        …………………………………………………………………………………….
            …………………………………………………………………………………………………………………………..
                                               Marks out of 6    Marks out of 4
                                                     for               for
         Roll                   Student Name   performance in    performance in   Total Out of
         No.                                    group activity        oral /            10
                                                  (D5 Col.8)      presentation
                                                                   (D5 Col.9)
         68             Varhadi Vaishnavi
         62                Thite Purva
         60              Tambe Priyanka
    Mrs.Shelke N.S.
(Name & Signature of faculty)