How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Mr. Gregory White Your Own Question
Mr. Gregory White
Mr. Gregory White, Professor
Category: Homework
Satisfied Customers: 5240
Experience:  M.A., M.S. Education / Educational Administration
Type Your Homework Question Here...
Mr. Gregory White is online now
A new question is answered every 9 seconds

I'm using Scene Builder 2.0 with latest JavaFX. I have created

Customer Question

I'm using Scene Builder 2.0 with latest JavaFX. I have created an array of Circle objects that represent RGB LEDs and named each according to their row and column position, i.e.: Code's fx:id = pixel11 and Properties' Id = 11. No custom controls written or needed.
When Circle is clicked, "On Mouse Clicked" is executed and I call a method pixelClicked.
What is the code I should write in pixelClicked to get the Id or fx:id set to a declared (String, I assume) variable?
What's wrong with :
public void pixelClicked(){
String pixelID = Node.getID();
I get this error: "Non-static method 'getID() cannot be referenced from a static context"
Submitted: 2 years ago.
Category: Homework
Expert:  Mr. Gregory White replied 2 years ago.

You need to spend $3 to view this post. Add Funds to your account and buy credits.
Customer: replied 2 years ago.
As I stated above, each Circle object I have created in a GUI array(see attached .png) represents an RGB LED in a panel of LEDs where the minimum number of LEDs is 32x32 = 1024. It's hard to believe their isn't a short combination of classes/methods that would return either the id = 11 or fx:id = pixel11 I enter in Scene Builder 2.0 for all 1024 Circles? The 11 would be the row and column in the matrix; row =1, column =1. With the position in the Id , I can make calculations to turn the circle backgrounds to the same color to represent a line, etc..I don't know what you mean by "Ticket object"; I tried searching it. If you're referring to creating a type of array, I would have to manually initialize it with 1024 elements. In that case, I might just as well create 1024 short methods linked to each Circle's "On Mouse Clicked" and set assign the int Row and int Column to the corresponding int values. I would think I could avoid all that manual input but maybe not?Thanks

Related Homework Questions