Hi
I work with netbeans.
I have written a code which has two classes (1) Demo (2) mainFrame which extends javax.swing.JFrame
at first, my mainFrame will be run and it will show a panel that you can put some points on it and then when you click a button ; the dimension of all points will be store in a list , then I will send this list to Demo class because I have to put the points in an order that you can draw a line between each two points respectively.
I have two problems here :
-
I have that
list <listOfPoints>,how can I send this list tomainFrameclass for drawing lines without making a new object of themainFrameclass? -
I should work with paint method?
please help me by some code example in java (with netbeans)Totally :
I have a lot of points' dimension in my list ,I want to traverse my list in the i.e., paint method and draw line between each pi and pi+1.how can I do this?
thanks
Google: netbeans java drawline
first answer
search
http://wws2.uncc.edu/tpw/tpwJavaNtebeansTutorial/index.html
regarding your question about drawing a list of points
And if you don’t feel like passing object from one frame to the other male drawList static and then you can do MyClassContainingDrawLineMethod.drawList(gg, points);