Results 1 to 3 of 3

Thread: Use of Graphics class

  1. #1
    Isaac Johnson is offline Member
    Join Date
    May 2009
    Posts
    95
    Rep Power
    4

    Default Use of Graphics class

    I am last year Computer science student.I am learning JAVA programming language. I have little bit knowledge of C++ but it is completely different from advance JAVA.I want detailed information about graphic class in JAVA with example. IF anyone knows about the graphics class in JAVA then let me know that. Thanks in advanced.

  2. #2
    Everett Kyan is offline Member
    Join Date
    May 2009
    Posts
    95
    Rep Power
    4

    Default

    Try to understand the Following properties of Graphics class, it will helpful for you
    • setClip(int xh, int yh, int width1, int height1)
    • hitClip(int xh, int yh, int width1, int height1)
    • getFontMetrics(Font fnt)
    • getClipBounds(Rectangle rct)
    • fillRoundRect(int xh, int yh, int width1, int height1, int arcWidth1, int arcHeight1)
    Last edited by Everett Kyan; 02-26-2010 at 10:34 AM.

  3. #3
    Jack Harris is offline Member
    Join Date
    May 2009
    Posts
    97
    Rep Power
    4

    Default

    I suggest you to refer following example of 'Graphics class', which will give you something idea about the use of this class:
    Code:
    import java.awt.Graphics;
    import javax.swing.JFrame;
    public class GraphicsDemo1 extends JFrame 
    {
      public static void main(String[] abt)
    {
        MainClass fB = new MainClass();
        fB.setSize(300,300);
        fB.setVisible(true);
      }
      public void paint(Graphics gB) 
    {
        gB.drawRect(10, 10, 60, 50);
        gB.fillRect(100, 10, 60, 50);
        gB.drawRoundRect(190, 10, 60, 50, 15, 15);
        gB.fillRoundRect(70, 90, 140, 100, 30, 40);
      }
    }

Similar Threads

  1. Object Vs class
    By CollinsBrown in forum Programming
    Replies: 2
    Last Post: 06-24-2010, 10:58 AM
  2. Using MediaTracker class in JAVA
    By MyersGray in forum Programming
    Replies: 2
    Last Post: 04-01-2010, 02:02 PM
  3. What is the use of pack class?
    By BrooksGray in forum Programming
    Replies: 2
    Last Post: 02-22-2010, 03:50 PM
  4. JSlider class
    By Brownchris in forum Programming
    Replies: 2
    Last Post: 02-17-2010, 01:13 PM
  5. SqlConnection Class
    By WilsonMartin in forum Programming
    Replies: 1
    Last Post: 01-30-2010, 02:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48