I'm really tired of being engaged with stuff other than Java and programming
Wish to get back soon to my love...
here is the SSCCE :
Rob Camick wrote:
here is the SSCCE :
That is not a SSCCE, please reread the information found on the SSCCE link.
General comments:
a) Read the section from the Swing tutorial on "Custom Painting". You should NOT be using a Canvas in a Swing application. Use a JPanel and override the paintComponent() method.
b) Scroll bars appear automatically when the preferred size of the panel is greater than the size of the scroll pane. If you are doing free hand drawing then you need to continually recalculate the preferred size as the shapes move outside the bounds of the panel. How you do this is up to you since we don't know how your actual application works.
I'm really tired of being engaged with stuff other than Java and programming
Wish to get back soon to my love...
I will appreciate if you link the SSCCE
i wrote,this is not that exists in awt,just has the same name !
Actually i want to set the preffered size of panel "canvas" to some value that if the dimensions of drawing image got bigger than it,scroll bars act on the panel "canvas"
I'm really tired of being engaged with stuff other than Java and programming
Wish to get back soon to my love...
So now that you've proven the simple concept works you figure out what your real program is doing differently.
I'm really tired of being engaged with stuff other than Java and programming
Wish to get back soon to my love...
Esmaeil Ashrafi wrote:I'm sorry,the whole code is here,i eill go to learn what is SSCCE !
I just wanted to avoid posting too many lines of code and bother you
and also your code will compile for no-one (no one has all the classes).
I'm really tired of being engaged with stuff other than Java and programming
Wish to get back soon to my love...
Esmaeil Ashrafi wrote:
just please read the end of my previous post "Dear Volunteer"
by the way i think the segment of ocdes i put in first post,was the SSCCE,why?because it covers the segments related to question,dont you think!?all codes related to the problem was in "constructor" and then in "actionPerformed()" after you helped
by the way,thank you very much
Esmaeil
Consider Paul's rocket mass heater. |