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

  • Home
  • SEARCH
  • 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 8349979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:10:27+00:00 2026-06-09T08:10:27+00:00

This is how I plan to make it: There will be a small JFrame

  • 0

This is how I plan to make it:
There will be a small JFrame with start and stop buttons to start and stop recording. Clicking start will start a thread that will create a java.awt.Robot that will take repeated screen shots.
Here is where my problem starts. Robot does take a screenshot but
1. The position of the cursor will not be recorded
2. I dont know where the image will be stored. I intend to store them in a folder whose name will be determined using java.util.Date.
3. I dont understand BufferedImage class one bit.

I have finished making JFrame and implemented the thread. I have package that I got from the internet that converts images to avi movies.
Please help me solve the above mentioned three problems.

Edited:

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.File;

public void captureScreen(String fileName) throws Exception {

   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
   Rectangle screenRectangle = new Rectangle(screenSize);
   Robot robot = new Robot();
   BufferedImage image = robot.createScreenCapture(screenRectangle);
   ImageIO.write(image, "png", new File(fileName));

}  

if you could please explain t he above mentioned code with respect to my problem.

  • 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-06-09T08:10:28+00:00Added an answer on June 9, 2026 at 8:10 am

    The solution for getting the cursor in the screenshot is to:
    figure out the position of the cursor.

    java.awt.MouseInfo.getPointerInfo().getLocation()
    

    and place a rendered image of the cursor on top of the screenshot.
    Take a look at this: http://docs.oracle.com/javase/tutorial/2d/images/index.html

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

Sidebar

Related Questions

This will be a Windows Forms application deployed through ClickOnce. The plan is to
I have the need to create a plugin system that will have dependency support
We are planning to develop a CIFS server using Java. Note that this will
This may seem strange... but I'm wondering if there is anyway to make a
I need to make a button that will display different things depending on the
I want to make a ListView that has small images, that was taken from
I'm trying to make an algorithm that will find the most efficient ordering for
(At first glance this may look like a duplicate of Different execution plan when
if your app use this solution , do do you plan port the app
My application is being developed in silverlight. Plan to launch it later this year.

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.