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 4271790
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:29:23+00:00 2026-05-21T07:29:23+00:00

Best reader, I’m stuck on one of my concepts. I’m making a program which

  • 0

Best reader,

I’m stuck on one of my concepts.
I’m making a program which classroom children can measure themselves with.
This is what the program includes;
– 1 webcam (only used for a simple webcam view.)
– 2 phidgets (don’t mind these.)

So, this was my plan. I’ll draw a rectangle on the webcamview and make it repaint itself constantly.
When the repainting is stopped by one of the phidgets, the rectangle’s value will be returned in centimeters or meters.

I’ve already written the code of the rectangle that’s repainting itself and this was my result:

(It’s a roundRectangle, the lines are kind of hard to see in this image, sorry about that.)
enter image description here

As you can see, the background is now simply black.
I want to set the background of this JFrame as a webcam view (if possible) and then draw the
rectangle over the webcam view instead of the black background.

I’ve already looked into jmf, fmj and such but am getting errors even after checking my webcam path and adding the needed jar libraries. So I want to try other options.

So;
– I simply want to open my webcam, use it as background (yes live stream, if possible in some way).
And then draw this rectangle over it.
I’m thus wondering if this is possible, or if there’s other options for me to achieve this.

Hope you understand my situation, and please ask if anything’s unclear.

EDIT:
I got my camera to open now trough java. The running camera is of type “Process”.
This is where I got the code for my camera to open: http://www.linglom.com/2007/06/06/how-to-run-command-line-or-execute-external-application-from-java/
I adjusted mine a little so it’ll open my camera instead.
But now I’m wondering; is it possible to set a process as background of a JFrame?
Or can I somehow add the process to a JPanel and then add it to a JFrame?
I’ve tried several things without any succes.

My program as it is now, when I run it, opens the measuring frame and the camera view seperatly.
But the goal is to fuse them and make the repainting-rectangle paint over the camera view.

Help much appreciated!

  • 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-21T07:29:24+00:00Added an answer on May 21, 2026 at 7:29 am

    I don’t think it’s a matter of setting a webcam stream as the background for your interface. More likely, you need to create a media player component, add it to your GUI, and then overlay your rectangles on top of that component.

    As you probably know from searching for Java webcam solutions in Stack Overflow already, it’s not easy, but hopefully the JMF Specs and API Guide will help you through it. The API guide is a PDF and has sections on receiving media streams, as well as sample code.

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

Sidebar

Related Questions

The best I can come up with for now is this monstrosity: >>> datetime.utcnow()
How best can I convert instances of double backslashes to a single backslash in
what's the best RSS reader for .net out there? most efficient and easy to
I want to provide multiple implementations of a message reader/writer. What is the best
I am trying to come up with the best way to render some hierarchical
What would be the best way to implement, store, and render spherical worlds, such
Best recommendations for accessing and manipulation of sqlite databases from JavaScript.
How best to make the selected date of an ASP.NET Calendar control available to
For best performance, is it better to use a virtual IDE HDD or virtual
As best-behaved as I try to be about keeping my unit tests disconnected from

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.