1,678 Posted Topics
Re: It doesn't make it any different. The 'abstract' is implied. You can find the same information in the Java Tutorials somewhere (I remember reading it, but don't remember where), but this question was also already asked [URL="http://www.velocityreviews.com/forums/t298061-abstract-interface-in-java.html"]here[/URL]. | |
Re: Are those JTextFields? If so, setText is the right method. [url]http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html[/url] Are you sure your text fields are properly initialized and added to the panel? Can you post a bit more code showing where this is done? And have you taken similar steps in your code as I have in … | |
Re: Here is a for loop that can iterate over an array [CODE]for (int i = 0; i < array.length; i++){ //Now add your code in here to access your array etc }[/CODE] | |
Re: [QUOTE=kvass;1134734] My confusion: Isn't one of them wrong??? If intOb calls compareTo() correctly on ob which is of type object, shouldn't the printBirdCall() be called correctly on bird, since it is an instance of Parrot? Is there a distinction to be made between these 2 cases??? Help!!![/QUOTE] No. Look at … | |
Re: [QUOTE=jwenting;1133237]Best solution IMO: scrap both rep and voting and give mods more power to remove useless and factually incorrect posts (which are the main reason people (should) vote posts down anyway) and posts in violation of the TOS (which apparently can't be removed now for some reason).[/QUOTE] Disagreed. The mods … | |
Re: Why would you read in the user's choice into a variable called "app" but then check to see if a variable called "application" is greater than 20. There is your first mistake right there. Besides, you already know that application = 0 since you just declared it and never changed … | |
Re: Then you will need a [URL="http://java.sun.com/docs/books/tutorial/uiswing/events/windowlistener.html"]WindowListener [/URL]on the secondary JFrame. In particular, you will need to declare your secondary JFrame's class as "implements WindowListener" and then you will need to implement each of the methods found [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/WindowListener.html"]here[/URL]. Look at the windowClosed() method in particular; since it gets called when your … | |
Re: Jwenting said probably said that because googling "vector arraylist java" returns thousands of helpful results to the exact question the OP asked. Why reiterate a question that has been answered so many times that can be found so easily? And you upping this thread was also unnecessary. Look at the … | |
Re: Java Addict is absolutely correct. From online (would credit source, closed the tab accidentally): "Since Strings are objects, the equals(Object) method will return true if two Strings have the same objects. The == operator will only be true if two String references point to the same underlying String object. Hence … | |
Re: Start like this: [CODE]Student[] student = new Student[SIZE];[/CODE] After you design a Student class similar to the Person class described above. Your teacher might want some sort of hierarchy, such as Student extending Person. Read about inheritance. Read about classes. And read about arrays. Feel free to ask about those … | |
Re: [QUOTE=ardav;1114429][OFF_TOPIC] I have a point, but I'd also like to **** off gung-ho pillocks that say things like "we're at war with the Muslims". You probably don't like my post, but I don't like people banging on about their right to invade other countries and then blast 'em with Bible … | |
Re: Search the forum first. I'm pretty sure whether its for a neural network or anything else is immaterial. What you want to know is how to convert an image to a vector, period. Am I right? | |
Re: What bugs did it solve? Did anything else in your program change? Post your updated code. Your program might not be working even though you think it is. Simply taking out or fixing one thing can cause another thing to break. Errors can cover other errors, making them look correct. … | |
Re: [QUOTE=XodoX;1130739] The search option is obviously still missing. The way it is not, is that ok? I have no idea how to implement the search though. I don't know how to do the search. Help would be relly appreciated.[/QUOTE] Create an 'Automobile' class. Your ArrayList should be filled with Automobiles. … | |
Re: If your "start" Node is null, then your method will never run like you want it to. Try checking to see if start is null simply by doing this: [CODE]if (start == null) System.out.println("start node null error");[/CODE] Furthermore, as far as I can tell, this loop has no effect since … | |
Re: [CODE]if(tempString.equals(sBuilder))[/CODE] That line will not work since sBuilder is a String, while tempString is a StringBuilder. They are different types of objects. The equals() method is meant to test if two objects of the [I]same type[/I] (i.e. two Strings, not one String and one StringBuilder) are equal. I imagine you … | |
Re: If you're using Scanner's next() method to read in the String, it is probably killing your whitespace. [url]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html#next%28%29[/url] . Keep in mind that the default delimiter pattern matches whitespace, so your 'tokens' that it refers to in the method documentation is preceded and followed by whitespace. Do you mind posting … | |
Re: [QUOTE=Ene Uran;1120287]The government also has the power to print money. lots of it! A measly 14 trillion, ha, just a drop in the bucket![/QUOTE] But when the government abuses that power, the money becomes worthless. | |
Re: adatapost When he first joined the site he seemed different in some ways (one being that his English wasn't as good, or didn't seem as good to me). However, he has since become a mod in the Java forum (and perhaps other forums as well?) and has definitely earned my … | |
Re: 1. Number is a class name. If you want to declare a 'Number' variable, you have to do it like this: [CODE] //Make sure you use a valid constructor Number numberName = new Number(); //An alternative way Number anotherNum = null; //Somewhere later in the code, before you use the … | |
Re: [QUOTE=musthafa.aj;1126743]i request daniweb admin need to more clarify about what kind of question need to be asked? list of exception that should not be in thread... people who are not aware of rules and regulation maybe a newbie asking some questions that violate our rules should be warned first time … | |
Re: TBH, if anyone asked me to write a Binary Search Algorithm on a whiteboard, I would be terrified. I'd need a few minutes just to sit and think about what to do, and I can't do that with someone else waiting for me to do it. Also, Narue, I have … | |
Re: So you want us to fix something you didn't write for you? No thanks. | |
Re: Haha. No details? If you want to impress someone you'll have to program something that is either extremely cool (which would involve coming up with your own idea) or program something that is above your skill level. I'd program something that isn't that difficult such as the client/server game that … | |
Re: Is that maybe because Unix commands don't execute when you aren't in a Unix environment.. ? | |
Re: I have to disagree with jwenting here. If you are already using an ArrayList then why use an additional data type that doesn't even help you in any way? Do the following: 1. Write a for loop that iterates over your entire array. 2. For each element in the array, … | |
Re: Yeah, obviously it is just how Java was written. But the reason for that was, in no small part, based on C++, where multiple inheritance can get very messy. I don't remember the issues very well (as I'm not a cpp programmer), but one issue is that naming of methods … | |
Re: [url]http://en.wikipedia.org/wiki/Process_%28computing%29[/url] Not useful? | |
Re: You're much better off either asking a more code specific question here or relying on the people you work with rather than a vague question like the one you provided. From the fact that you said 'extension point' I'm assuming you are working in Eclipse RCP, since I have worked … | |
Re: What is the error? Give us the error message, usually it includes line numbers and other useful information. | |
Re: [QUOTE=Narue;1114310][B]>A word I wouldn't expect to see in a programming text >"gauche"[/B] Why not?[/QUOTE] Probably because it is an extremely unusual word, it is not the best word to describe the situation, and most of the readers of any programming book would not have ever seen or heard the word … | |
Re: What don't you understand about those topics that Java Sun's articles can't answer? I'm not going to type you a paper about abstract classes and neither is anyone here, since the information is readily available. Ask a specific question. | |
Re: [QUOTE=Ene Uran;1110935]The folks at the NSA will pick your super secret password in less than a second. So, pick something simple you can easily type and remember in the hope that it is safe from the boss or your underage sister.[/QUOTE] Really, how? Because the NSA might have faster computers … | |
Re: [QUOTE=orcboyx;537287]Aren't there some potential repercussions from using these programs?[/QUOTE] If the program is freeware, than the only potential repercussion is that it might be illegal according to Windows to bypass their OS to change your password. But you don't need to worry about that. Nobody cares about changing your own … | |
Re: [QUOTE=KirkPatrick;1122361]You will however need the [I]@Override [/I]though. [/QUOTE] You do not [I]need[/I] the @Override. All you need to do to override the equals method is provide this method header (and an implementation) in your class: [CODE]public boolean equals(Object obj){ //some implementation goes here }[/CODE] Using the @Override tag is helpful, … | |
Re: Complexity should be O(n). You only need to scan through the entire String once. If you get to a point where your current sequence it is no longer in sorter order, start your current counter over, moving to the next character. Then repeat. | |
Re: What kind of Objects are in your list? Are they Strings? if so, contains should work fine, if they are custom made Objects, you will need to override the equals() method of the Object class. You can look into how to do this properly on google; it is fairly simple. | |
Re: [QUOTE=zortec;1120866]That is odd. Back when I was programming in college, you were not allowed to write any code until the flowcharts and pseudo-code were done. They also had to be approved by the teacher.[/QUOTE] No shit. Just like you don't design the plumbing after the house has been built. Or … | |
Re: You could read each line of the file into an array. Since you would know that the current line is at an index less than the lines after it, you could use that knowledge to compare characters without a problem. | |
Re: You aren't declaring your while loop properly because of the ';' For examples of how to correctly use while loops, use google, but for any type of loop, you need to put brackets around what you want to happen. Quick example for you [CODE] //acceptable while(someVariable == false){ //do stuff … | |
Re: JavaAddict: Good suggestions but for the one suggestion, it shouldn't matter if he implemented equals() since he is using the removeAll method. Right? OP: If none of JavaAddicts solutions work, please post all of your code and I will run it and play with it and help you figure out … | |
Re: Well, where is your code to find the quadrant? You mentioned that you already wrote it, but you did not post it. Personally, I would just drop that piece of code into the Test2 class you created (or whatever your main class is). You could also put it in your … | |
Re: Not to dissuade you if this is a learning experience, but don't expect a perfect product with JMF. I wrote a simple media player and the audio did not play back as well as I had hoped. And certainly not as well as mainstream media players, even for the same … | |
Re: Your question didn't make sense to me. Explain.. differently. | |
Re: Unless you enjoy proving things you're probably going to hate mathematical proofs, so take linear algebra. I'm just being a realist. You can learn a lot in either class, and Rashakil's argument for taking the proofs class can be applied to anything. Yeah, you can learn linear algebra on your … | |
Re: To make the components fit the entire screen, you could programmatically intercept the user's 'maximize' action (using WindowListener). Then, when the user hits maximize, you can [URL="http://www.exampledepot.com/egs/java.awt/screen_ScreenSize.html"] use this technique[/URL] to get the screen size. Then set the size on the JFrame using setSize to the size that you just … | |
Re: You can't use spaces. If you want to name your variable total of cars you simply cannot do that, so use total_of_cars instead. So yes... using invalid syntax is a sure way to cause errors. Also, the number of errors you get does not necessarily matter. In other words, you … | |
Re: In reference to what Vernon just said, check out [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Float.html#parseFloat%28java.lang.String%29"]this link[/URL]. It is [I]very[/I] important to learn how to read and interpret the javadoc documentation. And when I think of dynamic memory allocation, I think of malloc and calloc in C. . in Java, all you need to do is … | |
Re: [QUOTE=akonful;1118211]OK, how would I do this[/QUOTE] read this. [url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Character.html#isDigit%28char%29[/url] | |
Re: No, because you hard-coded the values in, you never prompted the user. But you knew that. So what are you asking .. ? |
The End.