Delegating controls to receive events

Discussion in 'Java' started by Timasmith, Nov 15, 2006.

  1. Timasmith

    Timasmith Guest

    I want to have a comboxbox and an elipsis ... button treated as a
    single control.

    If I use a JPanel + BorderLayout with a combobox using the 'Center' and
    the button the 'East'

    [________] [...]

    For most interactions I want the events to go to the combobox. Rather
    than overloading and redirecting each individual JPanel method, can I
    somehow delegate the combobox to receive everthing by default.

    Then I would code a few specific things for the elipsis button.
     
    Timasmith, Nov 15, 2006
    #1
    1. Advertising

  2. Timasmith schrieb:
    > I want to have a comboxbox and an elipsis ... button treated as a
    > single control.
    >
    > If I use a JPanel + BorderLayout with a combobox using the 'Center' and
    > the button the 'East'
    >
    > [________] [...]
    >
    > For most interactions I want the events to go to the combobox. Rather
    > than overloading and redirecting each individual JPanel method, can I
    > somehow delegate the combobox to receive everthing by default.


    Huh? Do you write a custom component?

    Bye
    Michael
     
    Michael Rauscher, Nov 15, 2006
    #2
    1. Advertising

  3. Timasmith

    Timasmith Guest

    Michael Rauscher wrote:
    > Timasmith schrieb:
    > > I want to have a comboxbox and an elipsis ... button treated as a
    > > single control.
    > >
    > > If I use a JPanel + BorderLayout with a combobox using the 'Center' and
    > > the button the 'East'
    > >
    > > [________] [...]
    > >
    > > For most interactions I want the events to go to the combobox. Rather
    > > than overloading and redirecting each individual JPanel method, can I
    > > somehow delegate the combobox to receive everthing by default.

    >
    > Huh? Do you write a custom component?
    >
    > Bye
    > Michael


    Sure, if you want to call treated panel+combo+button a 'custom
    component'.

    Putting them together simplifies the layout and interface code
    significantly.
     
    Timasmith, Nov 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johannes Eble

    Delegating Events between User Controls?

    Johannes Eble, May 25, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    678
    Johannes Eble
    May 27, 2004
  2. Brian J. Sayatovic

    Sorting a JTable with a delegating TableModel

    Brian J. Sayatovic, Jul 10, 2003, in forum: Java
    Replies:
    2
    Views:
    1,550
    Kleopatra
    Jul 15, 2003
  3. Randy Smith

    Re: delegating constructors

    Randy Smith, Sep 25, 2003, in forum: Java
    Replies:
    5
    Views:
    432
    Thomas G. Marshall
    Sep 29, 2003
  4. Roedy Green

    Delegating construction.

    Roedy Green, Jul 19, 2005, in forum: Java
    Replies:
    0
    Views:
    342
    Roedy Green
    Jul 19, 2005
  5. debartsa
    Replies:
    1
    Views:
    355
    John Saunders
    Apr 9, 2004
Loading...

Share This Page