• Post Reply Bookmark Topic Watch Topic
  • New Topic

Drawing on JPane

 
Himanshu Gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m drawing on jPane but as soon as the frame is minimized or resized all the content vanishes......

i want to retain all the things which has been drawn /....

can anyone help....
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "GrabbingFocous"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, in which method do you have the drawing code? If you put it into paintComponent it will be called whenever necessary, e.g. during resizing.
 
Himanshu Gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wel i changed my name......
is this ok.....
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not.

From the FAQ:
All JavaRanch users are asked to use a real name as their display name, with a first and last name, and maybe more, separated by spaces.


As for your problem, could you show us your drawing code? Especially the paint methods you have overridden.
 
Himanshu Gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i think i changed my name as per your expectations.......

is it ok....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!