• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using graphics

 
Shae Oommen
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to develop a gui using swings and graphics.

I have a Frame with two Panels.

One Panel is used for the graphics part and the other to have a textfield and a button.

When i try to draw a line on the graphics panel, i should get the coordinates on the text filed.

Everything works fine, but when I give repaint(), the entire frame gets displayed over the previous one. how do i avoid this?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not quite sure what you're describing, but if components are being repainted so that some are unexpectedly on top of others -- if the z-order is screwed up -- it may be because you are mixing old heavyweight AWT components and lightweight Swing components. Is that the case?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Swing / AWT / GUI forum.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!