desenhoLinha

by teste on February 23rd, 2012
No notes
Syntax: Java
Show lines - Hide lines - Show in textbox - Download
  1. package rsjuliao;
  2.  
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5. import java.awt.geom.Line2D;
  6.  
  7. import javax.swing.JFrame;
  8.  
  9. public class Teste extends JFrame{
  10. private static final long serialVersionUID = 2507706525784405524L;
  11.  
  12.  
  13. public static void main(String args[]){
  14. Teste t = new Teste();
  15. t.show(true);
  16. }
  17.  
  18.  
  19. @Override
  20. public void paint(Graphics graph) {
  21. super.paint(graph);
  22. Graphics2D graph2D = (Graphics2D)graph;
  23.  
  24. graph2D.draw(new Line2D.Double(0, 0, 100, 100));
  25. }
  26. }
  27.  

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS