Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30780 > unrolled thread
| Started by | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| First post | 2015-01-21 23:06 -0500 |
| Last post | 2015-01-25 15:33 -0500 |
| Articles | 20 on this page of 78 — 6 participants |
Back to article view | Back to comp.lang.java.programmer
Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-21 23:06 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 06:48 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 09:07 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 09:41 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 11:11 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 20:06 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 20:59 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 21:18 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 21:47 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-23 08:08 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-23 08:27 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-23 09:41 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-23 09:59 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-23 10:52 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-23 11:49 -0500
Re: Returning to Java - have questions FredK <fred.l.kleinschmidt@gmail.com> - 2015-01-23 14:26 -0800
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-23 19:27 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-23 19:52 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-23 20:12 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-23 20:47 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 07:28 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 07:40 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 08:04 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 09:05 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 09:10 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 10:34 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:34 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:11 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 10:35 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:56 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 11:47 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 11:51 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 11:57 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 12:00 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 15:29 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 10:32 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:57 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 10:31 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:58 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 10:31 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:59 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 09:36 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 10:38 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:36 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 10:46 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 11:49 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 11:52 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 11:58 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 11:58 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 15:30 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 11:49 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 11:49 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 11:58 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 12:01 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 15:30 -0500
Re: Returning to Java - have questions Gene Wirchenko <genew@telus.net> - 2015-01-26 09:18 -0800
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-26 13:09 -0500
Re: Returning to Java - have questions Gene Wirchenko <genew@telus.net> - 2015-01-26 11:22 -0800
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-26 14:44 -0500
Re: Returning to Java - have questions FredK <fred.l.kleinschmidt@gmail.com> - 2015-01-26 12:00 -0800
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-26 15:18 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 21:26 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 21:48 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 11:00 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 09:49 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-22 10:11 -0500
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 11:12 -0500
Re: Returning to Java - have questions Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 11:01 -0500
Re: Returning to Java - have questions Brixomatic <brixomatic@yahoo.com> - 2015-01-25 22:49 +0100
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 16:58 -0500
Re: Returning to Java - have questions Gene Wirchenko <genew@telus.net> - 2015-01-26 09:19 -0800
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-26 13:10 -0500
Re: Returning to Java - have questions Gene Wirchenko <genew@telus.net> - 2015-01-26 11:23 -0800
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-26 14:45 -0500
Re: Returning to Java - have questions Silvio <silvio@internet.com> - 2015-01-22 13:25 +0100
Re: Returning to Java - have questions Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-22 09:09 -0500
WORKALIKES (was: Returning to Java - have questions) Jeff Higgins <jeff@invalid.invalid> - 2015-01-25 13:03 -0500
Re: WORKALIKES Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-25 15:33 -0500
Page 1 of 4 [1] 2 3 4 Next page →
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-21 23:06 -0500 |
| Subject | Returning to Java - have questions |
| Message-ID | <m9psv9$gvd$1@dont-email.me> |
Hi, all Well, I'm just getting back into java after about a 15 year hiatus. I did a bunch of it back then, both SE and EE, but then got off on other projects. Now I want to get my fingers back into it and see massive changes. It's going to take a log of getting used to. For instance, I was looking at a game I wrote back then (nothing fancy - just something to play with). With Swing it's very easy to change the look of buttons by loading a new image, i.d. when the player presses the button. It seems with fx the only way you can change the button when it's pressed/not pressed is via css. While I guess there are advantages to doing it this way, I haven't seen them yet. And I'd rather be able to control the button looks myself. So my first question is - are there events I can intercept to tell when the button is pressed and when it is released? All I see so far is the ACTION event. And I'll also ask a short question with I suspect long (and very subjective) answers. Which IDE do you like for developing Java apps, and why? Most will be standalone gui apps for now. And please - I know which IDE can be almost a religious discussion - let's not commit any sins against other IDE's :) TIA, Jerry -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-22 06:48 -0500 |
| Message-ID | <m9qo7a$4dg$1@dont-email.me> |
| In reply to | #30780 |
On 01/21/2015 11:06 PM, Jerry Stuckle wrote: > Hi, all > > Well, I'm just getting back into java after about a 15 year hiatus. I > did a bunch of it back then, both SE and EE, but then got off on other > projects. > > Now I want to get my fingers back into it and see massive changes. It's > going to take a log of getting used to. > > For instance, I was looking at a game I wrote back then (nothing fancy - > just something to play with). With Swing it's very easy to change the > look of buttons by loading a new image, i.d. when the player presses the > button. It seems with fx the only way you can change the button when > it's pressed/not pressed is via css. While I guess there are advantages > to doing it this way, I haven't seen them yet. And I'd rather be able > to control the button looks myself. extend SkinBase<C extends Control> and use Control.setSkin(Skin<?> value) > > So my first question is - are there events I can intercept to tell when > the button is pressed and when it is released? All I see so far is the > ACTION event. > > And I'll also ask a short question with I suspect long (and very > subjective) answers. Which IDE do you like for developing Java apps, > and why? Most will be standalone gui apps for now. And please - I know > which IDE can be almost a religious discussion - let's not commit any > sins against other IDE's :) > > TIA, > Jerry >
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-22 09:07 -0500 |
| Message-ID | <m9r06q$3pv$1@dont-email.me> |
| In reply to | #30786 |
On 1/22/2015 6:48 AM, Jeff Higgins wrote: > On 01/21/2015 11:06 PM, Jerry Stuckle wrote: >> Hi, all >> >> Well, I'm just getting back into java after about a 15 year hiatus. I >> did a bunch of it back then, both SE and EE, but then got off on other >> projects. >> >> Now I want to get my fingers back into it and see massive changes. It's >> going to take a log of getting used to. >> >> For instance, I was looking at a game I wrote back then (nothing fancy - >> just something to play with). With Swing it's very easy to change the >> look of buttons by loading a new image, i.d. when the player presses the >> button. It seems with fx the only way you can change the button when >> it's pressed/not pressed is via css. While I guess there are advantages >> to doing it this way, I haven't seen them yet. And I'd rather be able >> to control the button looks myself. > > extend SkinBase<C extends Control> > and use Control.setSkin(Skin<?> value) > Actually, I don't need to extend anything to set a static image - I can just use setImage() and not have any text. But that doesn't tell me if the button is pressed or not, so I don't know when to change the image to the pressed one. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-22 09:41 -0500 |
| Message-ID | <m9r2bi$bv1$1@dont-email.me> |
| In reply to | #30791 |
On 01/22/2015 09:07 AM, Jerry Stuckle wrote: > On 1/22/2015 6:48 AM, Jeff Higgins wrote: >> On 01/21/2015 11:06 PM, Jerry Stuckle wrote: >>> Hi, all >>> >>> Well, I'm just getting back into java after about a 15 year hiatus. I >>> did a bunch of it back then, both SE and EE, but then got off on other >>> projects. >>> >>> Now I want to get my fingers back into it and see massive changes. It's >>> going to take a log of getting used to. >>> >>> For instance, I was looking at a game I wrote back then (nothing fancy - >>> just something to play with). With Swing it's very easy to change the >>> look of buttons by loading a new image, i.d. when the player presses the >>> button. It seems with fx the only way you can change the button when >>> it's pressed/not pressed is via css. While I guess there are advantages >>> to doing it this way, I haven't seen them yet. And I'd rather be able >>> to control the button looks myself. >> >> extend SkinBase<C extends Control> >> and use Control.setSkin(Skin<?> value) >> > > Actually, I don't need to extend anything to set a static image - I can > just use setImage() and not have any text. > > But that doesn't tell me if the button is pressed or not, so I don't > know when to change the image to the pressed one. > I'm afraid your question is not clear to me. Are BaseButtons's armedProperty, and onActionProperty, somehow insufficient? Maybe one of Node's many properties. onKey..., onMouse..., onSwipe..., onTouch..., etc.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-22 11:11 -0500 |
| Message-ID | <m9r7dt$10b$1@dont-email.me> |
| In reply to | #30795 |
On 1/22/2015 9:41 AM, Jeff Higgins wrote: > On 01/22/2015 09:07 AM, Jerry Stuckle wrote: >> On 1/22/2015 6:48 AM, Jeff Higgins wrote: >>> On 01/21/2015 11:06 PM, Jerry Stuckle wrote: >>>> Hi, all >>>> >>>> Well, I'm just getting back into java after about a 15 year hiatus. I >>>> did a bunch of it back then, both SE and EE, but then got off on other >>>> projects. >>>> >>>> Now I want to get my fingers back into it and see massive changes. >>>> It's >>>> going to take a log of getting used to. >>>> >>>> For instance, I was looking at a game I wrote back then (nothing >>>> fancy - >>>> just something to play with). With Swing it's very easy to change the >>>> look of buttons by loading a new image, i.d. when the player presses >>>> the >>>> button. It seems with fx the only way you can change the button when >>>> it's pressed/not pressed is via css. While I guess there are >>>> advantages >>>> to doing it this way, I haven't seen them yet. And I'd rather be able >>>> to control the button looks myself. >>> >>> extend SkinBase<C extends Control> >>> and use Control.setSkin(Skin<?> value) >>> >> >> Actually, I don't need to extend anything to set a static image - I can >> just use setImage() and not have any text. >> >> But that doesn't tell me if the button is pressed or not, so I don't >> know when to change the image to the pressed one. >> > I'm afraid your question is not clear to me. > Are BaseButtons's armedProperty, and onActionProperty, somehow > insufficient? > Maybe one of Node's many properties. > onKey..., onMouse..., onSwipe..., onTouch..., etc. > Armed is not the same as pressed. And the button being pressed does not necessarily indicate an action. As for the properties - that would require polling all of the buttons in a loop to constantly follow their statuses. Not good. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-22 20:06 -0500 |
| Message-ID | <m9s6vk$uvf$1@dont-email.me> |
| In reply to | #30801 |
On 01/22/2015 11:11 AM, Jerry Stuckle wrote:
> On 1/22/2015 9:41 AM, Jeff Higgins wrote:
>> On 01/22/2015 09:07 AM, Jerry Stuckle wrote:
>>> On 1/22/2015 6:48 AM, Jeff Higgins wrote:
>>>> On 01/21/2015 11:06 PM, Jerry Stuckle wrote:
>>>>> Hi, all
>>>>>
>>>>> Well, I'm just getting back into java after about a 15 year hiatus. I
>>>>> did a bunch of it back then, both SE and EE, but then got off on other
>>>>> projects.
>>>>>
>>>>> Now I want to get my fingers back into it and see massive changes.
>>>>> It's
>>>>> going to take a log of getting used to.
>>>>>
>>>>> For instance, I was looking at a game I wrote back then (nothing
>>>>> fancy -
>>>>> just something to play with). With Swing it's very easy to change the
>>>>> look of buttons by loading a new image, i.d. when the player presses
>>>>> the
>>>>> button. It seems with fx the only way you can change the button when
>>>>> it's pressed/not pressed is via css. While I guess there are
>>>>> advantages
>>>>> to doing it this way, I haven't seen them yet. And I'd rather be able
>>>>> to control the button looks myself.
>>>>
>>>> extend SkinBase<C extends Control>
>>>> and use Control.setSkin(Skin<?> value)
>>>>
>>>
>>> Actually, I don't need to extend anything to set a static image - I can
>>> just use setImage() and not have any text.
>>>
>>> But that doesn't tell me if the button is pressed or not, so I don't
>>> know when to change the image to the pressed one.
>>>
>> I'm afraid your question is not clear to me.
>> Are BaseButtons's armedProperty, and onActionProperty, somehow
>> insufficient?
>> Maybe one of Node's many properties.
>> onKey..., onMouse..., onSwipe..., onTouch..., etc.
>>
>
> Armed is not the same as pressed.
That's right.
And the button being pressed does not
> necessarily indicate an action.
??
Do you want a ToggleButton?
>
> As for the properties - that would require polling all of the buttons in
> a loop to constantly follow their statuses. Not good.
??
Is the standard event handling mechanism somehow insufficient?
myBeautyousBtn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
controlTheButtonLooksMyself();
}
});
or
myBeautyousBtn.addEventHandler(MouseEvent.MOUSE_PRESSED,
new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
controlTheButtonLooksMyself();
}
});
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-22 20:59 -0500 |
| Message-ID | <m9s9u2$6tv$1@dont-email.me> |
| In reply to | #30806 |
On 1/22/2015 8:06 PM, Jeff Higgins wrote:
> On 01/22/2015 11:11 AM, Jerry Stuckle wrote:
>> On 1/22/2015 9:41 AM, Jeff Higgins wrote:
>>> On 01/22/2015 09:07 AM, Jerry Stuckle wrote:
>>>> On 1/22/2015 6:48 AM, Jeff Higgins wrote:
>>>>> On 01/21/2015 11:06 PM, Jerry Stuckle wrote:
>>>>>> Hi, all
>>>>>>
>>>>>> Well, I'm just getting back into java after about a 15 year
>>>>>> hiatus. I
>>>>>> did a bunch of it back then, both SE and EE, but then got off on
>>>>>> other
>>>>>> projects.
>>>>>>
>>>>>> Now I want to get my fingers back into it and see massive changes.
>>>>>> It's
>>>>>> going to take a log of getting used to.
>>>>>>
>>>>>> For instance, I was looking at a game I wrote back then (nothing
>>>>>> fancy -
>>>>>> just something to play with). With Swing it's very easy to change
>>>>>> the
>>>>>> look of buttons by loading a new image, i.d. when the player presses
>>>>>> the
>>>>>> button. It seems with fx the only way you can change the button when
>>>>>> it's pressed/not pressed is via css. While I guess there are
>>>>>> advantages
>>>>>> to doing it this way, I haven't seen them yet. And I'd rather be
>>>>>> able
>>>>>> to control the button looks myself.
>>>>>
>>>>> extend SkinBase<C extends Control>
>>>>> and use Control.setSkin(Skin<?> value)
>>>>>
>>>>
>>>> Actually, I don't need to extend anything to set a static image - I can
>>>> just use setImage() and not have any text.
>>>>
>>>> But that doesn't tell me if the button is pressed or not, so I don't
>>>> know when to change the image to the pressed one.
>>>>
>>> I'm afraid your question is not clear to me.
>>> Are BaseButtons's armedProperty, and onActionProperty, somehow
>>> insufficient?
>>> Maybe one of Node's many properties.
>>> onKey..., onMouse..., onSwipe..., onTouch..., etc.
>>>
>>
>> Armed is not the same as pressed.
> That's right.
> And the button being pressed does not
>> necessarily indicate an action.
> ??
> Do you want a ToggleButton?
No, I want a button.
For a button, the action occurs on the RELEASE of the button, not the
push. For instance, if you place the mouse pointer over a button and
hold down the LMB, the button will look pushed. If you then move the
mouse pointer off the button before releasing the LMB, the button will
return to normal state but an action will not occur.
This action has been consistent since the first versions of Java (it is
also consistent with every GUI I know of for at least 25 years).
>>
>> As for the properties - that would require polling all of the buttons in
>> a loop to constantly follow their statuses. Not good.
> ??
>
> Is the standard event handling mechanism somehow insufficient?
>
> myBeautyousBtn.setOnAction(new EventHandler<ActionEvent>() {
> @Override
> public void handle(ActionEvent event) {
> controlTheButtonLooksMyself();
> }
> });
>
That only gets triggered when an action occurs - which, as indicated
above, is way too late.
> or
>
> myBeautyousBtn.addEventHandler(MouseEvent.MOUSE_PRESSED,
> new EventHandler<MouseEvent>() {
> @Override
> public void handle(MouseEvent e) {
> controlTheButtonLooksMyself();
> }
> });
>
And a mouse is not the only way the button can be pressed. It can be
via the space bar on the keyboard if the button has the focus, for instance.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-22 21:18 -0500 |
| Message-ID | <m9sb6k$d8$1@dont-email.me> |
| In reply to | #30807 |
On 01/22/2015 08:59 PM, Jerry Stuckle wrote:
> On 1/22/2015 8:06 PM, Jeff Higgins wrote:
>> On 01/22/2015 11:11 AM, Jerry Stuckle wrote:
>>> On 1/22/2015 9:41 AM, Jeff Higgins wrote:
>>>> On 01/22/2015 09:07 AM, Jerry Stuckle wrote:
>>>>> On 1/22/2015 6:48 AM, Jeff Higgins wrote:
>>>>>> On 01/21/2015 11:06 PM, Jerry Stuckle wrote:
>>>>>>> Hi, all
>>>>>>>
>>>>>>> Well, I'm just getting back into java after about a 15 year
>>>>>>> hiatus. I
>>>>>>> did a bunch of it back then, both SE and EE, but then got off on
>>>>>>> other
>>>>>>> projects.
>>>>>>>
>>>>>>> Now I want to get my fingers back into it and see massive changes.
>>>>>>> It's
>>>>>>> going to take a log of getting used to.
>>>>>>>
>>>>>>> For instance, I was looking at a game I wrote back then (nothing
>>>>>>> fancy -
>>>>>>> just something to play with). With Swing it's very easy to change
>>>>>>> the
>>>>>>> look of buttons by loading a new image, i.d. when the player presses
>>>>>>> the
>>>>>>> button. It seems with fx the only way you can change the button when
>>>>>>> it's pressed/not pressed is via css. While I guess there are
>>>>>>> advantages
>>>>>>> to doing it this way, I haven't seen them yet. And I'd rather be
>>>>>>> able
>>>>>>> to control the button looks myself.
>>>>>>
>>>>>> extend SkinBase<C extends Control>
>>>>>> and use Control.setSkin(Skin<?> value)
>>>>>>
>>>>>
>>>>> Actually, I don't need to extend anything to set a static image - I can
>>>>> just use setImage() and not have any text.
>>>>>
>>>>> But that doesn't tell me if the button is pressed or not, so I don't
>>>>> know when to change the image to the pressed one.
>>>>>
>>>> I'm afraid your question is not clear to me.
>>>> Are BaseButtons's armedProperty, and onActionProperty, somehow
>>>> insufficient?
>>>> Maybe one of Node's many properties.
>>>> onKey..., onMouse..., onSwipe..., onTouch..., etc.
>>>>
>>>
>>> Armed is not the same as pressed.
>> That's right.
>> And the button being pressed does not
>>> necessarily indicate an action.
>> ??
>> Do you want a ToggleButton?
>
> No, I want a button.
>
> For a button, the action occurs on the RELEASE of the button, not the
> push. For instance, if you place the mouse pointer over a button and
> hold down the LMB, the button will look pushed. If you then move the
> mouse pointer off the button before releasing the LMB, the button will
> return to normal state but an action will not occur.
>
> This action has been consistent since the first versions of Java (it is
> also consistent with every GUI I know of for at least 25 years).
>
>>>
>>> As for the properties - that would require polling all of the buttons in
>>> a loop to constantly follow their statuses. Not good.
>> ??
>>
>> Is the standard event handling mechanism somehow insufficient?
>>
>> myBeautyousBtn.setOnAction(new EventHandler<ActionEvent>() {
>> @Override
>> public void handle(ActionEvent event) {
>> controlTheButtonLooksMyself();
>> }
>> });
>>
>
> That only gets triggered when an action occurs - which, as indicated
> above, is way too late.
>
>> or
>>
>> myBeautyousBtn.addEventHandler(MouseEvent.MOUSE_PRESSED,
>> new EventHandler<MouseEvent>() {
>> @Override
>> public void handle(MouseEvent e) {
>> controlTheButtonLooksMyself();
>> }
>> });
>>
>
> And a mouse is not the only way the button can be pressed. It can be
> via the space bar on the keyboard if the button has the focus, for instance.
>
public class Button
extends ButtonBase
A simple button control. The button control can contain text and/or a
graphic. A button control has three different modes
Normal: A normal push button.
Default: A default Button is the button that receives a keyboard
VK_ENTER press, if no other node in the scene consumes it.
Cancel: A Cancel Button is the button that receives a keyboard
VK_ESC press, if no other node in the scene consumes it.
When a button is pressed and released a ActionEvent is sent. Your
application can perform some action based on this event by implementing
an EventHandler to process the ActionEvent. Buttons can also respond to
mouse events by implementing an EventHandler to process the MouseEvent
MnemonicParsing is enabled by default for Button.
Either I'm missing something or you are.
Good luck.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-22 21:47 -0500 |
| Message-ID | <m9scn3$4b2$1@dont-email.me> |
| In reply to | #30808 |
On 1/22/2015 9:18 PM, Jeff Higgins wrote:
> On 01/22/2015 08:59 PM, Jerry Stuckle wrote:
>> On 1/22/2015 8:06 PM, Jeff Higgins wrote:
>>> On 01/22/2015 11:11 AM, Jerry Stuckle wrote:
>>>> On 1/22/2015 9:41 AM, Jeff Higgins wrote:
>>>>> On 01/22/2015 09:07 AM, Jerry Stuckle wrote:
>>>>>> On 1/22/2015 6:48 AM, Jeff Higgins wrote:
>>>>>>> On 01/21/2015 11:06 PM, Jerry Stuckle wrote:
>>>>>>>> Hi, all
>>>>>>>>
>>>>>>>> Well, I'm just getting back into java after about a 15 year
>>>>>>>> hiatus. I
>>>>>>>> did a bunch of it back then, both SE and EE, but then got off on
>>>>>>>> other
>>>>>>>> projects.
>>>>>>>>
>>>>>>>> Now I want to get my fingers back into it and see massive changes.
>>>>>>>> It's
>>>>>>>> going to take a log of getting used to.
>>>>>>>>
>>>>>>>> For instance, I was looking at a game I wrote back then (nothing
>>>>>>>> fancy -
>>>>>>>> just something to play with). With Swing it's very easy to change
>>>>>>>> the
>>>>>>>> look of buttons by loading a new image, i.d. when the player
>>>>>>>> presses
>>>>>>>> the
>>>>>>>> button. It seems with fx the only way you can change the button
>>>>>>>> when
>>>>>>>> it's pressed/not pressed is via css. While I guess there are
>>>>>>>> advantages
>>>>>>>> to doing it this way, I haven't seen them yet. And I'd rather be
>>>>>>>> able
>>>>>>>> to control the button looks myself.
>>>>>>>
>>>>>>> extend SkinBase<C extends Control>
>>>>>>> and use Control.setSkin(Skin<?> value)
>>>>>>>
>>>>>>
>>>>>> Actually, I don't need to extend anything to set a static image -
>>>>>> I can
>>>>>> just use setImage() and not have any text.
>>>>>>
>>>>>> But that doesn't tell me if the button is pressed or not, so I don't
>>>>>> know when to change the image to the pressed one.
>>>>>>
>>>>> I'm afraid your question is not clear to me.
>>>>> Are BaseButtons's armedProperty, and onActionProperty, somehow
>>>>> insufficient?
>>>>> Maybe one of Node's many properties.
>>>>> onKey..., onMouse..., onSwipe..., onTouch..., etc.
>>>>>
>>>>
>>>> Armed is not the same as pressed.
>>> That's right.
>>> And the button being pressed does not
>>>> necessarily indicate an action.
>>> ??
>>> Do you want a ToggleButton?
>>
>> No, I want a button.
>>
>> For a button, the action occurs on the RELEASE of the button, not the
>> push. For instance, if you place the mouse pointer over a button and
>> hold down the LMB, the button will look pushed. If you then move the
>> mouse pointer off the button before releasing the LMB, the button will
>> return to normal state but an action will not occur.
>>
>> This action has been consistent since the first versions of Java (it is
>> also consistent with every GUI I know of for at least 25 years).
>>
>>>>
>>>> As for the properties - that would require polling all of the
>>>> buttons in
>>>> a loop to constantly follow their statuses. Not good.
>>> ??
>>>
>>> Is the standard event handling mechanism somehow insufficient?
>>>
>>> myBeautyousBtn.setOnAction(new EventHandler<ActionEvent>() {
>>> @Override
>>> public void handle(ActionEvent event) {
>>> controlTheButtonLooksMyself();
>>> }
>>> });
>>>
>>
>> That only gets triggered when an action occurs - which, as indicated
>> above, is way too late.
>>
>>> or
>>>
>>> myBeautyousBtn.addEventHandler(MouseEvent.MOUSE_PRESSED,
>>> new EventHandler<MouseEvent>() {
>>> @Override
>>> public void handle(MouseEvent e) {
>>> controlTheButtonLooksMyself();
>>> }
>>> });
>>>
>>
>> And a mouse is not the only way the button can be pressed. It can be
>> via the space bar on the keyboard if the button has the focus, for
>> instance.
>>
> public class Button
> extends ButtonBase
>
> A simple button control. The button control can contain text and/or a
> graphic. A button control has three different modes
>
> Normal: A normal push button.
> Default: A default Button is the button that receives a keyboard
> VK_ENTER press, if no other node in the scene consumes it.
> Cancel: A Cancel Button is the button that receives a keyboard
> VK_ESC press, if no other node in the scene consumes it.
>
> When a button is pressed and released a ActionEvent is sent. Your
> application can perform some action based on this event by implementing
> an EventHandler to process the ActionEvent. Buttons can also respond to
> mouse events by implementing an EventHandler to process the MouseEvent
>
> MnemonicParsing is enabled by default for Button.
>
> Either I'm missing something or you are.
> Good luck.
>
>
>
>
Which has nothing to do with the look of a button when it is pushed.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-23 08:08 -0500 |
| Message-ID | <m9th9h$oah$1@dont-email.me> |
| In reply to | #30810 |
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. > <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> Maybe future iterations will give you public behaviors?
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-23 08:27 -0500 |
| Message-ID | <m9ticq$si4$1@dont-email.me> |
| In reply to | #30816 |
On 01/23/2015 08: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. >> > <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> In particular: "In other words, your code will need to manually handle keyboard and mouse interactions." > > Maybe future iterations will give you public behaviors? >
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-23 09:41 -0500 |
| Message-ID | <m9tmn4$etb$1@dont-email.me> |
| In reply to | #30816 |
On 01/23/2015 08: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. >> > <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> > > Maybe future iterations will give you public behaviors? > A more recent discussion begins here: <http://mail.openjdk.java.net/pipermail/openjfx-dev/2014-September/015754.html>
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-23 09:59 -0500 |
| Message-ID | <m9tnjc$jgg$1@dont-email.me> |
| In reply to | #30816 |
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. >> > <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> > > 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. I see this as a step backwards. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-23 10:52 -0500 |
| Message-ID | <m9tqrn$3g5$1@dont-email.me> |
| In reply to | #30820 |
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. >>> >> <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> >> >> 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. > > I see this as a step backwards. > Sorry about that.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-23 11:49 -0500 |
| Message-ID | <m9tu1k$hho$1@dont-email.me> |
| In reply to | #30822 |
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. >>>> >>> <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> >>> >>> >>> 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. >> > Sorry about that. > -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | FredK <fred.l.kleinschmidt@gmail.com> |
|---|---|
| Date | 2015-01-23 14:26 -0800 |
| Message-ID | <3d67c01a-1dfe-463b-91fe-fa8f2c2c34c4@googlegroups.com> |
| In reply to | #30824 |
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. > >>>> > >>> <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> > >>> > >>> > >>> 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 K
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-23 19:27 -0500 |
| Message-ID | <m9uosu$ssa$1@dont-email.me> |
| In reply to | #30828 |
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. >>>>>> >>>>> <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> >>>>> >>>>> >>>>> 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). -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-23 19:52 -0500 |
| Message-ID | <m9uqi1$2ru$1@dont-email.me> |
| In reply to | #30829 |
On 01/23/2015 07:27 PM, 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. >>>>>>> >>>>>> <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> >>>>>> >>>>>> >>>>>> 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). > InputEvent.ANY
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2015-01-23 20:12 -0500 |
| Message-ID | <m9urn8$6dr$1@dont-email.me> |
| In reply to | #30830 |
On 01/23/2015 07:52 PM, Jeff Higgins wrote: > InputEvent.ANY Just a memento for me. <https://github.com/TomasMikula/ReactFX>
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2015-01-23 20:47 -0500 |
| Message-ID | <m9utij$bhj$1@dont-email.me> |
| In reply to | #30830 |
On 1/23/2015 7:52 PM, Jeff Higgins wrote: > On 01/23/2015 07:27 PM, 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. >>>>>>>> >>>>>>> <http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-February/005874.html> >>>>>>> >>>>>>> >>>>>>> >>>>>>> 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). >> > InputEvent.ANY And how does that help? How does it indicate whether the input event causes the button to be pressed or not, for instance? How about some code which shows what you're claiming will work? And then let's see you make it as easy as calling JButton.setPressedIcon(). -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
Page 1 of 4 [1] 2 3 4 Next page →
Back to top | Article view | comp.lang.java.programmer
csiph-web