Axel Rey

Ranch Hand
+ Follow
since Dec 03, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Axel Rey

Daniel Demesmaecker wrote:you could copy paste the printed path to your equals method of your if.
Better would be to create a boolean at the top of your class, set it to false when you change to classic.css and true if you switch to xmas. That way it will always work.
If you copy paste the path it won't work anymore once you install the program on a other computer or change the location of your program


That's a really good idea! I'll try to implement this. Thanks for your help and tips!! This really helped me out a lot!
21 hours ago

Daniel Demesmaecker wrote:The only tip I can give you here is to print out your path to your xmas.css and compare it to the string used in your if statement, my guess is they won't match


You're right, they don't. They look like this:
String 1:

String 2:
[code=java[jar:file:/Users/axel/Desktop/SideMenu/dist/run1657083674/SideMenu.jar!/sidemenu/resources/xmas.css][/code]

Any clue on how this can be fixed?
22 hours ago

Daniel Demesmaecker wrote:I want an exampe image how it's build, remember my comment about a borderpane when you were asking how to switch css files? If you had done that, now you snow would be in the centerpane and you're buttons in the left pane and you wouldn't had this issue. I don't even understand if you promote your panes to the front you don't see the snow, it falls behind the elements, not behind the pane, I know since when I was checking for ways to make the snow quit faster, I put an AnchorPane in my AnchorPane with the same hight and width and promoted it to the front when clicked on the classic css and that didn't work, the snow was still visible


Oh nice, this really worked! The mistake I made here is that I made a new AnchorPane which was called 'snow' and used that one to make it fall down. I have now attached the snow to my root AnchorPane and it works, thank you! The only issue now is that the snow only falls once, meaning it will only go once through the loop and then just fully stops.
22 hours ago

Knute Snortum wrote:What have you tried?  What about putting the buttons on the AnchorPane tied to the Bottom?

Please don't post long quotes.  Only post as much as is needed for context.


I have tried to switch the position of the panes so that these buttons would be accessible, but that didn't really work.
Do you mean at the main AnchorPane? Wouldn't that just cause them to be under my panes? As this is some sort of side menu, where there are multiple panes which will be brought .toFront(); once their button is clicked. Like for example: when I click 'player' there will be pane_players.toFront(). And these panes are all in the same position, meaning the buttons are attached to the panes itsself. If you want an example image of how it is built, please let me know.
1 day ago

Daniel Demesmaecker wrote:Did you manage to sort it out? If you think it might help, this is how I did it:

Main:


Controller:


FXML:


This really works, thanks! I've now implemented this into my code. The only thing now is that the AnchorPane is in the background, which means the snow won't show. When I bring it .toFront(), I cannot click any buttons. Any fix for this?
1 day ago

Daniel Demesmaecker wrote:Yeah so you also have importen the correct class, otherwise you wouldnt be able to use getScene() without using the fully qualified classname


Yeah and they're also in the same package.
2 days ago

Daniel Demesmaecker wrote:That couldn't be the issue since the nullpointer happens before your code get's there, but it would have cause prijs later on


Yeah, it's just weird that it gives a nullpointer in this method and not in the previous once where I also used .getScene().
2 days ago

Daniel Demesmaecker wrote:

Axel Rey wrote:


By the way: your equals methode wont work... that's the math to my xmass.css


I figured this as it won't work on another computer, adjusted that too but still gives a null.
2 days ago

Norm Radder wrote:

How do I do this exactly?


Here is a link to the JavaFX API doc: https://docs.oracle.com/javase/8/javafx/api/
At the top of the page click on the INDEX link, then click on G for the first letter of the method, search for the method: getScene, then click on the link for that method and read its API doc.

Or if you know the name of the class that getScene is in, find its name in the left hand window, click on it and then scan down to the API doc for the getScene method.


This?:
2 days ago

Daniel Demesmaecker wrote:Could you post your current raining methode?


Current:
2 days ago

Daniel Demesmaecker wrote:In several places in your code you have

Why not deining it once a the top of your controller and use that in the rest of your code? Normally that shouldnt give you the nullpointer, but still. When Im home, I'll post my whole project so you can set where it differs.


I already tried doing that, that didn't work either! For some reason it returns a null in this specific method.
2 days ago

Norm Radder wrote:Did you look at the API for getScene to see when it returns a null value?


How do I do this exactly? I'm not really used to doing those kind of things.
2 days ago

Daniel Demesmaecker wrote:You didn't just copy paste my code right?
I use the scene of the static stage defined in my Main.class, while you use the stage of sideMenu, so you'll have to adjust that


I adjusted that but that still gives me a NullPointer when I try to getScene() there. So at this line, the .getScene():
2 days ago

Norm Radder wrote:

Goes null after

SideMenu.getStage().getScene()


Are you saying that the getScene method returns a null value?


Yes it does! The fix Daniel proposed didn't work either.
2 days ago

Norm Radder wrote:

still the same nullpointer.


Where is the null value?
Break up that long chained statement and print out each part to see where the null value is.


Goes null after
3 days ago