This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes passing stack elements to paint method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "passing stack elements to paint method" Watch "passing stack elements to paint method" New topic
Author

passing stack elements to paint method

sowjanya vemulapally
Greenhorn

Joined: Mar 14, 2007
Posts: 1
hi
I have problem passing elements from a stack to paint method.
the problem is am poping elements from 2 stacks in main method and passing them to paint method and considering the elements from 1st stack as x coordinate and elements from 2nd stack as y coordinate and need to draw a ellipse on the window using these elements. my prob is while pasing them from main method to paint method the values are changing as null and am unable to pass them to paint method inspite of declaring them as global. can anyone help me in solving this.

sowjanya
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Hi,

Welcome to JavaRanch!

Since Java has no global variables, and the standard "paint()" method takes no user-supplied parameters, I'm afraid you're going to have to give us more to go one. Perhaps a bit of code showing where you "pass" the variables, and another bit where they're "received", and a third bit where they're declared.


[Jess in Action][AskingGoodQuestions]
 
Consider Paul's rocket mass heater.
 
subject: passing stack elements to paint method
 
Similar Threads
Stack
Variable Arguments In Java
re: trying to display a list of arrays
how to make a printer friendly page?
Maze Solving