3,927 Posted Topics
Re: Please, use [noparse][code] [/code][/noparse] tags around any code that you post - after 22 posts here you should be aware of that by now. Edit: You can put code tags in your post above by clicking "Edit This Post", "Go Advanced", highlighting the code part and clicking the "#" (Wrap … | |
Re: If you are just starting to learn Java, trying to jump into a graphic game is going to push you very far into deep water without a grasp on basic fundamentals. That said, you could take a look at a few of these links: [url]http://www.gamedev.net/reference/articles/article1262.asp[/url] [url]http://javaboutique.internet.com/tutorials/Java_Game_Programming/[/url] [url]http://www.planetalia.com/cursos/index.jsp[/url] | |
Re: Then you have a bit of studying to do, because that is the heart of the homework assignment. If you need help with homework, you'll need to get a little further than this on your own. | |
Re: Just call [icode]mattsAccount.getBalance()[/icode]. | |
Re: You need to concatenate the string with "+". [icode]outputLabel.setText ("According to your requirements, I would recommend a "+pet);[/icode]. Your current statement is being read as a call with 2 parameters. | |
Re: The general guideline is to write the code in the clearest, most effective way and worry about optimization only if poor overall performance and code profiling warrant changing it. That said, if you're using the result of a calculation more than once you should probably store it into a variable … | |
Re: Did you try adding the validate() call as suggested? Did you read the api documentation on that method in the link that masijade posted? Learning to take advantage of the documentation available is one of the most important things to programming in any language. | |
Re: [QUOTE=nireekshan;572997]hai i am nireekshan; i am using Mysql 5.0; it was instaling C:\Program Files\MySQL; i am write code Bellow see and --save c:\ "Mysqlcon.java " in this program run-in commend Fromt> javac Mysqlcon.java It was NOT Any Errer; >java Mysqlcon ERRER ACCERED.......CLASS NOT FOUND EXPATION //I AM COPY Mysql.jar file … | |
Re: Post the runtime errors that you are getting. | |
Re: You should be able to set the timeout with this method prior to any calls to getConnection: [URL="http://java.sun.com/javase/6/docs/api/java/sql/DriverManager.html#setLoginTimeout(int)"]DriverManager.setLoginTimeout(int)[/URL] | |
Re: Oh, I'm sure someone probably could, but that's not really the purpose of this forum. What effort have you made to learn anything about it on your own? Have you searched for any tutorials on it? Have you tried them? If you have specific questions, ask them, but "send me … | |
Re: Please see the Announcement regarding homework help: [url]http://www.daniweb.com/forums/announcement9-2.html[/url] If you have a test on arrays then you probably covered them in class. Time to crack the book and review your notes. If you have specific questions about some things that are giving you trouble, post the code you have along … | |
Re: If you are using java 1.5 or above, the java.awt.Container class (which pretty much every Swing UI component extends from in it's hierarchy) has a method [URL="http://java.sun.com/javase/6/docs/api/java/awt/Container.html#setComponentZOrder(java.awt.Component,%20int)"]setComponentZOrder(java.awt.Component, int)[/URL] that you can use for this. | |
Re: Not seeing the other methods that might be involved with painting it's difficult to say with certainty, but the need to start the animation and then draw more things and repaint seems like trouble. Obviously the animation loop is repainting, so it shouldn't be necessary to call repaint again after … | |
Re: [QUOTE=abhi287;565156]HI I m using excel as a database...[/QUOTE] Bad idea. Use a real database if you need a database. | |
Re: Here is a place to start: [url]http://java.sun.com/docs/books/tutorial/2d/index.html[/url] (Assuming you mean drawing graphs, not graph data structures) | |
Re: They are in different packages, so you need to import those classes or put them in the same package as the inventory class. | |
Re: The Sun tutorial should cover it pretty nicely: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html[/url] Keep that Swing tutorial trail bookmarked because there is a wealth of info and demo code on using the various components. | |
Re: If you have the jdbc driver jar for Oracle, the best place to start is with the Sun tutorial on jdbc: [url]http://java.sun.com/docs/books/tutorial/jdbc/index.html[/url] | |
Re: That is part of the "Commons-lang" jar, you can probably figure out where it's residing by looking in your library references in Eclipse. | |
Re: [QUOTE=Dio1080;564250]ok, i need help adding to a list after the list have been made. Its the only thing stopping me from getting this thing done, help please.... [CODE] import java.util.Scanner; import java.io.*; import java.util.*; public class Dairy { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String[][] … | |
Re: If by "help here" you mean "write this for us", then no, I'm afraid not. See the Announcement at the top of the forum regarding homework help: [url]http://www.daniweb.com/forums/announcement14-2.html[/url] | |
Re: No one here is going to answer your test for you. | |
Re: You might look at [URL="http://www.jedit.org/"]jEdit[/URL]. Source code is available and it also supports plug-ins. You may be able to do the work as a plug-in instead of trying to modify the source itself. | |
Re: While not really being "infinite", [ICODE]while(true) { }[/ICODE] loops are seen fairly often in concurrent processes for things like polling for tasks in a work queue. They execute in a try-catch block for InterruptedException and that provides the mechanism for shutting them down gracefully. | |
Re: The only way that you would be able to set the system time is through JNI calls to the OS. | |
Re: You might want to take a look at the free online book [URL="http://www.faqs.org/docs/think_java/TIJ3_c.htm"][I]Thinking In Java, 3rd Edition[/I][/URL]. It is a bit dated since it doesn't cover any of the Java 1.5 or 1.6 changes, but the language basics are still solid and you'd probably find it a good reference for … | |
Re: [QUOTE=darkagn;561329]...I am using the java.awt.Graphics.drawString and drawImage methods to draw each part of my object. If I have set my graphics component's font to have a size of 12 say, does this mean that each character takes up 12 x 12 pixels?[/QUOTE] No, it's a little more complicated than that, … | |
Re: I don't really understand why you are striping the data into those arrays quite like that (if I'm even reading your intent correctly), but I guess that's beside the point. I'd recommend keeping a 12 element array of the values you have read from the file, place the "input" values … | |
Re: Well, Calculator actually uses Fraction, so really Fraction should be an inner class of Calculator if you have to combine them. | |
Re: Your classes should provide methods to access the information that is needed. To call those methods, you need a reference to an instance of that class. I'd recommend reading through some of this material [url]http://www.faqs.org/docs/think_java/TIJ304.htm[/url] | |
Re: Compare strings with String.equals(), not the "==" operator.[code]user.equals("admin")[/code] or if you want to avoid null pointer issues[code]"admin".equals(user)[/code] | |
Re: The JDK does come with the JRE bundled in and no, I don't believe you can get just the JDK portion by itself. | |
Re: Between the built-in help, the Start Page (Help > Start Page), and this tutorial [url]http://www.netbeans.org/kb/60/java/quickstart.html[/url] (which is actually the one that the Start Page takes you to), you should have plenty of documentation available. | |
Re: You can either use a [URL="http://java.sun.com/javase/6/docs/api/java/util/Calendar.html"]Calendar[/URL] and set the day, month, year, time values individually or if you have an existing string date that you need to parse you can create a [URL="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html"]SimpleDateFormat[/URL] and use the parse(String) method to convert it to a Date object. | |
Re: Post the code in CODE tags, the exact error, and what about it you don't understand. | |
Re: Those text fields are in another class. You can't just access private variables in another class. Matchlist shouldn't be setting those values directly anyway. The interface should call methods on MatchList to get results and then set the text in it's text fields as needed. | |
Re: [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]Scanner[/URL] | |
Re: It's an HTTP request to the adserver. Ad blockers prevent that request from being made. | |
Re: I don't see any code to make those calculations, so I guess that is "trouble" you are having? | |
Re: jwenting is correct. That code is only available with a purchased a copy of the Developers Guide and I am sure the author does not want it posted for free. Flagging it a bad post so a mod can delete that code. | |
Re: Is that code in a file called "PublicGarage.java"? This is just a class path issue or a file naming issue. | |
Re: You're better off with the Sun concurrency tutorial [url]http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html[/url]. The one posted above is from 1996 and will not cover any of the recent java.util.concurrent features. For a more thorough treatment on concurrency, pick up a copy of Brian Goetz's [url=http://www.briangoetz.com/pubs.html][I]Java Concurrency In Practice[/I][/url] | |
Re: kooljoycie, javaAddict is correct, you are the student and regardless of your perception of the shortcomings of your university it is still upon you to make the effort to learn. That does not mean asking someone to explain every step of how to do your homework. Also, you need to … | |
Re: Well, you don't say what labels you are having trouble updating, but some things really stand out as a problem. In your constructor[code]JPanel playerpan = new JPanel();[/code]You're defining this as a local variable - not initializing your class level "playerpan" variable. Same with the other panels. This means that you … | |
Re: If you are updating an existing record, you should be using [code]update emp set total=<total> where id=<empId>[/code] You can either concatenate in the values of <total> and <empId> or use a PreparedStatement to set those variables. This means you need to capture whatever you are using for an id on … | |
Re: StringTokenizer is considered a legacy class now and it is recommended to use [URL="http://java.sun.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)"]String.split(java.lang.String)[/URL] or the java.util.regex classes for this now. With split() you could first split on the math operator, giving you the two operand strings, and then spilt those into the whole and fractional strings, and then split … | |
Re: You want to add that action listener to jMenuItem1 instead of jMenu1. Also, you aren't showing the dialog. I would recommend using the static JOptionPane method to show the dialog[code]JOptionPane.showMessageDialog(NewJFrame.this, "You pressed New.");[/code]. | |
Re: What is it doing that confuses you? You need to be more specific in your question. You should also pay more attention to proper indentation, because it will make programming much easier if you can identify code blocks easily. | |
Re: It can't "skip the try". An exception is occurring and you need to figure out what it is. I would recommend putting e.printStackTrace() in your catch block. |
The End.