Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Needs help in logic Date: Sat, 09 Jul 2011 19:56:25 -0700 Organization: A noiseless patient Spider Lines: 35 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 10 Jul 2011 02:56:32 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="5HSAJfqnDjjLFxXZ6WBWEw"; logging-data="24872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fqrosC2+Rl0VDyV/xTo8hqno5XasZBJ0=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:poDsvUJL2FdJVAX/L6PPwIYcK1g= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6026 Well, I don't do homework for people, but I'll give you some hints. 1. Don't use BorderLayout, it kinda sucks for what you're trying to do. The default FlowLayout of a JPanel is proabably better. Put all the components in the JPanel and add that to the main content pane of the JFrame. Then pack() the frame (frame.pack()) instead of setting its size. 2. This is the next bit to add to your program: > event- > handler method or the actionPerformed method of class based on the > ActionListener Read this: Then add a method to your main class like this: public class guessprogram implements .... name here... { public static void main(String args[]) { // this is what you have already... } public void actionPerformed(ActionEvent e) { // logic to test input here } } And add the ActionListener as that link shows you. That should get you started. Your program has threading problems, but we'll leave that alone for a beginner problem.