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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:59:26+00:00 2026-05-31T21:59:26+00:00

How can I change the attributes of objects that are stored in a grid?

  • 0

How can I change the attributes of objects that are stored in a grid? I tried this, but it gives me the above error:

    Group group = new Group();
    double dimension_x=100;
    double dimension_y=100;

    GridPane grid = new GridPane();
    grid.setHgap(1);
    grid.setVgap(1);
    grid.setPadding(new Insets(36));
    grid.setGridLinesVisible(true);

    Rectangle temp = new Rectangle(dimension_x,dimension_y);
    Rectangle temp2 = new Rectangle(dimension_x,dimension_y);
    Rectangle temp3 = new Rectangle(dimension_x,dimension_y);
    Rectangle temp4 = new Rectangle(dimension_x,dimension_y);

    grid.add(temp, 0,0);
    grid.add(temp2, 1,1);
    grid.add(temp3, 2,2);
    grid.add(temp4, 3,3);

    for (final Node node : grid.getChildren())
    {

        Rectangle tempvar = (Rectangle) node;  //Errors out at javafx.scene.Group cannot be cast to javafx.scene.shape.Rectangle
        node.getStyleClass().add("box");
        //tempvar.setFill(Color.TRANSPARENT);
        //tempvar.setStroke(Color.WHITE);

    }

is there any way to loop through my grid and change the objects?

  • 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-31T21:59:27+00:00Added an answer on May 31, 2026 at 9:59 pm

    Print the result of grid.getChildren().

    I’m suspicious that grid contains other objects other those 4 Rectangle

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

Sidebar

Related Questions

How i can change the color with gradient??? I have this now,but is different
Is there a way I can change attributes on a model without ever firing
I understand that I can change a sql table using the follow sp: EXEC
I'm developing a plugin that has node(computer) objects with attributes like: String name String
I am new to mongodb/mongomapper and can't find an answer to this. I have
According to http://msdn.microsoft.com/en-us/library/ms810291.aspx , you can't change the ReadOnly attribute of an Expression based
I can change SQL at runtime. Can I do the same with LINQ ?
I can change the irb prompt mode with irb --prompt prompt-mode I can see
Where I can change compiler options for C# project in VisualStudio 2008 (without command
I know I can change the selectionStyle of a UITableViewCell to make it highlight

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.