3,927 Posted Topics

Member Avatar for yellowflashboy

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.

Member Avatar for yellowflashboy
0
110
Member Avatar for CaffeineCoder

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.

Member Avatar for CaffeineCoder
0
148
Member Avatar for RMartins

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.

Member Avatar for RMartins
0
95
Member Avatar for sneekula

[QUOTE=Jicky;493938]people smoking makes me irritated[/QUOTE] So don't go near them.

Member Avatar for reddawg
0
1K
Member Avatar for Techboy52

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.

Member Avatar for ~s.o.s~
0
618
Member Avatar for Shveetis

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.

Member Avatar for Shveetis
0
268
Member Avatar for Zork'nPalls

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?

Member Avatar for Zork'nPalls
0
98
Member Avatar for codefreak2.0

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.

Member Avatar for codefreak2.0
0
104
Member Avatar for beatlea

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 …

Member Avatar for beatlea
0
107
Member Avatar for erementarz

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

Member Avatar for Ezzaral
0
115
Member Avatar for drsmith

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.

Member Avatar for midimatt
0
49
Member Avatar for larslt

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.

Member Avatar for Ezzaral
0
128
Member Avatar for KimJack

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"?

Member Avatar for KimJack
0
100
Member Avatar for debee

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 …

Member Avatar for debee
0
96
Member Avatar for CaffeineCoder

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.

Member Avatar for Ezzaral
0
709
Member Avatar for ntdaycott

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

Member Avatar for Ezzaral
0
132
Member Avatar for sneekula

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

Member Avatar for GrimJack
0
677
Member Avatar for sneekula

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

Member Avatar for GrimJack
0
504
Member Avatar for sneekula

[QUOTE=sneekula;548969]I thought you were much too young to drink alcohol.[/QUOTE] Legal age is 18 in the UK.

Member Avatar for bumsfeld
0
267
Member Avatar for piers

[QUOTE=jwenting;542764]The feeling is mutual Narue, we hate C++ :) C# OTOH looks nice.[/QUOTE] ++

Member Avatar for neocoder
0
350
Member Avatar for MxDev

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.

Member Avatar for Ezzaral
0
54
Member Avatar for oreo_cheesecake

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

Member Avatar for beefstick720
0
949
Member Avatar for nate12457

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]

Member Avatar for jwenting
0
133
Member Avatar for Kob0724
Member Avatar for Kob0724
0
134
Member Avatar for Parsu7

And for that reason, you shouldn't ever throw exceptions from main().

Member Avatar for Parsu7
0
132
Member Avatar for gauravmishra

Scaling the transform does not reduce the size of the Image object itself.

Member Avatar for gauravmishra
0
104
Member Avatar for slayer10

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.

Member Avatar for slayer10
0
82
Member Avatar for maggie789
Member Avatar for maggie789
0
957
Member Avatar for jure.gregorin
Member Avatar for BlackSun
0
140
Member Avatar for StephNicolaou

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 …

Member Avatar for Ezzaral
0
233
Member Avatar for piers

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 :) )

Member Avatar for piers
0
800
Member Avatar for mdelaossa

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 …

Member Avatar for mdelaossa
0
150
Member Avatar for vladdy19

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

Member Avatar for javaAddict
0
168
Member Avatar for tactfulsaint

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

Member Avatar for Ezzaral
0
118
Member Avatar for jasmin_java

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 …

Member Avatar for jasmin_java
0
146
Member Avatar for sugantha

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.

Member Avatar for Ezzaral
0
587
Member Avatar for mevtho

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 …

Member Avatar for mevtho
0
121
Member Avatar for eleonora

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 …

Member Avatar for eleonora
0
227
Member Avatar for Danii

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

Member Avatar for Ezzaral
0
86
Member Avatar for HeroOfTime

You might take a look at [URL="http://java.sun.com/products/java-media/jmf/"]Java Media Framework[/URL]

Member Avatar for Ezzaral
0
137
Member Avatar for AbuShokry

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.

Member Avatar for Ezzaral
0
91
Member Avatar for thunderstorm98

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.

Member Avatar for jbennet
0
121
Member Avatar for ! !

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

Member Avatar for jbennet
0
438
Member Avatar for losh177

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 …

Member Avatar for Ezzaral
0
112
Member Avatar for Shveetis

You can do this easily with a [URL="http://java.sun.com/javase/6/docs/api/javax/swing/Timer.html"]Timer[/URL].

Member Avatar for Shveetis
0
129
Member Avatar for starxxx
Member Avatar for gedcraw555

Try this: [url]http://www.exampledepot.com/egs/javax.swing/button_SetIcon.html[/url]

Member Avatar for gedcraw555
0
133
Member Avatar for the b

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

Member Avatar for stultuske
0
233
Member Avatar for SPJ

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 …

Member Avatar for stultuske
-2
357
Member Avatar for zandiago

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)

Member Avatar for jbennet
0
364

The End.