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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:35:25+00:00 2026-05-31T22:35:25+00:00

I have a stackpane. When I add a second item to my stack pane,

  • 0

I have a stackpane. When I add a second item to my stack pane, both show up, but I can’t click on my first item anymore. It becomes ‘unclickable’.

what ever I defined in my .setonmouse does not work. It works for my second item. If I switch the order they are in the stack pane, the other one works, but not both.

is there a fix for this? This is what my program looks like:

I want my ‘grid’ centered ALWAYS. There are buttons to the left centered in a column, there will be buttons on the right later on, and there will be buttons/Text on top of the grid and buttom in the margins later on too.

I want everything to be clickable.

http://img688.imageshack.us/img688/6025/examplerg.png

  • 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-31T22:35:26+00:00Added an answer on May 31, 2026 at 10:35 pm

    StackPane orders items in Z-order: latter above the former. So, your second item gots all mouse clicks and first one (being covered by second) doesn’t get anything.

    For layout you’ve described you can use BorderPane:

    public void start(Stage stage) throws Exception {
        BorderPane root = new BorderPane();
        root.setCenter(new Rectangle(100,100, Color.RED));
        root.setLeft(new Rectangle(10,10, Color.BLUE));
        root.setRight(new Rectangle(10,10, Color.CYAN));
    
        stage.setScene(new Scene(root,300,300));
    
        stage.show();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a binding for ListBox but how I can add an event to
I have 2 Datatemplates. One contain a grid , second one contain a button.
I have a ListBox which is bound to a collection. When I add an
I have two Grids inside a Stackpanel. The first grid is named as GridX.
I have a WPF application that I'm trying to dynamically add items to a
I have a stack panel with a few (different) items: <StackPanel ...> <TextBlock ...
I have a screen with several UserControls, but only one of them remains active.
I have a file in which the first line is a phone and the
I have the exact same problem as quoted (taken form here , but not
I'm sure this is dead simple, but I can't seem to figure it out.

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.