• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to prevent of disappearing my original image?

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. Can you help me with my method... I have a panel that draws some image and I need to add there something like a zoombox which appears when the user drags the mouse when I am creating my box my original image disappears. I understand why but I don't see a way to save both image and box. May be you can help=/ Cheers in advance!
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your question can't possibly be answered without knowing what Julia does to JPanel. That said, it looks like you're trying to mesh code from the net with your own (or maybe another disparate code from the net). Those codes are for drawing a selection rectangle on a JLabel that shows an ImageIcon.

Oh, and you should always respect the directives of a copyright owner, even if you change a few things.
http://docs.oracle.com/javase/tutorial/uiswing/examples/painting/SelectionDemoProject/src/painting/SelectionDemo.java

Older Sun copyright notice here and on many other sites:
http://www.java2s.com/Code/Java/Event/Dragswithintheimage.htm
 
reply
    Bookmark Topic Watch Topic
  • New Topic