Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And maybe jail time :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

haha.. I seriously doubt the chick would have a problem with that unless you made her pay for it ;)

Yeah, don't figure on getting any if you push the check to her when it's time to leave.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

yeah but thats the case with everything

next peoplem will say that a little heroin is good, but too much....

you get my drift.

Perhaps a little heroin is good. I don't know that studies have shown that it is not. Obviously though, given the extremely addictive nature of heroin, most are not going to use it in moderation and the excess may kill them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

>what would you say?
Thanks for the meal? :)

Hehe! Sounds like a good response to me!

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

3) what should i do next?

Look in a Hardware support forum instead of Comp Sci and Software Development perhaps?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Where can i get bot for Silkroad ?

This is a Comp Sci forum - not Bots-R-Us. Look for your cheating software elsewhere please.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You may be able to add the lines as images to the items collection and use the DisplayMember property to point to those images. If not, then you probably need to work with ListView and the ImageList class.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think he already left once he found out we wouldn't just hand him a completed assignment to turn in.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you specify the main class?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just read the "tools" part of your JDK documentation on how to use the jar utility. The form of the command is going to vary with how you want to jar or unjar your files.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Since you are using DefaultTableModel, take a look at the addRow() and insertRow() methods. They both take the row as a Vector, not an Object[] array row, but you could work around that easily.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, script is the only way you are going to get this behavior. With straight JSP it would require a post to the server and redisplay of the new page.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Write an image editor. Java has an extensive image manipulation API.
You have got to be joking. ;-)

Yeah, my suggestion was a bit tongue-in-cheek about the image editor project, but so many come here and say "tell me what my final project should be". To me a final project should be a bit more involved than a one day "chat client" program or a uselessly simple web app. It should at least demonstrate learning beyond one or two packages in the Java API.

Either you didn't read the entire blog or you missed the point. The point the author was trying to put across was that the Java Imaging API when compared to other languages is pretty much prehistoric. Did you glance at the Python example he demonstrated? Don't you think doing your project is Python would have consisted of significantly fewer lines of code?

Java is known for its boilerplate code. He just wanted to say that in the world of Fourth Generation languages, a matured language like Java could have done better. Come to think of it, even James Gosling agrees to it.

I do agree that the APIs are quite extensive and may be overly complex for simple tasks. They were trying to handle all kinds of image manipulation needs in an incredibly abstract manner and that lends itself to a lot of unnecessary complexity in many cases.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can change this to MDI in the settings under Tools | Options | Advanced Mode | IDE Configuration | System | System Settings. Change th UI Mode property to MDI.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Those methods stay in the Employee class. You use them to set the values of the properties you have defined for the Employee. They don't replace the Scanner. The Scanner allows you to collect the input from the user. That input is then used to set the property values with your set() methods. Perhaps it was confusing that I inlined the method that reads the Scanner input. This might be more clear:

Scanner input = new Scanner(System.in);

double inputRate = 0;
System.out.print("Enter Employee's Hourly Pay Rate: "); // prompt for rate
inputRate = input.nextDouble();
thisEmployee.setRate( inputRate ); // rate input

The setXX() methods allow you to set those values on the Employee that you are currently working with, so they are part of the Employee class definition.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, you're correct in your suspicion - you have the method displayMessage() declared inside your main method. You need to take that method declaration out, but leave the code to read from the Scanner and use your setXXX() methods to set the properties on the Employee object that you have created. Also, don't create a new Employee with your default constructor, but instead read in the name and create the Employee with the constructor that takes a name parameter :

Scanner newEname = new Scanner(System.in);
        System.out.print("Enter Employee Name or STOP to Exit: ");
        String name = newEname.nextLine();
        
        Employee thisEmployee = new Employee(name);

        while (!(name).equalsIgnoreCase("STOP"))
        {// begin main While
                        // you don't actually need a new Scanner here - you have one from above
                        Scanner input = new Scanner(System.in);

                System.out.print("Enter Employee's Hourly Pay Rate: "); // prompt for rate
                thisEmployee.setRate( input.nextDouble() ); // rate input from user.
... // the rest of your code
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

How long have you been doing this? Just so I can get an idea of how long I have to go before I can hope to become somewhat competent.

I've been using Java about 4 years now on custom in-house software at work, plus another 8 years with different languages before that :)

No worries though, you certainly don't need that much time to become competent with Java. Just keep at it and it will come. As a software developer, you never stop learning - you just learn to learn more easily :) Eventually you become very familiar with the structural concepts and then it's merely a matter of figuring out how to incorporate the various APIs available to you and apply them to the task at hand.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I am getting "illegal start of expression" for this line

public void displayMessage();

I have checked all my braces, all my semi colons, everything looks right to me. What am I doing wrong?

Here you have put a semicolon at the end of the method declaration, before the brace which begins the actual code. The semicolon ends a statement, so it interprets this as a single statement which makes no sense to it. Remove the semicolon so your method is properly defined.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I put in the other three; rate, hours, and result.
I had to comment out the first line in each one,

// snipped

otherwise I got an incompatible type error. It wanted double in there somehwere, I do not know why or where. Why does it work with the line commented out?

You are trying to initialize numeric values with an empty string "". Initialize those to valid numeric values, such as

public double rate = 0.0;

You don't need to put those initializations inside braces (blocks), you can initialize when you declare them as I did above;

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If they have already logged in to some other page before getting to your front end, the user info may already be in the session. Can you ask the developers of the other system about that? They can probably pass any session info you need via the link to your page.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Wampserver is another all-in-one install for Apache, PHP, MySQL on Windows:
http://www.wampserver.com/en/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You haven't declared employeeName yet in your class. You have

public char eName;

which should be changed to

public String employeeName;

Also, getEmployeeName() should return employeeName.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You code it exactly like you have written it :)

If you need to call it from a button, then in your button click handler you merely call the function and update the value wherever you need to (i.e. a textfield or whatever).

C# doesn't have "procedures" - only functions. Functions that do not return a value are declared as returning "void", like so

public void someFunction(){
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can simply add references to next and previous (if you want doubly-linked list) instances in your class if you want to. A linked list just keeps track of the instances it is connected to, so you can handle this on your own easily. You will also need to write the methods for searching, adding, and removing instances from the list if you require that functionality.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As far as the cmd output and exit codes, see the thread that peter_budo posted a link to above. As for the loop, you can run it in the following loop based on exit code for success:

Runtime runTime = Runtime.getRuntime();
try{
    int exitCode = 0;
    for ( int runCount=0; runCount<5 && exitCode==0; runCount++ ) {
        // set whatever you need in properties file here
        
        Process cmdProcess = runTime.exec("cmd /c start D:/Test/run.cmd");
        cmdProcess.waitFor();
        exitCode = cmdProcess.exitValue();   // will be 0 if successful
    }
    // if exitCode != 0 here, your process failed, so do whatever you need to do for that case
} catch(Exception e){
    
}

Note: This will still start five command windows, you can't get around that, but each will close before the other opens since you are using waitFor() and checking the exit value;

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, it would be good to have a thread for this stickied at the top like some of the other Software Development forums.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ah, if you are using a Free-form Project then yeah, you'll have to specify them in both places separately. I guess it's only Standard Projects that synchronize some of that for you. Sorry for the misdirect.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You missed a few field initializations, 187 and 188 are null:

m185 = new TextField(6);
m186 = new TextField(6);
m189 = new TextField(6);
m190 = new TextField(6);

You would save yourself a lot of trouble and typing by putting these into arrays or vectors.

int numberOfFields = 333;
Label[] labels = new Label[numberOfFields];
TextField[] fields = new TextField[numberOfFields];
for (int i=0; i<numberOfFields; i++){
  labels[i] = new Label(" ", Label.LEFT);
  fields[i] = new TextField(6);
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That works. You never know when you want to read it a second time or more.
Have you heard of The Traveler by John Twelve Hawks?.
I am still waiting with anticipation for the second book that the author
promised.

Sounds like an interesting book. Thanks :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I like to keep books usually, so the used book store works out well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That's probably your only option unfortunately. I don't think Eclipse uses Ant natively for building, unlike Netbeans.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Metallica - Ride the Lighting
Metallica - Master of Puppets
Iron Maiden - Powerslave
Queensryche - Operation Mindcrime

meh, can only think of four "favorites" off the top of my head.

Other good bands: Pantera, Anthrax, Testament, The Who, Rolling Stones, Caroline's Spine, Rage Against The Machine, Godsmack, Disturbed, Tool, Alice In Chains, Megadeth.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

heh... Well, I married a red-head, so no complaints about ginger here =)

christina>you commented: aww :) +20
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And red hair is "bad" here, red hair normally means red pubes, having that is "bad". Please note the " ". A half friend died his pubes ginger. Whatever floats your boat.

??? Why on earth is having red pubes considered bad?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A complete client/server chat application is created in 2 days during Sun's SL-275 training course...

Exactly. I was being gracious in mentioning a week or two. I would assume that any type of "final project" should involve something a little more complex.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Bah, I clicked the wrong radio button on Give Rep and gave negative by mistake. Can't take it back but if someone could give him some positive rep to correct my error that would be great. This was a very helpful post. (Even though the poster put it in the wrong forum :) )

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

hi,
if your looking for just Java then try out a chatting program - u would be using a bit of network programming in java and applet/awt for the windows, buttons, text boxes.
it would be done in a month or two.

A month or two??? A week or two at most depending upon how much time they had to work on it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Write an image editor. Java has an extensive image manipulation API :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The null pointer exception means you tried to call a method on an object that had not been created yet. Chances are you just missed an initialization line (easy to do if you had 350 of them!). The exception stack trace should give you some information on which one caused the problem.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually, the constructor does have a return type - it is an object instance of your class. That is it's entire purpose. Your first "constructor":

public void Employee(char newEname)
        { // initialize name of employee
        eName = newEname;
        }

wasn't really a constructor. It was a method called Employee. The reason your code worked previously is that when no constructor is specified at all, the compiler will provide a default no-argument constructor for the class. If you specify a constructor, as you did by removing the return type, you no longer had the default Employee() constructor and so it failed. If you want to create the employee with no parameter to the constructor, you will need to give it a default constructor like so:

public Employee(){
    // whatever you need to do to set up the object
}

Actually though, you probably want the main program to obtain the name of the employee (as you do in the displayMessage() method) and pass that name to your constructor with the name parameter. The name also should be a string, since char will only hold a single character.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Proper use of code tags? Or should I place them throughout my code, perhaps at each method or something?

The only thing I am thinking about it cleaning up this code somewhat. Separating it in to more methods, using some set and get statements for rate, hours, and all that so I can place up in the main class. Is that good technique? Is it even possible without creating more sub classes?

Yes, those code tags are fine :) You don't need to break out all of the methods, code tags just preserve the formatting so indentation and such remains visible and the blocks are easily seen.

You could certainly add methods to get and set other properties on your Employee, you don't need any subclasses for that. If you add getters and setters for those properties, make the variables private to the class.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Stultuske already provided all the info needed to complete your assignment. Homework has a purpose.

deng_sen, you really need to use the code tags to make your code more readable.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you heard of The Historian by Elizabeth Kostova?.

Haven't heard of that one either. I'll have to see if I can find a copy in the local used book store.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Still though if you look past the slight homosexual nature of most of those books then they are quite a good read with a rather decent amount of history in them.

Started a really good book about 3 days ago that im almost through now called Necroscope.
Still has a bit of vampirism in it and what it has is sort of related to dracula but talks more about the "truth" behind the myth.

I have a habit of not reading blurbs on books before i buy them so when i got this one homw and read the blur i though it would be the standard trash horror. Now that i have started i must say that it is a really good book and well worth going out an buying.

Yes, I mentioned the Necroscope series a few posts up in the thread. It's a good series :) His Psychomech series is decent as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

hahaha... sorry to bring you down on it.
There were a lot of good things in the 80s as well. Heavy metal for one thing!

(I can't view the link from here at work, so I can't really comment on anything it lists)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sure! AIDS, crack, gang violence, cold war, savings and loan collapse, Iran-Contra affair... what's not to miss?!!! :P

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

oh and to answer the laptop keybord different first uhte keyboard isnt at an angle like my one at home so i have to reach a bit farther and and havemy hands placed differently which messes up my usual accuracy for one, and also its slightly more compact that my desktop keyboard aka th keys n such are closer together and slightly smaller which also fucks up my typing. Those are my reasons n im sticking to them.

Well, yes, I can agree that switching from a desktop to laptop keyboard does suck - I hate them myself - but they do still have editing keys on them...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ahhh, so he is angry over that whole bris thing...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Aw come on.They were a good series.The movie was pretty good too.

I'm not saying they are bad per se, just that I didn't care for her characterization of the vampire. Many people really enjoy that portrayal and love her books. Just not me!

Nothing I have written in stone. I might take your suggestion.

Meh, read whichever you wish first, just don't skip It. :)
Koontz is good and usually his books are a very quick read. He doesn't crank out those 500+ page monsters that King does.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

int value = p, q? 1 : 0;

This statement would not quite work (as the compiler will tell you rather quickly), instead something like this would be needed:

int intP = p ? 1 : 0;
int intQ = q ? 1: 0;

(I just arbitrarily used the variable intP for the integer value of p, so don't be confused by the double occurrence of int :) )