Norm Radder

Master Rancher
+ Follow
since Aug 10, 2005
Worked mostly with IBM mainframe assembly code. Loved IBM's VM OS.
On vacation
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Norm Radder

This is a rather old bit of my code copied from the oracle site:

I usually don't go messing around in 10 year old working code to bring it up to current techniques and standards.
2 days ago
Thank you Stephan.
I did not understand what was happening.  
Now with a little logic in the mouse listener code, the frame can  be moved to y of -100 and it works as desired.  More code and it moves y back into view.
3 days ago
I have a class I use to map over the screen to display where on the screen the mouse was clicked.  It does not trap clicks in the top 80-100 pixels.  Why is there this gap?  I'd like to have 100% of the clicks be trapped.
4 days ago
I store very little of my stuff on the C: drive.  I've partitioned my HDD to have a D: drive for files I'm working on and an E: drive for data (files that are not being changed much like photos or documentation)
I don't write anything into C:\Users\Norm.  The C: drive is for MS and other installed programs.
5 days ago
Why does nextChar method called in  readChoice throw the exception?  

Can you post the code for the readChoice method?
5 days ago
It is time to play computer and step through what the code will do.
What happens when the exploreCatalogue() method returns?  The break statement causes execution to exit the switch statement.
Then it goes the end of the while loop which will call readChoice() method for a char.  
The code for readChoice is not shown so we can't see what it does.   From the exception it looks like it calls the nextLine method without there being any input to read.
What should readChoice do it there isn't any input to read?  The Scanner class has a method for testing if there is a next line.
5 days ago

don't know why you would put the mkdir command method in a println statement

To see the results.  I would add some text to the println to make it more readable:
5 days ago
Also all switch statements should have a default: case to catch and handle invalid input values.
5 days ago
Can you copy the program's output that shows what you are asking about and paste it here with some comments describing what you want to be different?
5 days ago
Did you print the value returned by System.getProperty("user.dir")?  Are you confusing that property with user.home?
6 days ago
The declaration of the variable: secretKeySpe should be left where it is on line 5.  The assignment statement that gives it a value needs to be moved into the constructor so it can use the value of  pinToMd5 that was passed to the constructor.
When line 5(is that 17 in your code) is executed, pinToMd5 will have a null value: NPE

Why is a reference to MainActivity passed to the constructor on line 49?  I suggested that the value of decrypted1 be passed to the constructor.
1 week ago

I removed line 8,

No, line 8 was required to declare decrypt1 at the class level.  What needed to be changed was line 41 so it was only an assignment statement that assigned a value to the variable declared on line 8.

The purpose of the constructor I described was to accept the value of decrypt1 and save it so that it could be used to compute the value of secretKeySpe.
The statement that computes secretKeySpe needs to be inside of the constructor so that it can use the passed value of decrypt1.  The declaration of secretKeySpe needs to  be at the class level the same as with decrypt1 in the MainActivity class.
1 week ago
Several problems I see:
decrypted1 is declared in two places: line 8 and line 41.  The local declaration on line 41 masks the declaration on line 8.  Remove the declaration on line 41 and make it an assignment statement.  See post  Yesterday 4:10 PM

The value of decrypt1 should be passed in the constructor to the Decrypt2 class.  Once the constructor gets that value it can be used to compute the value of  secretKeySpe.  The existing code  uses a new instance of MainActivity(not the one with the desired value) to access the value of  decrypted1 which will not have a value in the new instance.
1 week ago
Passing a value to a constructor is very basic java.  How did you get to this point in your programming without learning how to use a class constructor?
Here is a link to the tutorial re constructors:

I've been trying to create a constructor,

If you are having problems with the code, you need to post the code and the error messages or a description of the problem.
1 week ago