• actionListener vs. action

    From phpete48@gmail.com@21:1/5 to All on Thu Feb 25 10:59:31 2016
    Hello all,

    I'm trying to clearly delineate actionListener and action. Could someone please concisely compare the two. Also, under which conditions should you use one over the other.

    I have looked this up on internet but none of the answers provided enough detail.

    Thank you,
    Pete.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to phpete48@gmail.com on Fri Feb 26 02:23:28 2016
    phpete48@gmail.com writes:
    I'm trying to clearly delineate actionListener and action.
    Could someone please concisely compare the two.

    These are two identifiers. Both Camel Case. »actionListener«
    has 14 characters and consists of two English words. »action«
    has 6 characters and consists of one English word.

    The following program shows how they can be used in a program:

    public class Main
    { public static void main(String args[]) throws Exception
    { final int actionListener = 8;
    final int action = 4;
    System.out.println( actionListener + action ); }}

    12

    Also, under which conditions should you use one over the other.

    Use the identifier »actionListener« to name something that
    is listening to/for an action. (Usually this is not an »int«
    as in the above program. This program was just an example.)

    Use the identifier »action« to name something that is an
    action itself. Something that does not just /listen/ to an
    action, but /is/ an action!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to Stefan Ram on Thu Feb 25 21:15:03 2016
    On 2/25/2016 18:23, Stefan Ram wrote:
    phpete48@gmail.com writes:
    I'm trying to clearly delineate actionListener and action.
    Could someone please concisely compare the two.

    These are two identifiers. Both Camel Case. »actionListener«
    has 14 characters and consists of two English words. »action«
    has 6 characters and consists of one English word.

    The following program shows how they can be used in a program:

    public class Main
    { public static void main(String args[]) throws Exception
    { final int actionListener = 8;
    final int action = 4;
    System.out.println( actionListener + action ); }}

    12

    Also, under which conditions should you use one over the other.

    Use the identifier »actionListener« to name something that
    is listening to/for an action. (Usually this is not an »int«
    as in the above program. This program was just an example.)

    Use the identifier »action« to name something that is an
    action itself. Something that does not just /listen/ to an
    action, but /is/ an action!


    Bored tonight are we Stefan?


    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Higgins@21:1/5 to Knute Johnson on Sat Feb 27 05:08:12 2016
    On Thu, 25 Feb 2016 21:15:03 -0800, Knute Johnson wrote:

    On 2/25/2016 18:23, Stefan Ram wrote:
    phpete48@gmail.com writes:
    I'm trying to clearly delineate actionListener and action. Could
    someone please concisely compare the two.

    These are two identifiers. Both Camel Case. »actionListener« has 14
    characters and consists of two English words. »action«
    has 6 characters and consists of one English word.

    The following program shows how they can be used in a program:

    public class Main { public static void main(String args[]) throws
    Exception
    { final int actionListener = 8;
    final int action = 4; System.out.println( actionListener +
    action ); }}

    12

    Also, under which conditions should you use one over the other.

    Use the identifier »actionListener« to name something that is
    listening to/for an action. (Usually this is not an »int« as in the
    above program. This program was just an example.)

    Use the identifier »action« to name something that is an action
    itself. Something that does not just /listen/ to an action, but /is/
    an action!


    Bored tonight are we Stefan?

    A year ago in January I posted a question to c.l.j.p about a large image crashing javafx.scene.image.ImageView. Yesterday I happened to revisit
    the issue and discovered that between then and now something has changed
    and I am now able to display a large image (5100 x 6600 2bpp) in an
    ImageView.

    Since this discovery I have been hard at work seeing what needs to be
    done to port an existing Swing application that uses and displays large
    images to JavaFX. I needed a break and came here to c.l.j.g and saw your
    post.

    How To Ask Questions The Smart Way <http://catb.org/~esr/faqs/smart-questions.html>

    Thank you for the opportunity to stretch my legs.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Knute Johnson@21:1/5 to phpete48@gmail.com on Thu Feb 25 13:16:27 2016
    On 2/25/2016 10:59, phpete48@gmail.com wrote:
    Hello all,

    I'm trying to clearly delineate actionListener and action. Could
    someone please concisely compare the two. Also, under which
    conditions should you use one over the other.

    I have looked this up on internet but none of the answers provided
    enough detail.

    Thank you, Pete.


    I would look at the docs for Action, it describes the difference and capabilities of Action pretty well.

    I use an Action when I've got to do the same thing with many components.
    I use ActionListener when I want to keep all the code for a specific
    component in one place.


    --

    Knute Johnson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)