• Post Reply Bookmark Topic Watch Topic
  • New Topic

Confused on connecting my program to my drawing  RSS feed

Jim Venolia
Ranch Hand
Posts: 312
Chrome Linux VI Editor
  • Mark post as helpful
  • send pies
  • 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)

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!