Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. package com.cs.unipi.stavrosvl7.DesignPatternsSRP;
  2.  
  3.  
  4. import javax.swing.*;
  5.  
  6. public class Main {
  7. public static void main(String[] args) {
  8.  
  9. Shape myShape = new Shape();
  10. GeometricShape geometricShape = new GeometricShape();
  11.  
  12. JFrame f = new JFrame();
  13. f.setSize(600, 600);
  14. f.setContentPane(myShape);
  15. f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  16.  
  17. myShape.draw(); //APPLICATION 1
  18. f.setVisible(true);
  19.  
  20. //APPLICATION 2
  21. System.out.println("Lower Right Corner. X: " + geometricShape.getXLowerRightCorner() + " Y: " + geometricShape.getYLowerRightCorner());
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement