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...
Type: Posts; User: JavaN00b
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...
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;...
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...
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...
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...
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...
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...
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...
? 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...
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...
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...
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...
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...
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...
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...
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...
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...
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,...
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...
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...
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...