Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Implementing push button

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Implementing push button

    Hello, I'm IDK, and I'm new here.

    I'm learning to program java and I have a problem implementing a push button into the source code. Well, this is not my source code it came straight from the book.
    So basically it has two class. First one is the frame panel. The second class is the main components. This is a temperature conversion program. The second class use private jlabel inputlabel, outputlabel, etc. Also uses TempListener and implements actionlistener. Now, I am not typing the code here because it's not my. Sorry about that. I'll be happy typing the whole thing if it's okay. But for now, can someone help me implementing the push button to get the result. The book suggests that listener object can be used to listen to multiple components at eh same time. But i don't know how.
    Thanks


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Implementing push button

    Hello IDK12. Welcome to the Java Programming Forums

    Take a look at this example of an ActionListener on a JButton:

    http://www.javaprogrammingforums.com...ava-swing.html


    See if that helps you... If not, please post the code you have and we can take it from there.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Implementing push button

    I think i forgot to click the post button cause now that i checked my reply didn't go through. Anyway, thanks for the help. I decided to change another book cause this one is a little bit too advance for me, i think. I will post another question soon. thanks again

Similar Threads

  1. How to upload a file by clicking a link instead of button?
    By raghuprasad in forum Java Theory & Questions
    Replies: 2
    Last Post: May 3rd, 2009, 05:21 AM
  2. Problem while implementing a basic user interface menu
    By Rastabot in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: April 3rd, 2009, 04:38 PM