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 2 of 2

Thread: HELP! Gui is running fine, don't know exactly how to code.

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation HELP! Gui is running fine, don't know exactly how to code.

    Figured it out thanks. Please delete.
    Last edited by cc11rocks; February 28th, 2011 at 10:06 PM.


  2. #2
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: HELP! Gui is running fine, don't know exactly how to code.

    I'm guessing you're losing a variable perhaps.

    I'm noticing when I try to get rid of the 0 in the first box it comes back and won't clear.

    You set it to default at 1 at think.

    Going to try tweaking certain things to see what happens.

    You could always keep setting the number to like

    Integer.parseInt(secondBox.getText());

    No idea why you're doing

    public final void actionEvent ....

    I don't understand the final part.

    Anyway, I'm not sure what this code is supposed to do.

    I've noticed that

    	if (e.getActionCommand().equals("subTract")) {
    	if (setgood == 1) {
    	String nos = stupid.getText();
    	String yos = yummy.getText();
    	int heck = Integer.parseInt(nos.trim());
    	int beck = Integer.parseInt(yos.trim());
    	 heck --;
    	beck --;
    	//heck to nos
    	//beck to yos
    	shook.setText("First Editable Number:" + heck);
    	nook.setText("Second Editable Number:" + beck);
    	setbad ++;
    	setgood++;
    	revalidate();
    	}
    else { 
    heck --;
    	beck --;
    	shook.setText("First Editable Number:" + heck);
    	nook.setText("Second Editable Number:" + beck);
    	revalidate();
    }
     
             }

    If setgood is 1, then it adds 1 to setgood.

    That means next time it won't be 1 next time.

    So it'll go to the else statement and set text text heck and stuff and continue decremnting heck and beck.



    I don't know what revalidate() does.
    Last edited by javapenguin; February 12th, 2011 at 02:38 PM.

Similar Threads

  1. 'Run' isn't 'Running'
    By leonsas in forum AWT / Java Swing
    Replies: 5
    Last Post: December 27th, 2010, 01:37 PM
  2. Running a external exe in Mac OS
    By supertreta in forum File I/O & Other I/O Streams
    Replies: 5
    Last Post: November 15th, 2010, 01:32 PM
  3. Compliing fine but wont run--please help!
    By Nova in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 12th, 2010, 08:51 PM
  4. Craps- GAME fine tunning.
    By Beaney in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 3rd, 2010, 08:32 PM
  5. Replies: 1
    Last Post: March 3rd, 2009, 08:04 AM