• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Confused on connecting my program to my drawing

Ranch Hand
Posts: 574
VI Editor Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out, Foo now extends JPanel and MyPanel went away.

Not sure what the protocol is here, should I answer my question like I just did, or ask the mods to delete the post?

Original post follows.

My main program will repeatedly populate and display a grid of data. My problem is, when I need to draw the grid I need access to both my data and my graphics object. Referencing the code below, if I draw it in the Foo class I don't know how to get my graphics object. If I do it in MyPanel.paintComponant then I don't know how to get at Foo's data.

I've stripped my code as much as I can, which is why some of it may not make sense. The goal is to let Foo manipulate the grid array and display it every time I finish an iteration (note, I stripped the looping over grid out of the code)

    Bookmark Topic Watch Topic
  • New Topic