Results 1 to 5 of 5
  1. #1
    Luft is offline Member
    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0

    Default AWT Action Listener in Swing GUI?

    First let me apologize if my questions are too basic. I have been trying to learn Java off and on for quite some time and find it somewhat challenging. I think I'm finally starting to catch on but have tons of questions.

    I'm using Eclipse with the Window Builder Pro plugin to create a Java program. I noticed that when I had Eclipse create an action listener for a combobox in a Swing GUI it created an AWT listener.

    Did I choose the wrong type of listener? I want my code to use the Swing components because I understand that they are more portable.

  2. #2
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: AWT Action Listener in Swing GUI?

    Since you're learning Java, I'd suggest you learn to hand-code it first. Check out Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials). For combo box in particular, see How to Use Combo Boxes (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components). Have fun!

  3. #3
    Luft is offline Member
    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0

    Default Re: AWT Action Listener in Swing GUI?

    Thanks, I'll do that. The Window Builder Pro plugin is doing a LOT of stuff for me that I don't understand and the references to AWT components may have been caused by an inadvertent mouse click on my part.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: AWT Action Listener in Swing GUI?

    Swing uses a lot of classes from the AWT framework; if classes are well written, why rewrite them?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    pj6444 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    165
    Rep Power
    2

    Default Re: AWT Action Listener in Swing GUI?

    If I were you I'd learn to use most of the Swing and AWT classes by hand before you start using the window builder. That way you can understand what you are doing. I highly recommend that you learn how to use all of the layout managers because they make life so much simpler.

Similar Threads

  1. Need more action listener help
    By ndsmith20 in forum New To Java
    Replies: 9
    Last Post: 01-19-2013, 02:12 AM
  2. Replies: 2
    Last Post: 12-11-2011, 11:44 PM
  3. Replies: 10
    Last Post: 04-03-2011, 12:06 AM
  4. Action Listener
    By greatmajestics in forum AWT / Swing
    Replies: 8
    Last Post: 03-25-2010, 06:39 PM
  5. Action Listener? how to use this?
    By jeffrey in forum New To Java
    Replies: 2
    Last Post: 10-12-2009, 09:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •