jasimp 427 Senior Poster Featured Poster

Do you have to do it that way? I think a much more interesting way would be to use ColorChooser

jasimp 427 Senior Poster Featured Poster

You guys should just ban guns, works for us most of the time

American's (such as I) are to cynical of our government to let that happen.

jasimp 427 Senior Poster Featured Poster

I first played that game about 4-5 years ago. It loses its 'charm' after 30 minutes of play.

jasimp 427 Senior Poster Featured Poster

You never set operationS to value and then you ask if it equals something. You need to set it to a starting value, or a value inputted from the user.

jasimp 427 Senior Poster Featured Poster

Sooner or later it has to happen! There is just too much abuse.

It doesn't matter how much "abuse" there is, a regulated internet would be terrible.

jasimp 427 Senior Poster Featured Poster

Try saving it to a .png instead of a .gif, that should (hopefully) work.

javaAddict commented: I would have never thought of that +3
jasimp 427 Senior Poster Featured Poster

You need to show us what you have done before we help you. We will not just give you code. Also ask specific questions when, don't just tell us you can't do it.

jasimp 427 Senior Poster Featured Poster

So the part you are having trouble with is the bold section? If it is think about what modulus ( % ) does. It finds the remainder in division. You need the largest whole number that fits, plus the remainder. So, what I would do is create an value that is equal to the remainder

double remainder = (number1 % number2);

That will be your remainder and if you cast number3 to an int

(int) number3

than you have the largest whole number that fits and the remainder.

jasimp 427 Senior Poster Featured Poster

Um no, It works fine in Firefox 3, Pocket IE (based on like IE4 lol), Opera and Safari.

In fact, IE5 and IE6 are the only browsers that have some bugs with the site.

This problem is (or was) almost two months old :-/

jasimp 427 Senior Poster Featured Poster

Yes, right next to "Reply to Thread".

jasimp 427 Senior Poster Featured Poster

I would recommend the fifth edition of Java in a Nutshell more than the fourth.

Alex Edwards commented: Whoo! Nice book, and it's not too expensive $_$ +4
jasimp 427 Senior Poster Featured Poster

You joined in july. I left in like May.

And it took you only a few days to finally surpass 12,000. Before you left I was sure you would be the first, but then you left and AD started catching up. Then I was sure he would be the first and but you came back to beat him to it ;)

jasimp 427 Senior Poster Featured Poster

Homemade apple pie; made with Northern Spy apples plus a few Cortland's.

jasimp 427 Senior Poster Featured Poster

None. It will never happen.

jasimp 427 Senior Poster Featured Poster

Have you done any programs before this one? You need to declare main() as

public static void main(String[] args){ 
        
}

You never ended your Inventory class, it needs its corresponding bracket. You need to import java.util.* to use Scanner.

You cannot declare a class like

public class Data video disk

It needs to be one word, as in

class DataVideoDisk{

Change the next block of code to actually declare your variables correctly. You cannot declare an int and String on the same line. Don't forget the semi-colons and make sure to actually give name1 a type.

//every line needs work
        name1 String productName;
	int number1 String productNumber;
	int number2 String productStockAmount;
	int number3 String productPrice;
	int amount String stockValue;

The code above is duplicated right below. You can't use While as a class name, think of something else. You cannot use 'x' as multiplication, it has to be '*'. Start fixing those errors and try to learn the Java syntax because most of your errors were syntax errors.

jasimp 427 Senior Poster Featured Poster

Adblock Plus + NoScript

jasimp 427 Senior Poster Featured Poster

It's actually a pretty common question. At the bottom of the thread, where the reply box is, there is a large yellow button "Reply to Thread". Next to that button there is a link that says, "Mark as Solved" Click it and then voila, the thread is now solved.

jasimp 427 Senior Poster Featured Poster

I hope that you will be able to do something with these adverts. The site looking like "cheap" forum with all of them around

I can't see any advertisements; except for the one that says, "Is Daniweb Helpful? Click for details. "

jasimp 427 Senior Poster Featured Poster

Like a lot of people here I'm fairly new at using Java and I'm having difficulties using equals (==) statements. I need need to use the if statement to say "Do you have any data to enter?", if (input == "yes") then continue with the loop.

obviously this doesn't work and I've tried using String, char, linking either to an int value and then to the if but without any luck. I'm aware most will simply tell me they're not here to do my homework and I agree. I simply need someone to point me in the right direction (website, example, anything). Also arrays are off limits for this assignment; any help would be greatly appreciated. Thanks in advance.

*Edit* um yeah, thanks to anyone for taking the time to read this post but after 6 hours of searching the web I found out how to do it.

What you could have done is marked the thread as solved, that way everyone would know it was solved and would not read the whole thing. Or, if you really wanted to be helpful you could have put the edit at the top of your post, instead of at the bottom.

Alex Edwards commented: =P +4
jasimp 427 Senior Poster Featured Poster

hi all
i am new to dani web so if i make any mistake please forgive me ... I am just wodering that some could help me in my assignment.. i am not a programming geek and offcourse not in java. my teacher has gave me this assignment i dont have a clue what to do can any one please help me i m very thankful to u all...

QWrite and deploy a simple Java RMI-based Client/Server application. This is a simple Math Service, which we'll refer to as MathService. It will allow users to perform the following operations: Add, Subtraction, Multiply, Square, etc. In addition, MathService will have the following resource properties (RPs for short): Value (integer), and Last Operation performed (string)-ADDTION, SUBTRACTION, MULTIPLY, SQUARE, etc.

I would suggest reading this tutorial and maybe do a little more searching if you still don't understand it. If you don't understand it after that ask your teacher or someone else in the class for help. Teachers don't usually give homework without having covered or given reading on a subject. An RMI application is not a thing you do early on in a programming class so you should have some programming skills. Lastly, when you are working on your code and have a specific problem about it you can show it to us, give us an explanation of what is not working and we will try to help.

Alex Edwards commented: Great Link! =) +4
jasimp 427 Senior Poster Featured Poster

You could create methods that return different values based upon the input, but you still need if statements to do that. Would it be possible for me to see what you have? It would be much easier for me to help.

jasimp 427 Senior Poster Featured Poster

When you use an InputDialog the input is received when you click OK, which also closes it, until it is called again. To get out of the while loop you can 'break' it. I wrote an example to show you what I mean.

public class LeapYear {
	
 public static void main(String[] args) {
  //creates the year varible and the sentinel value
  int year, sentinel =8;
  //creates a gregorian calender to use the year variable with
  GregorianCalendar calender = new GregorianCalendar();
  //this while loop will run until sentinel = 0 or a break; is called
  while(sentinel != 0){
  // gets the year from the InputDialog
  year = Integer.parseInt(JOptionPane.showInputDialog("What is the year? (0 to quit)"));
        //ends while loop if they entered the quit value
	if(year == 0){
	 	break;
	}
        //makes sure the year is within the correct range
	if(year < 1582 || year > 2020){
	        JOptionPane.showMessageDialog(null, "Year out of range");
        }
        //confirm leap year
	else if(calender.isLeapYear(year)){
		JOptionPane.showMessageDialog(null, "The year you entered is a leap year.");
	}else{
	         JOptionPane.showMessageDialog(null, "Not a leap year");
	}
    }
}

}

The if statement on line 9 checks the input gotten from the first JOptionPane.showInputDialog. The only way the input exists, is if you click OK in the input dialog, which closes it. The break; in the if loop breaks the loop, ending it and in doing so, ending the program. If the while loop never ends it will keep opening an InputDialog, checking to see if it is a leap year, and than start all over …

jasimp 427 Senior Poster Featured Poster

The error is pretty self explanatory. You never gave the variables a value.

float num11, num22;

That creates them but it does not initialize them with a value. If you give them a starting value, such as zero, your error is fixed; however your program does not work due to a logic error. Your method fun reads the values but never returns them. I think you should be able to figure it out from there.

jasimp 427 Senior Poster Featured Poster

Chil i just requested some info or ideas if you have any, so tha means you can think and calculate logical stuff.. etc. so if you can't think you shoudn't be posting at the first place

If anyone shouldn't be posting it is you. Ezzaral is probably the most helpful person in the Java section and he knows more, or can at least think through problems better than you ever will. He told you to search the forums because we get a request like this about once a week, on average. You also need to learn to stop acting like a lazy punk because that is how you come across.

jasimp 427 Senior Poster Featured Poster

This thing happened a year ago!

Yes and if you read the Fox article is mentions that it has been happening for about one year.

jasimp 427 Senior Poster Featured Poster

In the Table class you could override the toString() method and have it return anything you want. For instance:

public class Table{
public String toString() {
    return "This is a table ";
  }
}



Table one = new Table();
System.out.println(one.toString());
//Outputs "This is a table"

However if you want to get information about a Table object you would need get and set methods like I mentioned earlier. I have a more in depth example from what I said earlier.

public class Table {
	String color,texture;
	
	public void setColor(String setColor){
		this.color = setColor;
	}
	public String getColor(){
		return color;
	}
	
	public void setTexture(String setTexture){
		this.texture = setTexture;
	}
	public String getTexture(){
		return texture;
	}

}
public class TableTest {

	
   public static void main(String[] args) {
     Table one = new Table();
     Table two = new Table();
     one.setColor("red");
     two.setColor("green");
     one.setTexture("wood");
     two.setTexture("plastic");
    System.out.println("The color of table one is " + one.getColor());
    System.out.println("The texture of table one is " + one.getTexture());
    System.out.println("The color of table two is " + two.getColor());
    System.out.println("The texture of table two is " + two.getTexture());
    System.out.println("The class is " + one.toString());

	}

}

The TableTest class outputs

The color of table one is red
The texture of table one is wood
The color of table two is green
The texture of table two is plastic
jasimp 427 Senior Poster Featured Poster

You can create get/set methods inside the table class to set data and get data. What you could do is create a method that returns all the data you want, using the same basic structure as below.
An example:

public class Table{
String color = "red";
public void setColor(String color){
     this.color = color;

        }

public String getColor(){
     return color;

        }


}

Is that kind of what you were asking?

jasimp 427 Senior Poster Featured Poster

A few more problems:

cleanInputBuffer = input.nextLine();

cleanInputBuffer is never instantiated.

while (hourseWorked < 0)

"hourseWorked" should be changed to "hoursWorked"

I'm not sure what the bracket on line 27 is used for and the corresponding one is on line 42. I think you could get rid of them. Try formatting your code in the future; it is much easier to debug and read. Also when I run the program is does not output the way you want it to.

Enter Name of Employee:Testname
Enter a positive hourly rate:10
Enter a positive number of hours worked:10
The employeeTestname was paid $ 100.00this weekEnter Name of Employee:Enter a positive hourly rate:

You need to reexamine your System.out.print statements

jasimp 427 Senior Poster Featured Poster

I guess you need to be told again USE CODE TAGS

jasimp 427 Senior Poster Featured Poster

Congratulations Grim and Henri, a fantastic accomplishment only a few posters have achieved!

79 (as of this post)

jasimp 427 Senior Poster Featured Poster

How are we supposed to know what is wrong if you haven't shown us any code?

jasimp 427 Senior Poster Featured Poster

To be considered what?

You mean you can't read minds?

jasimp 427 Senior Poster Featured Poster

I wouldn't touch Chrome until after it comes out of beta because its hard telling what else it might do to my computer.

Some people shared your concern in this Chrome thread :)

jasimp 427 Senior Poster Featured Poster

If you post your questions in the correct forum, without using chat room language, sure :) People will try to answer your questions and help you.

jasimp 427 Senior Poster Featured Poster

We do not send emails out to people and we are not going to do your work for you. The point of this site is to help people so that they learn. By telling us your problem we can help you fix it and in turn help anyone else that has the same problem. If you need a starting point you can read the Sun Thread tutorial.

jasimp 427 Senior Poster Featured Poster

No. It shouldn't.

jasimp 427 Senior Poster Featured Poster

What I think is your friend either doesn't want you to have his IP address or doesn't know you are trying to get it. I also think it would be beneficial to those trying to help you if you showed them what you have done, i.e some code.

jasimp 427 Senior Poster Featured Poster

They sneak up on you:
"oh that's cool"
and
"oooh let's try that".
"Google's doing this!" and "Google's doing that!" and pretend like they are not after the entire F'N market, and then one day they are the internet gods and thou shalt not pass without Google having a hand in everything that you do online.

PLEASE, don't buy into it, they own enough of the internet, just stop. FF is an excellent open source browser if you want one.

Just a little paranoia eh ;)

I do agree to a point. One of the best thing about chrome is that it might spur some more competition with FF, which is good for us.

jasimp 427 Senior Poster Featured Poster

A lot of people like parts of and/or love it. Just because he does doesn't make him an employee there.

jasimp 427 Senior Poster Featured Poster

EDIT: Never mind, I hit the wrong button.

jasimp 427 Senior Poster Featured Poster

Some people should learn how periods work.

Ezzaral commented: hehe! +11
jasimp 427 Senior Poster Featured Poster

Has anyone tried Google Chrome yet? It's Google's web browser they released today for the first time as a public beta. Still quite buggy but it's looking pretty nice. If you try it lets hear what you think.

jasimp 427 Senior Poster Featured Poster

>>>Why should we believe you? - John A

:) This is good rep on a rep comment.

Nick Evan commented: This is rep comment on comment on a rep comment :) +8
jasimp 427 Senior Poster Featured Poster

This makes me wonder if he ever read the book The Blue Nowhere by Jeffery Deaver. His idea seems like it was formed from parts of the book. The fact that this post has been here for a day, after being flagged makes me wonder where all the moderators are.

jasimp 427 Senior Poster Featured Poster

setVat(discount); setDiscount(vat);

so what a about the price

product owner responsibility: Put into a simple list, typical product owner responsibilities are:

decide on the project vision - who is going to benefit from the project and how;
secure funding;
continuously make decisions on the product priorities - what is more important with the latest information in mind;
continuously make decisions on maximizing the product ROI - make sure the features with the biggest benefit/cost ratio are developed first.

XP Practices:
-Collective ownership
-coding standards
-sustainable pace
-test first
-acceptance tests
-automation
-onsite customer
-continuous integration
-pair programming
-metaphor
-refactoring
-incremental design
-stories
-small releases
-planning game
-informatie workspace

What am I thinking right now? You should be able to guess correctly because I have seen the proof of how advanced your website to user mind reading capabilities are.

jasimp 427 Senior Poster Featured Poster

quite frankly any member who leaves the site after 20 seconds who cant be bothered to read the instructions doesn't really deserve to be here. :icon_wink:

Suppose a really great programmer or someone who knows XP and hardware inside and out, or someone like crunchie who is a genius when it comes to virus removal, joins Daniwed, and they are forced to read something they don't want to. Right there they might decide we don't deserve to have them. Then we would lose a potentially great member. I think it is better to have them join, have the option of reading the rules and if they break them often enough they will be banned; ridding us of their presence. Much better to lose an awful member, than a potentially great one.

peter_budo commented: Exactly my point +10
jasimp 427 Senior Poster Featured Poster

I'm not sure how to do that. Timing how long between a keyPressed and a keyReleased might work. Maybe someone else will know.

jasimp 427 Senior Poster Featured Poster

Put the images wherever the java source file is. If you have your files in (for example) C:\Documents and Settings\lordx78\My Documents\Java Game put the images in there.

jasimp 427 Senior Poster Featured Poster

Subscription Spy is displaying the times incorrectly (as in not chronologically). Notice the times in red are the same thread and the same time while the ones in blue are the same thread, same time. I was thinking it might relate to the posting quickly problem, which is also noticeable in this thread (Bob_180_Bob's posts near the bottom)

jasimp 427 Senior Poster Featured Poster

KeyListener
Using keyListener
You need to implement it, and then add a listener with addKeyListener(this) and you need to use all of the methods provided because it is a interface (they are listed in the link I gave you.) The second link should help you learn how to use it. Using Google you could find the key codes for each of the keys on the keyboard.