daily pastebin goal
28%
SHARE
TWEET

Application.java

SwordPencil Feb 13th, 2018 (edited) 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5. public class Application extends JFrame{
  6.  
  7.     Brush brush;
  8.  
  9.     Application() {
  10.         super("ВЕЛОСИПЕД-ПЕИНТ");
  11.         brush = new Brush(Color.YELLOW);
  12.         setBounds(0, 0, 2000, 800);
  13.     }
  14.  
  15.     void Run(){
  16.         addMouseListener(new Click());
  17.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  18.         setLayout(null);
  19.         getContentPane().setBackground(Color.RED);
  20.         setVisible(true);
  21.     }
  22.  
  23.     private class Click implements MouseListener {
  24.         public void mouseEntered(MouseEvent mouseEvent){
  25.  
  26.         }
  27.  
  28.         @Override
  29.         public void mouseClicked(MouseEvent mouseEvent){
  30.             brush.Draw(mouseEvent.getX(), mouseEvent.getY()); //Рисуем точку
  31.         }
  32.  
  33.         public void mousePressed(MouseEvent mouseEvent){
  34.  
  35.         }
  36.  
  37.         public void mouseReleased(MouseEvent mouseEvent){
  38.  
  39.         }
  40.  
  41.         public void mouseExited(MouseEvent click){
  42.  
  43.         }
  44.     }
  45.  
  46.     public static void main(String [] args){
  47.         Application paint = new Application();
  48.         paint.Run();
  49.     }
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top