Search:

Type: Posts; User: JavaN00b

Search: Search took 0.39 seconds.

  1. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    Nevermind, I showed the code to a friend who told me where I went wrong in 3 mins by saying:

    Your String text1 and text2 should be moved out of the internal class and put at the top of the...
  2. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    Well actually I don't think I need to reset tex1 and tex2 or for that matter any of these:

    //butt.selectedFile1 = null;
    //butt.selectedFile2 = null;
    //butt.test1 = null;
    //butt.test2 = null;...
  3. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    I refer to the first post in this Thread for detailed code.

    field1.setText("");
    field2.setText("");
    similarity1.setText("0");
    time1.setText("0");

    Works fine.

    //butt.selectedFile1...
  4. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    The same as before. Except the nullpointerexception.

    The function initialize() doesn't reset everything so I still have the old data saved.

    So when I upload something in "Text 1:" field and...
  5. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    I see, thank you for commenting on that. I shall take notion of that and fix it in my original code. I think the topic pops up in the Java book, I'm going through (still on chapter 6), in the later...
  6. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    but that's the name of the JButton


    JButton text1Button = new JButton("Text 1: ");

    and not the String called text1. The String text1 will together with String text2 be used to find out how...
  7. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    I tried running it on text1 and made lots of println as you told me to.
    It seems that text1 only gets a value in the ButtonListener class and keeps its value only there while the text1 in the...
  8. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    So I assigned a value to the butt variable as told

    private ButtonListener butt = new ButtonListener(null);

    That took care of the nullpointerexception, YaY.

    The problem with resetting is...
  9. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    ? o.O


    private ButtonListener butt;

    Why should butt be given a value when it's another class (the buttonListener) and how come it became a variable? O.o

    The ButtonListener is another class...
  10. Re: When I press on "new" in the menu in my GUI the program doesn't initialize (reset

    The line at 130 is

    butt.text1 = " ";
    A string and set as " " which should be allowed since I do set it under the ButtonListener Class. That's why I don't understand why it won't accept it to set...
  11. [SOLVED] When I press on "new" in the menu in my GUI the program doesn't initialize

    Hi everyone this time it's not an exercise from the Java book I'm using to practicing but from my school project which I have to turn in soon. After many failure tries, I hope someone in here can...
  12. Re: Can't get lines to cut at 60 characters and continue on next line right

    THANKS A LOT!

    Since this chapter was about Scanner class which you so nicely reminded me (the renaming deal from before). Yes, quite embarassing that I didn't get that since it's mainly Scanner...
  13. Re: Can't get lines to cut at 60 characters and continue on next line right

    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.PrintStream;
    import java.util.Scanner;

    public class Wrap2 {

    public static final int CUT = 60;

    public static...
  14. Re: Can't get lines to cut at 60 characters and continue on next line right

    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.PrintStream;
    import java.util.Scanner;

    public class Wrap2 {

    public static final int CUT = 60;

    public static...
  15. Re: Can't get lines to cut at 60 characters and continue on next line right

    Thanks Norm and JJeng, I looked at substring as bot of you told me to look into. I seem to have forgotten that it existed :rolleyes: but after getting so time to program I finally tried it out and...
  16. Can't get lines to cut at 60 characters and continue on next line right

    Hello everyone,

    it seem like I'm now stuck at the second exercise in the next chapter of my java book which is about file processing(The Scanner/PrintStream classes mainly). After trying to find a...
  17. [SOLVED]Re: Simple while loop exercise but problem with stopping when emp

    I won't swear on it but I'm quite sure I went through all of the scanner and string commands yesterday to find something that would work and accept space or enter as input. After hours of trying it...
  18. [SOLVED]Simple while loop exercise but problem with stopping when empty line is typed

    Hi again, I'm sitting and learning about while loops and stuck at the first exercise it which says:

    1.Write a sentinel lopp that repeatedly prompts the user for names. Once an empty line is typed,...
  19. Re: Newbeginner - Something wrong with my GUI chess pattern

    It's called Building Java Programs - A back to basic Approach by Stuart Reges and Marty Stepp : Building Java Programs: A Back to Basics Approach, by Stuart Reges and Marty Stepp

    I like it quite a...
  20. Re: Newbeginner - Something wrong with my GUI chess pattern

    Ahhh, no in the book there was an intro to the to GUI where you use the support class(made by the authors) which I posted under the PS. That class uses the getGraphics(); method and that's the only...
  21. [SOLVED] Newbeginner - Something wrong with my GUI chess pattern

    Hello everyone,

    I'm new at programming but everyone starts as newbeginner, right? I'm supposed to make chess patterns on a panel in different sizes but something goes wrong.

    It work fine but...
Results 1 to 21 of 21