I am very curious about an example that I am trying to imitate in my own code. My own code isn't working yet and I'm confident that it is because I don't understand the example very completely. Unfortunately, the person who prepared the example didn't bother to explain it in much detail either. I was wondering if someone could walk me through each of the three classes - especially the part in Main.java that involves setCellFactory() and setCellValueFactory() - line by line and explain what exactly is going on?
This is a link to the example:JavaFX8 – Render a DatePicker Cell in a TableView
The code clearly works as it is; I've run it myself and satisfied myself that it works. I've run it in Debug mode of Eclipse also but don't really understand what I'm seeing. I was hoping someone could explain it line by line. With a bit of luck, that will "make the penny drop" so that I can see what I am doing wrong.
Or can someone suggest a better approach to understanding why the example works but my code doesn't?
Related
In VS code (for my Javascript file), the text sometimes fades when I edit my code. Does anyone know what this means? I have researched it online, but can't find its purpose. I know arguments and variables in functions fade out until they are written in the function, but I haven't seen it before for entire functions.
I've included all my installed extensions in the picture in case one of these is doing the fade. I can also include all my code if I did not provide enough information. Thank you!
Edit: to clarify, the faded text I am speaking of is the entire function placeInTable(y,x) I am not speaking of the commented code.
EDIT: answered about the commented part first, not reading the entire question
The function is faded because it hasn't been called, so no actions inside it have been executed.
I have a Java GUI that I'm developing and I've run into a snag with regard to the default size of the "thumb" on a JSlider I need for user input for the simple and unavoidable reason that the application has to run on a touch-screen, there is no mouse, and the precision of the touch of a finger is just not good enough to make it easy to "get a grip" on the slider to move it. The touch screen is all there is... it just isn't that precise.
NO PROBLEM, I thought! I'll just customize it and make the "thumb" bigger! In doing my research I found this previously asked question, and it has what looks like helpful data, but I couldn't figure out how to get that to work. In the answers to that question it points to this page where it purports to show how it's done, but ... it then doesn't show it?!
I guess they presume you know what to do with the likes of:
Slider.thumbHeight Integer
Slider.thumbWidth Integer
But, I don't! Anybody got any code snippet of an example?
I played around, incompetently, with stuff like this that I really don't quite understand:
UIDefaults defaults = UIManager.getDefaults();
defaults.put("Slider.thumbHeight", 45);
defaults.put("Slider.thumbWidth", 15);
...With no success, though it does compile just fine. I tried creating the slider after this. Nope. I tried mySlider.updateUI(); Nope. And, of course, this won't compile at all: mySlider.thumbHeight(40); ...I just don't quite grock how one is supposed to customize these things.
Thanks in advance.
Old post I know, but still may be relevant for others anyway.
"Slider.thumbHeight Integer" just tells you that the variable is of type integer and thus expects a whole number as an argument when you set it.
You have to change the UIdefaults (as in your example) before you create the JSlider.
This said it seems to be operating system dependent whether it works or not. It worked well on my Windows10 PC but not on Raspbian Linux where I really needed it :-(
My app is hanging during search in a table view.
For what it's worth, the view hierarchy is very complex, there are popovers involved as well as filters and search bars etc. I am reviewing all those possibilities.
But the non-crash - it's an infinite loop - occurs when the search results table is being displayed / updated, after a call to reloadData.
Here is what I get when I stop the program and look at the main thread:
You can see - it involves UIView, CALayer, CATransaction. I have no clue how to get back to my controller classes to find the offending code.
Any hints, suggestions, wild guesses welcome!
EDIT Here is more - some more classes appearing when I interrupt at some other random point.
This is an old question, but in case other folks arrive here: it's possible you're facing a layout feedback loop. I wrote an article about how to debug these (link: Debugging Auto Layout feedback loops) but here's a summary:
If you modify your layouts during layout, or if you have ambiguous layout, you might find yourself stuck in a loop.
Apple discussed a special debugging technique at WWDC 2016 – skip to about 15 minutes before the end, and they introduce the layout feedback loop debugger.
To try it yourself, add -UIViewLayoutFeedbackLoopDebuggingThreshold 100 to the list of launch arguments for your app, then run it again.
When the error happens next time, you should get (a lot of) debugging information that helps point you in the right direction.
i've inserted a view before an established table view if that makes sense. ie. i had an app with a first and second view, then i put another view before the first view, now the content doesnt show up in the (now) third view!? Any ideas why that would be? Would i make to make some changes in the app delegate maybe??
Thanks
EDIT:
Sorry, i wasnt sure which bit of the code would be relevant to my problem and i didnt want to flood the post with my entire code so i zipped it up if anyone can help?
Thanks
Source Code
Here is complete tutorial for a table view with navigation.
your question is extremely vague and confusing, hopefully next time you can provide some code and you might be able to get better responses from the community
Something weird is happening to my views all of a sudden (resizing a UITableView results in strange flying header sections) and I have a feeling I'm missing a '[UIVIew commitAnimations]' somewhere in code. When I add this line into 'viewForHeaderInSection', the weird behavior stops.
Question is, how can I find animation blocks with missing 'commitAnimations' statements? I've given the code a manual look and couldn't find anything. It's also a huge project and I can't see where something might have gone wrong. Please help!
Command+Shift+F ("Find in Project") and type "[UIView beginAnimations" with the "contains" option and you should be able to find all of the instances in your project where the [UIView commitAnimations] should be.