889 Posted Topics

Member Avatar for jellyfish888

When the user inputs the numbers, you will have a String. Take a look at the API for the StringTokenizer class - I think you will see that this will be a useful class to separate the numbers (called tokens) by the commas (separators). Hope this has given a hint …

Member Avatar for darkagn
0
444
Member Avatar for curt22

I think you might be better off listing your GUI components outside the methods. You still initialise your components inside the swingMenu method, but doing it this way gives global access within the class. For example, [code=java] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class SwingMenu implements ActionListener{ JMenuBar menuBar; …

Member Avatar for parthiban
0
121
Member Avatar for energizer100

The only problem I can see is that your division is an int / int which is always an int. For example, 10 / 4 is 2 (not 2.5). In order to fix that you will need to cast the result to a double or float by doing the following: …

Member Avatar for bops
0
124
Member Avatar for neow

Hi neow and welcome to Daniweb, I'm not sure what you meant by the statement: [QUOTE=neow;496269] my problem is how can i compute the operands that i inserted. [/QUOTE] Do you mean how do you get the operands from the user input? Or are you asking how to compute the …

Member Avatar for neow
0
108
Member Avatar for gaowei

[code=java] for (int s:a) [/code] is shorthand for [code=java] for (int s=0; s<a; s++) [/code] in Java. I'm not sure if you can use printf statements like the ones you have there though - that's a C++ thing.

Member Avatar for darkagn
0
83
Member Avatar for mentallybroken

The Math.abs function returns the absolute value of the number passed in as a parameter. Check out the java API for more information.

Member Avatar for mentallybroken
0
115
Member Avatar for RoOose
Member Avatar for aan@ucsc

I think masijade was talking about the method [code=java] Integer.parseInt(String s, int radix) [/code] Check out the API for this static method which parses a String s to an Integer value in the base radix.

Member Avatar for aan@ucsc
0
98
Member Avatar for darkagn

Hi all, I was wondering what everyone thought were the most influential computer games of all time? It doesn't matter what platform, but I thought I'd break it down into genres, so here are some that I thought might be considered: First Person Shooter: Unreal Tournament / Doom Real Time …

Member Avatar for Jicky
0
254
Member Avatar for The Dude

[QUOTE=MidiMagic;481923]Here they are: THE ANSWERS: 19. What is the largest island in the world? Greenland. [/QUOTE] Australians are very proud of the fact that our mainland is roughly three times the size of Greenland and is in fact an island, being completely surrounded by water. Greenland is the second largest …

Member Avatar for MidiMagic
0
99
Member Avatar for Shiv_Aptech

What don't you understand about Exceptions and Threads? They are two pretty broad topics so please try to be more specific and we will try to help :)

Member Avatar for majestic0110
0
42
Member Avatar for deepu28

I think this error occurs when you haven't properly defined your class and often it is that the class name and file name are different. Please post your code (using code tags) so we can give you a more specific solution.

Member Avatar for masijade
0
67
Member Avatar for boyz

Hey there satya5321, You have answered a couple of threads in the Java forum today that have already been fairly well finished and are over three weeks old. Please check the date of the last post before replying to a thread. Cheers, darkagn

Member Avatar for darkagn
0
89
Member Avatar for RoOose

[code=java] for (i = intArray.length-1; i>=0 ; i--) { // sort at end of list for (j = 0 ; j < i ;j++) { // "bubble" the largest value to the end if (intArray[j] > intArray[j+1]) { // compare each element to the next one temp = intArray[j]; // …

Member Avatar for RoOose
0
133
Member Avatar for pizzazzman2000

I'm a bit skeptical that a trainer would assign a newbie to java such a large scale project with four days to complete it (in J2EE no less!)

Member Avatar for jwenting
0
138
Member Avatar for xeption12

One advantage of lists that I can think of is that it is often easier to rearrange the data in a list because you are working with pointers. That is, if you have a list of objects and you want to change the order of the data, you can simply …

Member Avatar for Jishnu
0
109
Member Avatar for satya.vijai

It might pay to repost this question in the "Shell Scripting" forum if you want to specifically use a batch script to do this. Someone there may be able to help. Good luck, darkagn

Member Avatar for Ancient Dragon
0
69
Member Avatar for peeta

I haven't used a mac for quite some time so I could be wrong, but don't most macs come with g++ these days? You can use it from your Console utility and should be a sufficient compiler for a starter programmer.

Member Avatar for darkagn
0
89
Member Avatar for PC-Thug

Hi and wecome fellow Aussie! (We are slowly taking over Daniweb) <insert evil laughter> :D

Member Avatar for darkagn
0
69
Member Avatar for Nige Ridd
Member Avatar for sparksterz

Hi namitiet07 and welcome to daniweb, Did you have a question regarding this thread?

Member Avatar for jwenting
0
147
Member Avatar for RichardBlank

Hi Richard and welcome! I travelled to Costa Rica this time last year with my wife and fell in love with the country. We were in San Jose for Christmas and saw the Tope festival. I loved Manuel Antonio, Samara, Monteverde, Isla Tortuga... I could go on for hours :)

Member Avatar for RichardBlank
0
134
Member Avatar for scholly

Welcome scholly! It is always good to welcome a fellow aussie to this forum :)

Member Avatar for jasimp
0
84
Member Avatar for leroi green

Well for starters you are calculating the area and perimeter of a circle rather than a triangle. Not that you are actually calling these methods though. Also your OR and AND statements in the if-statement in your getType() method needs || and && rather than | and &. And you …

Member Avatar for javaAddict
0
276
Member Avatar for majestic0110

Maybe you could create a fairly simple Score class that records the player's name and score, and use an ArrayList of Score objects to record the order of high scores. Then to display them, possibly use a JDialog or JOptionPane? Check out sun's tutorial on using dialogs for more info …

Member Avatar for majestic0110
0
143
Member Avatar for cbalu

Hi cbalu, Do you know what a the difference between a static and non-static method is? Do you know what an interface is? Let me know your thoughts and I will try to help from there. :)

Member Avatar for darkagn
0
105
Member Avatar for slayer10

Yes, instead of Object job; put Employee job; This will allow you to create any Employee or child-class. This is called polymorphism and is a fundamental concept of Object Oriented programming. Google 'polymorphism in java' for more info.

Member Avatar for javaAddict
0
110
Member Avatar for Ancient Dragon

I like the solved threads count. But maybe as a compromise the moderators/administrators of daniweb could have this info removed from their profiles? After all, they are moderators so we all know how good they are ;)

Member Avatar for jbennet
0
242
Member Avatar for ceyesuma

Because you have not initialised i in that method. You do in the method before it, but i is outside that scope when you actually use. Also, the same can be said for the variable z.

Member Avatar for darkagn
0
179
Member Avatar for dci0705

I'm not sure about source code, but you might find some algorithms by searching in google.

Member Avatar for jwenting
0
31
Member Avatar for joshSCH

The Oxford Dictionary defines racism as: [quote] [B]1 a[/B] a belief in the superiority of a particular race; prjudice based on this. [b]b[/b] antagonism towards other races, esp. as a result of this. [b]2[/b] the theory that human abilities etc. are determined by race. [/quote] IMHO Josh's discussion, entitled [I]Race …

Member Avatar for happygeek
0
783
Member Avatar for Ravenous Wolf

On the topic of climate change, Australia's new Prime Minister, Mr Kevin Rudd, has promised to ratify the Kyoto Agreement as one of his first orders of business. This means that the US is the only developed nation to refuse to sign. What is truly ironic is that the US …

Member Avatar for EnderX
0
183
Member Avatar for jackskell26

Ah I just realised that you are not actually calling the eatDot() method anywhere in your code. I think it should probably be called immediately before the call to repaint()...

Member Avatar for jackskell26
0
126
Member Avatar for tactfulsaint

Set the text for a JLabel at the bottom of the GUI to be the following String: [code=java] java.util.Date currentDate = new java.util.Date(); String date = currentDate.toString(); [/code]

Member Avatar for tactfulsaint
0
156
Member Avatar for jackskell26

I think I would do something like this in your Dot class: [code=java] private boolean eaten = false; // call this next method to set the Dot to eaten public void setEaten(boolean beenEaten) { eaten = beenEaten; } // call this next method to check if the Dot is eaten …

Member Avatar for jackskell26
0
210
Member Avatar for Aprilia

Why do game developers put the option to cheat in their games anyway? To me it seems like a pointless exercise to play a game and cheat while doing it but maybe that's just me...???

Member Avatar for MattEvans
0
188
Member Avatar for zandiago
Member Avatar for piers

Hi piers, The problem is that you posted a huge chunk of code that any of your fellow students could copy easily by searching for "scanner" in google. I think that is what the person is implying (possibly one of your professors?) Next time maybe just post the relevant code?

Member Avatar for iamthwee
0
98
Member Avatar for superjacent

Greetings fellow Australian. I too am interested in GUI design, although for me it is "Java or bust". I have dabbled in C++ but I find its nuances a little strange :S Anyways nice to meet you and hope to talk to you soon in DaniWeb! Cheers darkagn

Member Avatar for superjacent
0
90
Member Avatar for sania kohli

Not to mention this thread was nearly 18 months dead. If you need help, please start a new thread rather than resurrecting something so ancient...

Member Avatar for darkagn
0
433
Member Avatar for Black Box

Hi Black Box, I've read a few of your posts and am impressed with your knowledge (of Java particularly). Cheers darkagn

Member Avatar for darkagn
0
70
Member Avatar for Oreynid

I'm pretty sure this should work: [code=c++] char c; cin >> c; [/code] I haven't tried it, but it only allows for a one character input I think...

Member Avatar for Salem
0
10K
Member Avatar for newbieGirl

First, move the calls to numFactors to your main method. Second you need to implement the numFactors method which you can do by [code=java] for (int i=1; i<=n/2; i++) // since any num > n/2 is not a factor { if (n % i == 0) { // i is …

Member Avatar for darkagn
0
479
Member Avatar for enes

A mouse listener can provide you with the x, y coordinates when the mouse is clicked and you can use these coordinates to check against your map to see which division was clicked on.

Member Avatar for darkagn
0
103
Member Avatar for Cole

A Lizard is a Reprtile which is an Animal. Therefore, a Lizard is an Animal. So I would say yes to your question. If you disagree, please discuss.

Member Avatar for darkagn
0
65
Member Avatar for tdizzle342

Hi rheyang16 and welcome to daniweb, There are a couple of things to consider when posting - first this thread is 18 months old and your statement has nothing to do with the topic. Second, you have to be more specific - what do you mean by "i don't sometimes …

Member Avatar for darkagn
0
162
Member Avatar for darkagn

I received the following email the other day and thought it was worth sharing. I chuckled but maybe it's just my stupid sense of humour... :twisted: ----------------------------------------------------------------------------------------------- Are you male or female? Look down... I said look down not scroll down!!!

Member Avatar for MidiMagic
1
136
Member Avatar for siri_lito

Hi siri_lito, The rules of this forum are that you need to show an attempt before we can point you in the right direction. What have you done so far?

Member Avatar for swetha321
0
70
Member Avatar for alexasmith

What error are you getting? Or is it just a logic error somewhere? Nothing really stands out, but if you can describe how it isn't working I might be able to find something...

Member Avatar for alexasmith
0
173
Member Avatar for sherwood12

[QUOTE=sherwood12;470172][CODE] int create_pascals(int a, int b) { /* This section of the code is checking to make sure that the two parameters passed into the function are non-negative and that a is larger than b. Otherwise we exit straight away. */ int cons = 1, row; if (a< 0|| b<0|| …

Member Avatar for sherwood12
0
120

The End.