3,927 Posted Topics
Re: Perhaps you missed this Announcement at the top of forum: [url]http://www.daniweb.com/forums/announcement9-2.html[/url] If you need help with it, you'll need to work up a first try at it or at least ask [U]specific[/U] questions about what portion you do not understand. | |
Re: To load the images you can either use [URL="http://java.sun.com/javase/6/docs/api/javax/imageio/ImageIO.html#read(java.io.File)"]ImageIO.read(java.io.File)[/URL] or [icode]Image image = Toolkit.getDefaultToolkit().getImage("image.gif");[/icode] All the other methods, such as getHeight() and getWidth(), should be available from whatever component you are displaying the image on, such as a JPanel. | |
Re: The 2D graphics tutorial should be enough to get you started: [url]http://java.sun.com/docs/books/tutorial/2d/index.html[/url] Once you see how to paint a simple line or geometric primitive on a frame, you should have no trouble drawing a basic graph of a function. | |
Re: [QUOTE=Jicky;493938]people smoking makes me irritated[/QUOTE] So don't go near them. | |
Re: It would be more useful to see the code with the try-catch block(s) included to know what you have tried. I would recommend a try-catch on the parsing of each arg and in the catch, print the usage and the argument that caused the exception. | |
Re: Invalid SMTP address? Wrong port? Invalid user name? Invalid password? Check those things. Beyond that you will probably have to post some code, since it's hard to see over your shoulder from here. | |
Re: Well, yes, static methods can be called directly on the class by ClassName.methodName(). Is that all you needed to know or is there something more specific to your question? | |
Re: You might want to pick up a copy of Head First Java instead. Any of the "<something> in X Days" books are usually fairly useless. See the Read Me thread at the top of the forum for more resources on getting started with Java. | |
Re: It does work, but what happens when you need to set other values that are specific to the subclasses? Then you have to add more parameters to the constructor and alter all the calls to it. A more flexible way to go about it is to make the maxStrength variable … | |
Re: [QUOTE=erementarz;553590]I guess the logic is fine, since the code runs for cases with less branches. It's just that once branch number exceeds 30 it gives me out of memory error.[/QUOTE] If you are hitting out of memory exceptions at 150 nodes, I would say the logic is [U]not[/U] fine and … | |
Re: As far as Java, check the "Read Me" thread at the top of this forum. For JavaScript, I couldn't say, because they are not the same thing and not used in the same context. You may want to check in the JavaScript forum for that. | |
Re: Same reply as the original on this 3+ year old post: Post your work and the problems that you are having with it. This isn't "Give Teh Codez" central. You have to show some effort. | |
Re: Just to clarify the question, the printing of "Ok" part works fine if the match is found, but you don't want it to also print "not included"? | |
Re: No, not really, because you only posted a fragment of code that cannot be run and your indexes are going to vary at runtime. It's very simple for you to find the problem on your own though. Check your array sizes before you access them. Obviously one of those arrays … | |
Re: You should update the image, repaint, and sleep in a separate thread or a Swing Timer. This animation tutorial might help:[url]http://www.developer.com/java/article.php/893471[/url] The important concept is that the AWT Event Queue needs to be allowed to repaint after you have altered the image. | |
Re: Most likely you are missing a brace or semi-colon somewhere above that line. Check all of your code blocks for proper brace structure and make sure all of your statements have appropriate semi-colons. Also, check your spelling errors in the remove() and update() methods and if you re-post any code, … | |
Re: I'd say use prisoners in giant gerbil wheels then. We certainly have enough of those and it's not like they have better things to do. Let them walk on wheels all day generating electricity. (Edit: Clarification: I refer to convicted criminal prisoners - not people taken prisoner for labor.) | |
Re: [QUOTE]- I am building huge databases about really stupid stuff (e.g. the number of tacos eaten daily in each state) in Access.[/QUOTE] Well, building a huge database for anything in Access does equate to "stupid stuff", so that one should be no surprise. | |
Re: [QUOTE=sneekula;548969]I thought you were much too young to drink alcohol.[/QUOTE] Legal age is 18 in the UK. | |
Re: [QUOTE=jwenting;542764]The feeling is mutual Narue, we hate C++ :) C# OTOH looks nice.[/QUOTE] ++ | |
Re: The Runtime.exec() call will return a [URL="http://java.sun.com/javase/6/docs/api/java/lang/Process.html"]Process[/URL] reference, from which you can get the standard input, output, and error streams. | |
Re: [URL="http://research.sun.com/spotlight/2006/2006-03-20_Darkstar.html"]Project Darkstar[/URL] ([URL="http://projectdarkstar.com/"]Project Darkstar Community - Home[/URL]), developed by Sun Labs, is also taking aim at massive online games on Java. | |
Re: For more information, also see the "Read Me" post at the top of the forum on getting started with Java:[url]http://www.daniweb.com/forums/thread99132.html[/url] | |
Re: [code]String newString = oldString.replace("\\","\n");[/code] | |
Re: And for that reason, you shouldn't ever throw exceptions from main(). | |
Re: Scaling the transform does not reduce the size of the Image object itself. | |
Re: You are probably getting into an infinite loop or recursion that creates a lot of new objects until it's out of heap space. Check your loop conditions or recursive calls and make sure they are terminating as they should. | |
Re: [code]double d = 32.456; System.out.println( (int)d ); System.out.println( d-(int)d );[/code] | |
Re: Take a look at [URL="http://code.google.com/p/aforge/"]AForge.NET[/URL] | |
Re: I assume CircleComponent provides a method to draw to a graphics context? Just creating an instance of CircleComponent won't do anything for you by itself. Painting operations for a component will occur in paintComponent(Graphics). This means that your paintComponent() method is going to need access to that CircleComponent object so … | |
Re: Making those variables "protected" would also allow subclasses to access them. (Of course, that may lead to some design traps by locking your base class into a particular implementation, but I doubt you really have to worry about that in this case :) ) | |
Re: Your best bet is to construct a [URL="http://java.sun.com/javase/6/docs/api/java/awt/geom/GeneralPath.html"]GeneralPath[/URL] with the points from the mouse listener and use the [URL="http://java.sun.com/javase/6/docs/api/java/awt/Graphics2D.html#draw(java.awt.Shape)"]Graphics2D.draw(Shape)[/URL] method to render it. You can append to the GeneralPath as new points are added, so you don't have to even maintain a point collection at all. Examples of this can … | |
Re: [QUOTE=Parsu7;546978]use the following code to convert any string to integer. ...[/QUOTE] That is absolutely [U]not[/U] the way to convert a String to an int. | |
Re: See comments in the code[code=java] import java.awt.*; import java.awt.event.*; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import javax.swing.*; public class HeartLandHomeFinance2 extends JFrame { JPanel Panel; JLabel lb1, lb2, lb3, lb4, lb5, lb6, lb7, lb8, lb9, lb10, lb11, lb12, lb13, lb14, lb15, lb16, lb17, lb18, lb19, lb20, lb21, lb22, … | |
Re: Try using an ActionListener for your buttons instead of MouseListener. The disabled buttons still receive the click event and you don't check whether the game is over. Also, add a repaint() call at the end or your Restart_Game method so the buttons refresh their appearance. I didn't have time to … | |
Re: You'll need to add the jdbc driver jar to your project properties under Libraries. You can access those under the File menu or by right-clicking the project in the Projects window. | |
Re: Notice that the only difference in those pairs of methods is the direction of advance, +1 or -1. If you see that much duplication between methods, chances are you can make them one method. Consider how it might work if you defined[code]final static int LEFT = -1; final static int … | |
Re: VernonDozier is correct, you'll have to read each line separately before attempting to parse its data. StringTokenizer is also considered a legacy class. You should use String.split() or java.util.regex classes instead. You'll need a regex pattern for either one, since your delimiter of ":" also appears in your time values … | |
Re: Your method will need to traverse the sorted linked list and find the appropriate place to insert it. Then it's a standard insertion by updating the "next" pointers so that the previous item in the list points to the new one and the new one points to the next one. … | |
Re: You might take a look at [URL="http://java.sun.com/products/java-media/jmf/"]Java Media Framework[/URL] | |
Re: densman, do not hijack threads to ask unrelated questions. You need to make a new thread for this and you need to post the code that you have to start with. No one is going to just write it for you. | |
![]() | Re: Sounds like an infomercial It is pretty much. This exact post can be found on a few other boards in the last few days. It's a shill. |
Re: [QUOTE=zeroth;152113]I, for one, believe that smoking is not physically addicting. I think it is only a matter of the mind. [/QUOTE] Right and wrong at the same time. It is physically addictive [I]to the[/I] mind, altering the production and response to several neurotransmitters. [url]http://en.wikipedia.org/wiki/Nicotine#Dependence[/url] [url]http://www.nida.nih.gov/researchreports/nicotine/nicotine2.html#addictive[/url] [url]http://en.wikipedia.org/wiki/Tobacco_smoking#Somatic_and_psychological_effects[/url] Withdrawal symptoms are relatively … | |
Re: You don't mention what language(s) you are comfortable with, but you should be able to find some [URL="http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=neural+network+tutorial"]tutorials on a simple neural network[/URL] for something like optical character recognition. This could be a good starting point. They are often used for pattern recognition amongst other things. For other topics you … | |
Re: You can do this easily with a [URL="http://java.sun.com/javase/6/docs/api/javax/swing/Timer.html"]Timer[/URL]. | |
Re: Write some code would be my advice on what to do next. | |
Re: Try this: [url]http://www.exampledepot.com/egs/javax.swing/button_SetIcon.html[/url] | |
Re: [QUOTE=sky100;544213]does anybody have a simple program for player play with comp. and use import Keyboard and Random only?[/QUOTE] You should make a new thread if you have a question, and this is not even a comprehensible question. You'll want to restate it if you do make a thread. | |
Re: Especially given that you said you read the forum rules regarding homework and choose to disregard them and beg someone to do the assignment for you - and you can't even trouble yourself to make an attempt at proper English (That mess you typed is from laziness, not lack of … | |
Re: Mine is just an RPG character screen name I've used many times over the course of several years. And no, I'm not Jewish nor do I play one on TV. (Evidently some think it's a Jewish name) |
The End.