Results 1 to 4 of 4
  1. #1
    jforce93 is offline Member
    Join Date
    Aug 2009
    Posts
    24
    Rep Power
    0

    Default using multiple methods for graphics

    Hi everyone,

    I am trying to create a java package that uses different methods to paint graphics onto the screen. I know all about paintComponent(Graphics g), but I'm trying to get it to work with different methods. I am totally lost :confused:

    Can someone please help me with this?

    Thanks,

    Jordan

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by jforce93 View Post
    I am trying to create a java package that uses different methods to paint graphics onto the screen. I know all about paintComponent(Graphics g), but I'm trying to get it to work with different methods. I am totally lost :confused:

    Can someone please help me with this?
    I'm not sure we can help you yet without more information. What have you tried? What specifically don't you understand? The more specifics you can provide, the better anyone will be able to help you. Best of luck.

  3. #3
    jforce93 is offline Member
    Join Date
    Aug 2009
    Posts
    24
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    I'm not sure we can help you yet without more information. What have you tried? What specifically don't you understand? The more specifics you can provide, the better anyone will be able to help you. Best of luck.
    What I was trying to do was to create differant methods to draw differant things onto a JPanel. But, I figured another way to do it, (I sorta winged it) by using differant classes instead.

  4. #4
    camickr is online now Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    I know all about paintComponent(Graphics g), but I'm trying to get it to work with different methods
    Well, then stick with what you know, because overriding the paintComponent() method is the proper way to do custom painting.

    Read the section from the Swing tutorial on Custom Painting.

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. JDBC that multiple methods will use
    By evermore in forum JDBC
    Replies: 3
    Last Post: 03-16-2010, 07:27 AM
  3. Replies: 4
    Last Post: 04-03-2009, 06:36 AM
  4. Replies: 5
    Last Post: 07-18-2008, 04:30 PM
  5. Trying to use Graphics draw methods
    By Lang in forum SWT / JFace
    Replies: 5
    Last Post: 03-26-2008, 05:49 AM

Tags for this Thread

Posting Permissions

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