Results 1 to 5 of 5

Thread: drawing

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    drawing

    I plan on writing an app that will graph polynomial expressions. My question is, what should I draw the graph on? Should I just use the regular frame and use DrawLine(), or is there something like a bitmap, or canvas thing I should use?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: drawing

    I think you should definitely use an offscreen BufferedImage and blit that to the screen on drawing.

    I've seen a graph library that doesn't - at 30000 plotted points, every movement of the window is about 4 seconds delayed.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: drawing

    OK, thanks CB.

  4. #4

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: drawing

    I created the bufferedImage in a seperate class that extended JPanel(Called ImagePlotter)...I did this in the "driver" class trying to create an instance of it, and adding it to the container, but it's not showing up.

    ImagePlotter ip = new ImagePlotter();

    Container pane = getContentPane();

    pane.add(ip);

    is this how I was suppose to do this?

  5. #5

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: drawing

    I just went with painting the component since the bufferedImage wouldn't work..But I have one more question: If I have the cartisian coordiante plane drawn, would it be possible to only repaint one line graphed on it, instead of everything in the paintComponent method?

Posting Permissions

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



Click Here to Expand Forum to Full Width