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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:50:51+00:00 2026-06-01T08:50:51+00:00

i dont how to solve this problem. I am developing a graphical editor, where

  • 0

i dont how to solve this problem. I am developing a graphical editor, where arc(line) drawing is possible. I manually set the size of arc component to 1000×1000, so i dont have to change it when this arc will be dragged & dropped. Then i paint into this component the arc of the desired dimensions. Every arc components have mouse listener installed. The problem is, that only the most upper arc component get the mouse message.
Also i have a mouse click listener installed on the JPane itself, but the mouse click listener on the most upper component simply gets all the events…It is kinda hard to describe this problem, so i will provide you with the simple image

enter image description here

So the first solution is to somehow forward the received message to the component that lies under, however i dont know how to do this, so do you have any ideas ?

The second solution is, not to set constant dimenstion to the arc object, but somehow rotate the rectangle in which that arc will be, i mean it like this.
enter image description here

however, there still can be the overlapping problem.

So, do you have any ideas how to solve this problem ? or if you have any other ideas, how to solve this, id be happy, i simply need that the correct arc will react to the mouse click.

I dont think that the my code will somehow helps, but here it is

arcObject.setSize(1000, 1000); // !

and then, in this component i draw an arc

toX = o2.x - 24 * Math.cos(theta);
toY = o2.y - 24 * Math.sin(theta);
g2.draw(new Line2D.Double(toX, toY, o1.x, o1.y));
  • 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-01T08:50:53+00:00Added an answer on June 1, 2026 at 8:50 am

    I solved it like this:

    1. save all created arcs to the List
    2. when mouse clicked, loop through all the arcs
    3. create new Line2D object, with the parameters of the arc saved in the list, like this:

      Line2D line = new Line2D.Double(…)

    4. check this condition

      if (line.ptLineDist(x, y) < 3) {
      … //we clicked on the line, do something

      }

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

Sidebar

Related Questions

I don't like JSF but I need to solve this problem with it, I
Well i need some help here i don't know how to solve this problem.
I have an interesting problem to solve. One of my clients has me developing
I'm quite new to PHP so I don't know how to solve this error.
I'm trying to solve the problem here but I don't know why my code
I have a problem I don't know how to solve. I have an Indy10
Do interfaces solve the deadly diamond of death problem? I don't think so, for
I have a simple problem but I don't know how to solve it because
I'm still working on my leaks problem and I don't know how to solve
I am developing an application for automating the BVT process of our product. This

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.