3,927 Posted Topics
Re: Then use the "!" not operator. | |
Re: If you consider that the component generally starts with a cleared surface of the background color, it's often unnecessary to use clearRect() or fillRect() to clear out the background, but if you are maintaining an image reference for purposes of buffering some updates then you would need to clear that … | |
Re: You would need to run a loop like that on a separate thread from the Event Dispatch thread because that event thread is where repaints of the screen are processed. There is a small tutorial on that here: [url]http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html[/url] | |
Re: You didn't say which line the error is occurring on, but I am guessing that it's this one[code]int minMarks = Collections.min(tmaMarks);[/code]because the [URL="http://java.sun.com/javase/6/docs/api/java/util/Collections.html#min(java.util.Collection)"]Collections.min()[/URL] method states that exception is thrown when it's invoked on an empty collection - which you are doing. | |
Re: And how do you feel about Jello shorts? | |
Re: In the same vein you are already discussing, keep in mind that you don't have to code all of the coordinate stuff yourself either. You can make a small wrapper to manage that glyph that just contains the other objects you need to work with[code]class TeamGlyph { private Team team; … | |
Re: [code]Form1 form = new Form1(); form.setVisible(true);[/code]Of course, that still leaves it to you to create your "Form1" class that extends JFrame or whatever. [url]http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html[/url] | |
Re: I'm guessing it's decompiled code. If you want to know the details of what it is doing, consult the source. | |
Re: [QUOTE=serkan sendur;863563]i need more precise info like; go grab this brand this model and this guitar, then you are good to go...[/QUOTE] It's just not that simple. There is a wide variety of amps with a wide variety of different sounds and settings. Add in effect pedals/boards such as those … | |
Re: [QUOTE=mrboolf;759462]...but it demonstrates extraordinary bad taste to name a son just to "have fun" ...[/QUOTE] Well, the parents who do that probably only have that son from "having fun" and thinking things through is not their strong suit. | |
Re: Here's a tutorial that should get you there: [url]http://www.goodphptutorials.com/track/62[/url] | |
Re: Use [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html#getresource"]getClass().getResource() to load them[/URL]. | |
Re: As you have it described, simply [icode]java Main[/icode] should work just fine. You do not need to include the ".class" part. In fact, when the "java" command sees the ".", it assumes that is a package designation, which is why it is trying to find "Main/class". | |
Re: [QUOTE=jephthah;858999] i think i need to adjust my meds. or cut back on caffeine. or have more sex. or something.[/QUOTE] At least work backward through that list - you may as well start with the best option :icon_cheesygrin: | |
Re: I think [URL="http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html"]TreeMap[/URL] is the closest to what you are looking for. As for "storing unique item", the map is unique in the key, but not the value. You can read more info on the various collection implementations here if you like: [url]http://java.sun.com/docs/books/tutorial/collections/implementations/index.html[/url] | |
Re: Java Advanced Imaging (JAI) API has a lot of tools for that: [url]http://java.sun.com/javase/technologies/desktop/media/jai/[/url] or you can look through the standard image api package: [url]http://java.sun.com/javase/6/docs/api/java/awt/image/package-summary.html[/url] You may also find this tutorial helpful: [url]http://www.dickbaldwin.com/java/Java174.htm[/url] | |
Re: Yes, dumping your homework into 4 posts with no code tags and no specific questions is not likely to yield a lot of constructive advice. | |
Re: You'll have to clarify a bit more what you mean by "value in map"? | |
Re: Well, perhaps this chapter from Thinking In Java, 3rd ed will be helpful: [url]http://www.codeguru.com/java/tij/tij0087.shtml[/url] You might look through the info on Java Glossary as well: [url]http://mindprod.com/jgloss/array.html[/url] | |
Re: [QUOTE=serkansendur;753790]yeah i am currently working with raima database and there is no forum i can ask about it.[/QUOTE] This certainly looks like a forum to me: [url]http://www.raima.com/forum/[/url] I doubt that Dani wants to create a separate forum for every single database that is available for use. | |
Re: Most likely the graphics context in the earlier version that you obtained from the getGraphics() call and drew on got updated by a repaint operation - so no more image. Overriding paintComponent() as you did in the second example is the proper way to do it. | |
Re: You might take a look at the tutorial on using object streams: [url]http://java.sun.com/docs/books/tutorial/essential/io/objectstreams.html[/url] | |
Re: Perhaps this article will give you some ideas: [url]http://www.developer.com/java/article.php/893471[/url] | |
Re: $20 flat to whoever referred the most and it's probably over by now since the post is several months old. | |
Re: [QUOTE=wedunnit;855059]I do not understand the way in which an array of type string can be associated with int values and double values in order for calculations, and therefore displays, to be credited correctly. Any help or insight would be greatly appreciated.[/QUOTE] I'm not certain that I understand your question exactly, … | |
Re: Yes, take a look at [URL="http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html"]ProcessBuilder[/URL]. | |
Re: DaniWeb is an IT-related discussion site, not a site for "rants/debates/etc". The Geeks Lounge, which is just one of the forums of many, would be the only appropriate place for such postings. Perhaps a perusal of the [URL="http://www.daniweb.com/forums/faq.php"]FAQ[/URL] would be useful. You'll find little in the way of sticky threads … | |
Re: And what is your question? That's just a homework assignment you posted. | |
Re: You can clean it up a bit manually and save it as a bmp or png, but you can't just "unsave" the unwanted pixelation because it is now part of the image. | |
Re: You can view all of your reputation from the User Control Panel. Click the link for Latest Repuation Received. | |
Re: Try this instead[code=php]function checkValues($postValues) { $valid = true; foreach($postValues as $key => $value) { if(!isset($key) || $value == "") { $valid = false; } } return $valid; }[/code]Edit: Noticed that the && should be || | |
Re: And if you don't like having to type so much to yell at the noobs, the [URL="https://addons.mozilla.org/en-US/firefox/addon/1347"]Clippings add-on[/URL] for Firefox can it effortless :) | |
Re: I would recommend making a class to represent those items that appear in the list. The toString() method of that class should return the description you wish to see in the list. On selection, you can access that object through getSelectedValue() and read the image path from that object. HashMap … | |
Re: You haven't set any bounds for the 'welcome' panel before you add it. | |
Re: You need to actually add 'dx' and 'dy' to the existing values of x and y. You have set them equal instead of adding. Also, your constructor needs to set the values of your property variables equal to the parameter values that were passed. Your current constructor does not do … | |
Re: So post your current code and explain exactly what you are having trouble with, as you were told above. This is not a "code by request" forum. | |
Re: Though it has nothing to do with your local job market: [URL="http://langpop.com/"]Programming Language Popularity[/URL] | |
Re: Looks like you already have instructions right there. So start coding and post it up when you have problems or specific questions. "Send me a code to do my homework" is not a specific question. | |
Re: You're trying to access element 43 of a vector that only contains 2 elements. Also, this code[icode]opVect.removeElementAt(opVect.lastElement());[/icode] is using an object parameter, lastElement(), instead of an int index parameter for removeElementAt(). You are doing that in several places and really the only reason it even compiles is a nuance of … | |
Re: Well, Beck has really gone off the deep end lately so I wouldn't pay much attention anything he was screaming at this point. | |
Re: It's also promotion of your own software, which is against the rules of the forums. | |
Re: Here's the simplest example I can piece together of a listener (which is an observer). You've used it quite a bit in Swing and I'm sure you will recognize the elements immediately[code=java] import java.util.ArrayList; import java.util.List; public class mainTest { public static void main(String[] args) { Model model = new … | |
Re: We're just a blip in the timescale so far. The dinosaurs were dominant for ~160 million years. The [I]Homo[/I] genus only has about 2.5 million under its belt so far and I don't think that I would bet on even seeing 3 million. | |
Re: This [code]java.lang.ArrayIndexOutOfBoundsException: 1[/code]means your code tried to access element index 1 of an array that has less than 2 elements. This line [code]HighScoreManager.readHighScores(HighScoreManager.java:22)[/code]shows that it occurred on line 22 of HighScoreManager in the readHighScores method. So check your array access there. | |
Re: Well, your class doesn't actually implement Comparable and your syntax in the declaration of the comp() method is a bit off. Perhaps looking over this article on generic types which shows a Comparable implementation would help: [url]http://www.onjava.com/pub/a/onjava/excerpt/javaian5_chap04/index1.html[/url] | |
Re: This loop is only executing the single line after it for one thing[code]for ($j = 0; $j < mysql_num_rows($result); $j++) $i=0;[/code]There are no braces for the larger block. |
The End.