Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jerry Stuckle Newsgroups: comp.lang.java.programmer Subject: Re: Returning to Java - have questions Date: Mon, 26 Jan 2015 15:18:33 -0500 Organization: A noiseless patient Spider Lines: 69 Message-ID: References: <3d67c01a-1dfe-463b-91fe-fa8f2c2c34c4@googlegroups.com> <2b7ddfd1-ad9b-4637-a506-81697639d863@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 26 Jan 2015 20:18:01 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3088393e34bc61b3e6a923d0c81ae1e3"; logging-data="5252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19C1JBMMxIBZBLrSvbp9HTbgfS/iu9F78k=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: <2b7ddfd1-ad9b-4637-a506-81697639d863@googlegroups.com> Cancel-Lock: sha1:InANSZ/Y02YhPEVohG285qw4AJ4= Xref: csiph.com comp.lang.java.programmer:30931 On 1/26/2015 3:00 PM, FredK wrote: > On Friday, January 23, 2015 at 4:27:52 PM UTC-8, Jerry Stuckle wrote: >> On 1/23/2015 5:26 PM, FredK wrote: >>> On Friday, January 23, 2015 at 8:49:33 AM UTC-8, Jerry Stuckle wrote: >>>> On 1/23/2015 10:52 AM, Jeff Higgins wrote: >>>>> On 01/23/2015 09:59 AM, Jerry Stuckle wrote: >>>>>> On 1/23/2015 8:08 AM, Jeff Higgins wrote: >>>>>>> On 01/22/2015 09:47 PM, Jerry Stuckle wrote: >>>>>>> >>>>>>>> >>>>>>>> Which has nothing to do with the look of a button when it is pushed. >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Maybe future iterations will give you public behaviors? >>>>>>> >>>>>> >>>>>> You really don't understand. This has NOTHING to do with skins. In >>>>>> swing it was very easy to set both the pressed and released images via >>>>>> the button's properties. With JavaFX you can only set the pressed image >>>>>> via CSS. >>>>> >>>>> OK, I'm glad you've got it sorted out. >>>>> So, you're now convinced there is one way to accomplish what you want. >>>>> That is not the way you want to doit. >>>>> Maybe file a feature request? >>>>> Anyway, happy to help. >>>>> >>>> >>>> No, your updates all along have shown you have no idea what I'm talking >>>> about. I appreciate your attempts to help, but you haven't understood a >>>> word I've said. >>>> >>>> But you can prove me wrong. Show me how I can change the pressed image >>>> if a Button object without using CSS. It has to work wither using the >>>> mouse or keyboard (including accelerator keys - IOW, every way a button >>>> may be pressed). >>>> >>>> In Swing, it's as simple as calling JButton.setPressedIcon(), passing >>>> the pressed image (an ImageIcon object). >>>> >>>>>> >>>>>> I see this as a step backwards. >>> >>> Try this: >>> Call button.setOnMousePressed() to register a callback for the press. >>> In that callback method, call button.setGraphic() to set the new image. >>> >> >> Fred, unfortunately, that only works for mouse clicks. It doesn't help >> with keyboard entry (which could be the space bar or an accelerator key). >> > > Well, you can just call button.setOnKeyPressed() to register a similar callback, which checks calls setGraphics() if the key is the appropriate key.. > Yes, but that adds even more complexity to something which is very easy to do in swing. Not to mention the fact you now need to keep track of the same information in two different places. And if you do enough callbacks it can start affecting performance. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================