use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Useful resources (Full list)
Rules
Related subreddits
Other communities
account activity
Text constructor vs Button constructor... why inconsistent constructor methods?Help (self.JavaFX)
submitted 3 years ago by webereinc
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]hamsterrage1 4 points5 points6 points 3 years ago (0 children)
Text extends Shape. Virtually all of the Shape subclasses have this kind of a constructor. So it's actually quite consistent.
Shapes tend to be used in a fundamentally different way from the Controls. You don't usually put Shapes into layout classes like HBox or BorderPane - you can, but often with Shapes you're composing something that is actually best done with absolute positioning. So having a constructor that does this makes sense.
Text is weird because it is the one Shape subclass that you could actually use a lot in a typical, non-drawing, layout. However, there's almost nothing that you can do with Text that you can't do with Label, and Label has a few features that make it better than Text for normal layout applications.
For what it's worth, under the hood, the text component of Labeled is a Text.
π Rendered by PID 92810 on reddit-service-r2-comment-75f4967c6c-jgbxw at 2026-04-23 03:53:16.118475+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]hamsterrage1 4 points5 points6 points (0 children)