Search:

Type: Posts; User: Norm

Search: Search took 0.27 seconds.

  1. Replies
    18
    Views
    1,453

    Re: adding ActionListeners dynamically

    As internal classes.
    Why? Classes are cheap and easier.
  2. Replies
    18
    Views
    1,453

    Re: adding ActionListeners dynamically

    Not necessarily. You can use if statements to chose which action listener to add.
    if(cond1)
    add listener 1
    if(cond2)
    add listener 2

    etc

    I don't know how you can get the right listener code...
  3. Replies
    18
    Views
    1,453

    Re: adding ActionListeners dynamically

    call the item's addActionListener() method with a reference to an ActionListener object.

    Is the question: How to have useful code in the listener that is related to the menu items. How does the...
  4. Replies
    18
    Views
    1,453

    Re: adding ActionListeners dynamically

    Can you explain? What does "manage an ActionListener" mean?
    When a listener is added to a menu item, pass its constructor all the data it needs.
  5. Replies
    18
    Views
    1,453

    Re: adding ActionListeners dynamically

    Is this the approch that you are asking about:
    read the data
    use the data to control the building of the menu items.

    Instead of sequential statements, use if statements to control how the menu...
  6. Replies
    18
    Views
    1,453

    Re: adding ActionListeners dynamically

    Everything a program does is done at runtime.
    One question might be: what is the source of the Strings used in the menu items: literals coded in the program vs Strings read in from a file.
Results 1 to 6 of 6