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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:39:58+00:00 2026-06-15T22:39:58+00:00

I have to reparent a X-Window (from a C++ app) on a Java frame

  • 0

I have to reparent a X-Window (from a C++ app) on a Java frame (from a java app). This X-Window has to be inserted inside the Java component tree so that the z-Order would be respect. To do that, I need to understand:

  1. First, the exact relationship between the component tree created by
    a Java application and the matching X-Window tree.
  2. Second, whether and where I can insert a X-Window on the Java
    tree thanks to the reparent.
  3. Third, the way the window/component stack is handled: which window/component would be on top of another.

Several weeks of research… but I don’t find any resource on these questions…

About the question 1. As far I understand, If i create a java main frame with components and two other frames the Swing tree should looks like this:

                                Frame0
                                   :
                                   :-------------------------------
                                   :               :              :
                               Component         Frame1         Frame2
                                   :
                     Component-----------Component

About the X-Window tree: aach Frame is an Heavy-Weight component, so each Frame has a X-Window ID. So the X-Window tree could look like this:

                                Frame0
                                   :
                         Frame1---------Frame2

About the question 2. My question is: what happens if I insert an Applet (so an Heavy-Weight component) in the middle of the Swing tree among other components? What the X-window would look like? I hope that by this way I can reparent a X-Window on a Java Application and that this X-Window would be inserted in the Java tree.

About the question 3. Even if I can reparent/insert the X-Window into the Java Application, I’m not sure that the z-order would be respected. In fact, I made a trial and the X-Window has appeared on top of all the component of the Java Frame. I’m not sure to understand the way the window/component stack is handled and its relationships with the java and the X-Window trees.

  • 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-15T22:40:00+00:00Added an answer on June 15, 2026 at 10:40 pm

    Honest disclosure – it has been at least twelve years since I did this type of thing. So take this as “for what it is worth.”

    First, every Swing object in the tree has a heavy-weight container higher up in the Swing component tree – even if it is just the outermost frame. The Swing objects are just logical drawing regions on that XWindow’s surface.

    Question 1: Your answer in the first case is correct provided Frame1 and Frame2 are embedded inside Frame0. Otherwise they are independent XWindows.

    Question 2: When you insert a new heavy weight component in the Swing tree, your new component will be added as a new XWindow component child of the XWindow containing the drawing surface of the Swing component it is added to. This is the part of the answer my memory is most fuzzy on.

    Question 3: (the meat of the matter). The XWindow system first decides which XWindow windows are visible at each point. Then, within each XWindow, but not across XWindows, Swing the draws the corresponding Swing subtree in that region. More accurately, Java draws the Swing sub-tree for each heavy-weight component on the matching XWindow canvas. The XWindow server then determines which portion of these canvases is visible at each point based solely on the XWindow tree.

    So, if you have some Swing object in Frame0 that is closer to the viewer than anything in Frame1 using z-order but it is overlapped by Frame1, IT DOESN’T MATTER. The XWindow ordering will win and Swing components from Frame1 will be drawn.

    Note – once you understand this you can use it to provide “hard” clipping of Swing objects.

    Hope this helps.

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

Sidebar

Related Questions

Have data that has this kind of structure. Will be in ascending order by
Have a Facebook app that is failing as of this morning with the following
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have a simple form that has a PictureBox in one location. I want to
Have a photography site that I want to prevent image copying from. How can
Have not done this before ( except in java , look how Steve McLeod
Have an app that can use tts to read text messages. It can also
have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
have a nice day. I got problem when trying to create an image 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.