Results 1 to 5 of 5
Thread: Creating a Gridpane
- 08-03-2016, 01:35 PM #1
Member
- Join Date
- Aug 2016
- Posts
- 4
- Rep Power
- 0
Creating a Gridpane
Hi first post here.
I'm stuck with this problem for some days: I have done a code sample of what I need but I get invisible Grid Lines. Not sure why they are not shown. I've tried different settings and also with adding pane and experimenting with SetVisible(true) but no luck, here is the code:
Java FX Code:Integer rr_status_row_index; Integer iff_bit_row_index; Integer iff_status_row_index; //Method to draw the Grid Panel when action in Menu Overview @FXML private void menuOverview(ActionEvent event) { Integer i = 0; // CLear previously created Grid Panel grid.getChildren().clear(); grid.setGridLinesVisible(true); //Check if CAR Menu item is enabled or disabled in Vehicles if (CAR_Status.isSelected()) { //draw row in Grid Panel String colorname = "Red"; //Status of messages into an array String[] ArrayColor = new String[11]; ArrayColor[0] = "Red"; ArrayColor[1] = "Green"; ArrayColor[2] = "Yellow"; ArrayColor[3] = "Yellow"; ArrayColor[4] = "Yellow"; ArrayColor[5] = "Yellow"; for(int count=0; count<11; count++){ Label txt = new Label(" "); grid.add(txt,count,i); if (count ==3) { txt.setStyle("-fx-background-color: black;"); } if (count ==5) { txt.setStyle("-fx-background-color: blue;"); } } rr_status_row_index=i; i++; //END draw row for CAR_Status grid.setGridLinesVisible(true); } if (IFF_Status.isSelected()) { //draw row in Grid Panel grid.addRow(i, new Label("TRUCK_Status")); System.out.println(i); iff_status_row_index=i; i++; grid.addRow(i, new Label("TRUCK_BIT")); iff_bit_row_index=i; i++; //END draw row in Grid Panel } //Draw the fixed row in Grid Panel grid.addRow(i, new Label("I am fixed!")); grid.setGridLinesVisible(true); }
I also tried to test with SetVisible(true) and actually the Grid lines were shown but the Grid layout was not working. My thoughts are: Is it a layer problem that the grids are not shown.
Thanks for your help!
- 08-03-2016, 01:47 PM #2
Re: Creating a Gridpane
Also posted here: Creating A Gridpane - Java | Dream.In.Code
If you don't understand my response, don't ignore it, ask a question.
- 08-03-2016, 08:24 PM #3
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 15
Re: Creating a Gridpane
I don't see anything advanced about this. But it doesn't matter since it should be under the JavaFX subforum.
Regards,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 08-06-2016, 07:47 AM #4
Re: Creating a Gridpane
Where is the first part of the code that contains your Jpanel object and how the CAR_Status is defined?
"The secret to getting what you want is to reject everything that you don't want." -Wolbers
- 08-09-2016, 10:40 PM #5
Member
- Join Date
- Aug 2016
- Posts
- 4
- Rep Power
- 0
Re: Creating a Gridpane
Complete code posted here: Creating A Gridpane - Java | Dream.In.Code, Creating A Gridpane - Java | Dream.In.Code
Similar Threads
-
Creating a GUI
By HoustonsOwn88 in forum New To JavaReplies: 6Last Post: 11-16-2012, 10:38 AM -
Creating an array constructor and then creating an object in a main method
By kev3kev3 in forum New To JavaReplies: 4Last Post: 04-02-2012, 02:50 PM -
Creating and implementing class for creating a calendar object
By kumalh in forum New To JavaReplies: 9Last Post: 07-29-2011, 03:18 PM -
Creating an EXE help
By funnygames in forum New To JavaReplies: 5Last Post: 09-27-2010, 08:53 PM -
Creating files stopped creating...
By Dieter in forum Advanced JavaReplies: 3Last Post: 09-26-2009, 12:45 AM
Bookmarks