JonathanGiles / jonathangiles.net-comments

0 stars 0 forks source link

posts/2009/javafx-building-custom-controls/index #140

Open JonathanGiles opened 4 years ago

JonathanGiles commented 4 years ago

JavaFX: Building custom controls

https://jonathangiles.net/posts/2009/javafx-building-custom-controls/

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Tom Comment posted on: July 3, 2009

Interesting post!

JonathanGiles commented 4 years ago

Auto-imported comment, original author: joke Comment posted on: July 3, 2009

nice post but the source code is unviewable under safari iphone because there is no horizontal scroll. pleaze check the look and feel under safari iphone user agent. thanks

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 3, 2009

@joke: I'm aware it doesn't work on iPhone - I have one. I can't resolve this issue without changing how my site does formatting, which is too much work. I suggest you try on a real browser :-)

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Eric Wendelin Comment posted on: July 17, 2009

Very useful example, Jonathan. Thanks.

The latest version of SyntaxHighlighter fixes the horizontal scrolling bit so it looks better but not great on the iPhone.

BTW, if you're interested I wrote an update to SyntaxHighighter for JavaFX: http://eriwen.com/javafx/javafx-syntaxhighlighter/

Cheers!

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: July 17, 2009

Eric,

Thanks for this. Unfortunately I presently use the Google Syntaxt Highlighter for wordpress, which for better or worse is the one I am stuck on unless I want to go back and rework all my source code examples.

Thanks though - and thanks for the JavaFX improvements. You should get them into the Google one - it's the same base.

-- Jonathan

JonathanGiles commented 4 years ago

Auto-imported comment, original author: John Comment posted on: November 2, 2009

Hi Johnathan. I stumbled on your blog post after having problems creasting my own UI control. Your example works fine but I am not sure how. If you println the buttonControl variable at the top of the init() method in the skin class it's null. This is the problem I am facing in my control but what is strange is although it's null it seems to be working in your example. I suspect it's somethiing to do with binding but any ideas?

init { println("skininit{buttonControl}"); //null .. .. .. text: bind buttonControl.text; }

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Marko Comment posted on: February 22, 2010

Thanks for this post. What would be the best way to add for example animated hover effect on JGButton control. I could add them in place where I initiate control in form of onMouseEntered, or should it be in JGButton as properties(hoverColor, hoverOpacity, hoverDuration etc) and animated in JGButtonBehavior class?

JonathanGiles commented 4 years ago

Auto-imported comment, original author: Jonathan Comment posted on: February 24, 2010

@Marko: Sorry for taking so long to reply - things have been hectic around here. To quickly answer your question - if the property is a publicly-settable property, then it should be on your subclass of Control. If it is not something you want to expose publicly, it should be on your subclass of Skin. Additionally, because this is related to the skin and not behavior, I would say that this should have nothing to do with behavior.

My recommendation would be to probably consolidate everything inside the Skin subclass - detect the hover and then start the animation.

Hope that helps - sorry for the brevity - but feel free to ask any further questions. Cheers, Jonathan