3,927 Posted Topics

Member Avatar for tactfulsaint

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 …

Member Avatar for tactfulsaint
0
125
Member Avatar for Legato256

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]

Member Avatar for Ezzaral
0
127
Member Avatar for Dr Windows (XP)

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.

Member Avatar for Dr Windows (XP)
0
166
Member Avatar for krookedkop
Member Avatar for jimJohnson

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.

Member Avatar for jimJohnson
0
140
Member Avatar for kimbokasteniv

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 …

Member Avatar for kimbokasteniv
0
107
Member Avatar for clook

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.

Member Avatar for masijade
0
103
Member Avatar for nireekshan

[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 …

Member Avatar for nav33n
0
121
Member Avatar for D boss
Member Avatar for echocoder

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]

Member Avatar for echocoder
0
336
Member Avatar for Archana10

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 …

Member Avatar for jwenting
0
74
Member Avatar for sneakerhead724

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 …

Member Avatar for Ezzaral
0
82
Member Avatar for eng.atia

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.

Member Avatar for Ezzaral
0
172
Member Avatar for StephNicolaou

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 …

Member Avatar for StephNicolaou
0
238
Member Avatar for abhi287

[QUOTE=abhi287;565156]HI I m using excel as a database...[/QUOTE] Bad idea. Use a real database if you need a database.

Member Avatar for javaAddict
0
159
Member Avatar for ank_arsenal

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)

Member Avatar for darkagn
0
96
Member Avatar for torbecire

They are in different packages, so you need to import those classes or put them in the same package as the inventory class.

Member Avatar for darkagn
0
102
Member Avatar for spywx2003

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.

Member Avatar for Ezzaral
0
83
Member Avatar for hgedek

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]

Member Avatar for jwenting
0
74
Member Avatar for new_2_java

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.

Member Avatar for new_2_java
0
2K
Member Avatar for Dio1080

[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[][] …

Member Avatar for Ezzaral
0
94
Member Avatar for diggles05

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]

Member Avatar for diggles05
0
879
Member Avatar for sayso36
Member Avatar for algo_man

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.

Member Avatar for Ezzaral
0
80
Member Avatar for majestic0110

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.

Member Avatar for majestic0110
0
157
Member Avatar for ramjeev

The only way that you would be able to set the system time is through JNI calls to the OS.

Member Avatar for ramjeev
0
4K
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
461
Member Avatar for darkagn

[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, …

Member Avatar for darkagn
0
196
Member Avatar for debee

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 …

Member Avatar for debee
0
82
Member Avatar for torbecire

Well, Calculator actually uses Fraction, so really Fraction should be an inner class of Calculator if you have to combine them.

Member Avatar for torbecire
0
122
Member Avatar for rickilambert

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]

Member Avatar for jwenting
0
91
Member Avatar for TofiLuk

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]

Member Avatar for TofiLuk
0
72
Member Avatar for redZERO

The JDK does come with the JRE bundled in and no, I don't believe you can get just the JDK portion by itself.

Member Avatar for VernonDozier
0
102
Member Avatar for KimJack

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.

Member Avatar for Ezzaral
0
128
Member Avatar for new_2_java

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.

Member Avatar for new_2_java
0
131
Member Avatar for hrlygrl923

Post the code in CODE tags, the exact error, and what about it you don't understand.

Member Avatar for VernonDozier
0
164
Member Avatar for rickilambert

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.

Member Avatar for Ezzaral
0
2K
Member Avatar for TofiLuk

[URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]Scanner[/URL]

Member Avatar for Ezzaral
0
45
Member Avatar for mattyd

It's an HTTP request to the adserver. Ad blockers prevent that request from being made.

Member Avatar for GrimJack
0
373
Member Avatar for welbyobeng

I don't see any code to make those calculations, so I guess that is "trouble" you are having?

Member Avatar for Ezzaral
0
96
Member Avatar for null_guy

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.

Member Avatar for null_guy
0
284
Member Avatar for fufu123
Member Avatar for new_2_java
0
152
Member Avatar for monster597

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]

Member Avatar for Ezzaral
0
102
Member Avatar for kooljoycie

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 …

Member Avatar for Ezzaral
0
68
Member Avatar for toomuchfreetime

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 …

Member Avatar for Ezzaral
0
3K
Member Avatar for madhusamala

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 …

Member Avatar for jwenting
0
124
Member Avatar for torbecire

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 …

Member Avatar for torbecire
0
522
Member Avatar for curt22

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].

Member Avatar for curt22
0
116
Member Avatar for fufu123

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.

Member Avatar for Ezzaral
0
114
Member Avatar for matthewc

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.

Member Avatar for Ezzaral
0
85

The End.