Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:25:33+00:00 2026-05-30T20:25:33+00:00

Using Java, I generate a new JFrame frame and load an image into it

  • 0

Using Java, I generate a new JFrame frame and load an image into it along with some buttons:

enter image description here

I then click on ‘Classify’ in order to detect the main area of interest and this produces an image such as the following:

enter image description here

However, when I click ‘Classify’ once again, the first drawings (green and red circles) remain on the image and they are then classified. How can I do it so that when I click ‘Classify’ for a second/third/n-th time, the image is reset (all drawings/circles removed) back how it was before ‘Classify’ was clicked?

I have a ‘Reset Image’ JButton, but I have yet to implement this (hence my question!).

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:25:34+00:00Added an answer on May 30, 2026 at 8:25 pm

    Memory usage efficiency aside, you could store the initial graphics state into a BufferedImage. And upon clicking Classify, draw onto a copy of the Graphics object of that image instead, and then paint the area with it.

    And upon clicking Reset Image, just draw the image directly to the area.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Java to generate the MD5 hash for some files. I need
I am trying to generate Java classes using Eclipse (New Web Service Client). Eclipse
I'm using Java, and need to generate a simple, standards-compliant RSS feed. How can
I have this Maven task to generate Java classes from an XSD file using
I am using maven to generate a website for a Java project, which uses
I'd like to generate sequence diagrams of a running java ee application using jtracert
I'm trying to print a JFrame using the PrintUtilities Class: package util; import java.awt.*;
I'm trying to generate that kind of JSON String using Java (purpose : flot
I am using java.awt.geom.Rectangle2D.Double class to generate a rectangle. I want to generate a
New to spring, we have a whole pile of validators that generate java warnings,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.