|
yes
|
|
|
|
|
But why is it still a secret?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
[mode=igor]
Shall I fire up the labotomy drill marther?
[/mode]
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
I think the salient information is that the programs build and run, but an error occurs. Is this correct?
If yes, then WHAT IS THE EXCEPTION?
Going by your garbled post, you think the file image.gif exists, but it can't be loaded by the sender. Correct?
What folder is the file in? Where is sender.jar in relation to it?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
yes , the program is running but the error occur at the receiver side because the exception occurred when the receiver try to receive the transmitted file from the sender .
the image.gif found in the sender package and because the transmitted process complete successfully so I don't think the problem in the image file .
|
|
|
|
|
Here is a very basic suggestion which should help you. I would not recommend this in a real production application, but for your situation I think you may find it helpful.
Replace this section of code:
catch(IOException e)
{
System.out.println("error...");
}
with this:
catch (IOException e)
{
e.printStackTrace();
}
This will give you more information which will hopefully give you an idea of what is going wrong.
|
|
|
|
|
I may be wrong in the analysis of the problem but on the server code you are creating 2 handles of files simultaneously without closing one. Wont this be a problem.
|
|
|
|
|
Well, I'm working on an application that works as a server for a Ship Management System. And my boss had an idea to limit client number based on license. After brief discussion we agreed to with a licensing system where we distribute a license file that must be put in app dir that contain a definition regarding how many clients are allowed.
Now regarding that file, I'm thinking of creating a class that contains the info then serialize it. and distribute that file to client and read the file from my application. My questions are, what encryption should I use? Are there any better solution?
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
use dongles. Dongles @ Wikipedia[^]
With dongles you can control who uses the Software and how much copies are used.
The dongle should be handled as a chip card, a USB-Dongle opens a gate to get viruses and all kinds of other stuff onto the ship.
Also think of obfuscation -> encryption of the code.
regards Torsten
I never finish anyth...
|
|
|
|
|
Thanks for the info on Dongle, it's a nice read (though I highly doubt my boss would agree with this one).
TorstenH. wrote: Also think of obfuscation -> encryption of the code.
Sup, will do.
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
Create a hash of the relevant license data, encrypt it on your computer with your private key, and add that to the license file.
The application shipped to the customer contains the public key. The application reads the license file, creates the hash as you did on your local computer, decrypts the stored encrypted hash value and compares it with its computed hash value. If it's ok, the license file is ok, otherwise the application would refuse to run.
I.e. you use an encryption method with a public and a private key.
|
|
|
|
|
Ah, Thanks for the heads up.
Oxfords English < Official CCC Players Dictionary
Excuse me for my improper grammar and typos.
It's because English is my primary language, not my first language.
My first languages are C# and Java.
VB, ASP, JS, PHP and SQL are my second language.
Indonesian came as my third language.
My fourth language? I'm still creating it, I'll let you know when it's done!
|
|
|
|
|
I want to print restaurant bill directly to printer when user click button "Print Bill" without display content is printed. My project is JSP/Servlet web appplication.So, solution can write in java or javascript. Can you help me ? Thanks so much.
Sorry, I don't know post this question in which topic Java or Web development.
|
|
|
|
|
|
I'm writing copy to clipboard and paste from clipboard in jlist by myself .
I don't know why I can't use 'ctrl C' key to do it in jlist . With other key is ok (For example : 'ctrl M'... .
I know jlist support DnD .
AnyIdea ?
Thanks !!
|
|
|
|
|
|
Hello All,
I'm trying to validate two input text boxes and am running into a snag. I'm using a while loop that runs while either one of the inputs is 'false'. The problem is that it doesn't stop and allow for a user to correct the first input if its bad and goes on to check the next input.
I could do this before when I just checked one input at time and called the validate method twice. Trying to do both in one method is proving to be a pain. Any ideas?
Here's my validate method:
private boolean validateInput(String input1, String input2)
{
Boolean[] inputValidArray = {false , false};
String[] inputArray = {input1, input2};
JTextField[] textFieldArray = {jTextField1, jTextField2};
float numberToValidate = 0;
int counter = 0;
String errorMessage = "";
while (!inputValidArray[0] || !inputValidArray[1])
{
try
{
if (!(inputArray[counter].isEmpty() || inputArray[counter] == null))
{
numberToValidate = Float.valueOf(inputArray[counter]);
inputValidArray[counter] = true;
}
else
{
errorMessage = "This field can not be left blank!\n" +
" Please enter a valid number!\n" +
" (example: 123.45 or -123.45)";
Create_Error_Message_Dialog_Box(errorMessage);
textFieldArray[counter].requestFocusInWindow();
}
}
catch (NumberFormatException nfe)
{
errorMessage = inputArray[counter] + " is not a valid number!\n" +
"Please enter a valid number!\n" +
"(example: 123.45 or -123.45)";
Create_Error_Message_Dialog_Box(errorMessage);
textFieldArray[counter].requestFocusInWindow();
textFieldArray[counter].selectAll();
}
counter += 1;
}
return (inputValidArray[0] && inputValidArray[1]);
}
modified 6-Nov-11 7:08am.
|
|
|
|
|
Please edit this and put <pre> tags around the code.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Edited, sorry, didn't know that the <pre> was needed around the code. Thanks!
-- modified 4-Nov-11 13:15pm.
|
|
|
|
|
Well it still isn't set properly; take a look at the result of your edit.
It should be:
<pre lang="java">
// code here
</pre>
so it looks like
private boolean validateInput(String input1, String input2)
{
}
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Oh, I didn't have the code highlighted first and it showed up at the top of my code. So, I copied the </pre> and put it at the end of my code (but forgot to delete it from the top). Should be all set now for review!
|
|
|
|
|
See how much easier that is to read?
The statement at the top of your loop is:
while (!inputValidArray[0] || !inputValidArray[1])
Are you sure that should be an OR expression rather than AND ? If the first value validates OK then you set counter to 1, but then break out of the while statement because inputValidArray[0] is now true .
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
@Richard
Yes, I agree that using the formatting codes makes the code much more readable!
As far as my code goes:
Ah I understand what your saying about using the OR instead of AND, but I don't think I'm having a problem with that because each inputValidArray is negated using the exclamation. So, the loop will not be broken unless both are not false. I could have used:
while (!(inputValidArray[0] && inputValidArray[1])) instead.
I think my main issue is that I can't get the code to stop and allow the user to fix the input in jTextField1 after it determines the input is bad. I set the focus and highlight it, but the code continues on and looks at jTextField2 and does what it should. Then it comes back up and checks input one again, which is already 'bad' and basically creates a loop I have to manually break out of. Does that make sense? Thanks!
|
|
|
|
|
I misread the code and your question earlier. I think what you need to do is add some break statements to get out of the loop when one of the values is bad. This should then allow the user to correct the input and then you can call the validation method once again. Something like:
Create_Error_Message_Dialog_Box(errorMessage);
textFieldArray[counter].requestFocusInWindow();
break;
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
@Richard
You know, I thought of that and that would be the easiest way out. I was hoping there was a way to keep the loop going, but, I guess I was in denial! lol Thanks for your help!
|
|
|
|