7,116 Posted Topics

Member Avatar for cookiejarvus

142: jrbNumBathrooms1.addActionListener(new DisplayButtonListener()); (etc) That's why your radio buttons cause the same actions as the display button

Member Avatar for stultuske
0
199
Member Avatar for subramanya.vl

An immutable class cannot change any of its values after an instance has been created. eg You can make all its variables private, and don't write any setter methods. Immutable classes can be very efficient becuase the code can assume that no value ever changes. The "con" is that if …

Member Avatar for stultuske
0
84
Member Avatar for javaprog200

That's the default output created by the toString method that every object and array inherits from Object. It means [ this is an array B of bytes 44770739 and that is its unique hash value (very precise, and totally useless!) To convert an array to a useful printable string use …

Member Avatar for javaprog200
0
219
Member Avatar for ascyndance6y

> I have considered eventually hiring an experienced programmer to fine tune everything... Software quality (no matter how you measure that) starts with the specifications and is more or less fixed by the design. If the design is good you can deal with any rough code later, if the design …

Member Avatar for ascyndance6y
0
377
Member Avatar for FUTURECompEng

The wikipedia article on quadratic probing starts with a really clear and simple explanation...

Member Avatar for FUTURECompEng
0
243
Member Avatar for ofir.attia.7

What exactly is youer question? There are lots of people here who will freely give their time to help you become the best Java programmer you can be, but there's nobody here who is interested in doing your homework. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for ofir.attia.7
0
324
Member Avatar for ozman26

> I was always under the impression that this forum was to be a source of inspiration and a source for helping others. Yes, indeed it is. But's not a place that does people's homework. We always expect people to show real effort if they want us to give our …

Member Avatar for JamesCherrill
0
205
Member Avatar for caierhui

This is a three year old thread. DaniWeb Member Rules include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules Please start your own new thread for your question

Member Avatar for love1969
0
208
Member Avatar for sofien.fkih

csv is a text file format. What kind of pie chart do you want to add to a text file? If you want a proper graphic pie chart then you will have to use a more capable file format, eg pdf.

Member Avatar for sofien.fkih
0
425
Member Avatar for meenal9

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there.

Member Avatar for meenal9
0
288
Member Avatar for nah094020

Most versions of this seems to be pre-OO indesign, with lots of arrays and no classes. Maybe this is a gmood time to do it in proper OO style? I haven't done this myself, but of I were to try, I would start with a Cell class. That makes it …

Member Avatar for JamesCherrill
0
683
Member Avatar for javaprog200

I can't see where you have added the action listener to the buttons. It would be easy to do that in the Buttons constructor. http://docs.oracle.com/javase/7/docs/api/javax/swing/AbstractButton.html#addActionListener%28java.awt.event.ActionListener%29

Member Avatar for JamesCherrill
0
268
Member Avatar for jg1405
Member Avatar for oneoderja

gavinflud: Here at DaniWeb we try to help people learn Java and develop their Java skills. We do NOT do people's homework for them. In future please help by pointing people in the right direction - eg tell them which classes and methods they should read about, or give them …

Member Avatar for JamesCherrill
0
224
Member Avatar for aravind326

A checksum seems a good idea, MD5 SHA, that kind of thing. Have a look at the[ MessageDigest class](http://docs.oracle.com/javase/7/docs/api/java/security/MessageDigest.html) It's simple to use, but you'll find example code on the web as well.

Member Avatar for JamesCherrill
0
127
Member Avatar for Zubenna

radhakrishna.p Here at DaniWeb we try to help people learn Java and develop their Java skills. Your post explains and teaches nothing. In future please help by pointing people in the right direction - eg tell them why their code is going wrong, or which classes and methods they should …

Member Avatar for Zubenna
0
877
Member Avatar for tingwong

@subramanya: This is an exercise in the use of generics. All you have done is to remove the generics from his code.

Member Avatar for JamesCherrill
0
340
Member Avatar for komabasi

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there.

Member Avatar for subramanya.vl
0
479
Member Avatar for tsegaighere

Animation in Java is pretty straightforward, good fun, and can work really well, at least in 2D. There's great scope for modelling physics - gravity, friction, things bouncing off each other... See also http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners

Member Avatar for rotten69
0
336
Member Avatar for joshmo

DaniWeb Member Rules include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules Please start your own new thread for your question

Member Avatar for JamesCherrill
1
1K
Member Avatar for nseeley3

Welcome, and we all wish you great success with your project. Without knowing more about your current level of expertise its hard to offer relevant advice, but maybe these two mantras will add to the obvious O.O. stuff... *Test early and test often.* Depending on your experience level try to …

Member Avatar for subramanya.vl
0
246
Member Avatar for jsp418

You can use a static counter variable in any class to see how many you have created - just increment the counter in the class's constructor, eg class Demo { static int counter = 0; public Demo() { ... normal constructor code counter++ } Then you can use that like …

Member Avatar for subramanya.vl
0
205
Member Avatar for nickcolb

It depends on whether the methods in myFunctions are static or not. (They probably should be static). If they are static you call them with the class name, eg `myFunctions.sin` If not, then see radhakrishna's post above. ps Java naming comventions: class names should begin with a capital letter

Member Avatar for radhakrishna.p
0
225
Member Avatar for aabbccbryanmark

Like it says, there is no sort method in the Arrays class that takes an int[] and a Comparator as parameters. Why did you think that there was such a method?

Member Avatar for Ezzaral
0
133
Member Avatar for slimergan

Sparate GUI and model logic to avoid one gigantic sphagetti of code. Develop the simulation logic (model) first, testing it with simple hard-coded test case data and print statements. When it's working add the GUI. Sprite animation sounds appropriate, each sprite can be linked to a Vehicle in the simulation …

Member Avatar for JamesCherrill
0
102
Member Avatar for MistaGeorge

The answer depends on how the four classes are related. Do any extend any others? Do the other three have a reference to the fist class instance?

Member Avatar for NP-complete
0
131
Member Avatar for DEAD TERMINATOR

All of your drawing code MUST be in the paintComponent method. That's the only place where you have access to the correct Graphics environment, and where Swing will handle the changes to the Graphics properly. All you can do in your mouse listener(s) is to update some variables that keep …

Member Avatar for DEAD TERMINATOR
0
320
Member Avatar for TheMrPatrick

1. Your Peson instance needs reference to an instance of Basket, eg Basket myBasket = new Basket(); then you can call its voegToe method to add an Article, eg myBasket.add(new Article(some suitable parameters));

Member Avatar for NP-complete
0
563
Member Avatar for myadav

See http://javarevisited.blogspot.fr/2011/05/example-of-arraylist-in-java-tutorial.html

Member Avatar for myadav
0
372
Member Avatar for hwoarang69

Thread sleep isn't a good way to go, the Java API includes Timer classes that you can use to schedule updates to your animation at regular intervals. The paint looks OK. Here's the simplest possible runnable example of a good approach import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Animation0 …

Member Avatar for JamesCherrill
0
257
Member Avatar for Atlanta15Braves

Obviously you can't run the program if it didn't compile! When you ***compiled*** the program it found an error and will have given you a detailed error mesage explaining what was wrong. What did that say?

Member Avatar for subramanya.vl
0
385
Member Avatar for joe.crook.9

What happends if hint is none of low/high/correct? It executes none of your return statements and drops down to line 17 without returning an int.

Member Avatar for stultuske
0
176
Member Avatar for devindra.storm

Does your classpath include the directory with the same name as the top-level package?

Member Avatar for devindra.storm
0
165
Member Avatar for francoiscx

Is this a question about using the Java programming language (not Javascript)?

Member Avatar for JamesCherrill
0
80
Member Avatar for WaltonPan

Line 12 you appear to be trying to declare a new int inside the switch - obviously an error. Anyway, each case looks like switch (index) ... case n: if (index == (n-1)) ... so you can guarantee that every if test will be false and nothing will ever be …

Member Avatar for aravind326
0
248
Member Avatar for Maritha33

Just look on the web. You will find many tutorials on classes and objects. It's not realistic to expect someone here to write a new tutorial just for you. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself …

Member Avatar for JamesCherrill
0
329
Member Avatar for kbondarchuk

A small point: although the declaration syntax `int arr[]` is perfectly valid, most standards prefer the form `int[] arr` That's the form you will find throughout the Java API source code. The reason is that arr is an array of ints, as implied by the second form. The first form …

Member Avatar for JamesCherrill
0
213
Member Avatar for nazmule27
Re: NULL

In Java you have variables and expressions that refer to objects or arrays. "null" is the special value for those variables or expressions that have not been initialised to refer to a real object or array - it means that they refer to nothing. eg `String s;` declares a variable …

Member Avatar for JamesCherrill
0
133
Member Avatar for jlemieux

> you can't make for loop that will run for given double variable,you can't say that your loop executes 4.7 times..so in for loop there is only integer variable you can put. Sorry, that's not true. There's absolutely no problem using a double for a loop variable like that, as …

Member Avatar for jalpesh_007
0
273
Member Avatar for johndy.maghanoy

You can't "replace it with null string" in an int array. For int arrays all you can do is to chose some value to represent elements that do not have a user value in them. Integer.MIN_VALUE could be a good choice.

Member Avatar for jalpesh_007
0
99
Member Avatar for almondjoy

The standard compiler is javac.exe which is part of the [JDK download](http://www.oracle.com/technetwork/java/javase/downloads/index.html) But if you have been using Eclipse maybe you should download the latest version and carry on. Eclipse is definitely a full industrial-strength piece of software, and doesn't break easily.

Member Avatar for jalpesh_007
0
106
Member Avatar for System Networks

You haven't had any answers yet. That's probably because the question is too vague. Try to explain exactly what you are trying to do, what code you have tried, what error messages you have got etc.

Member Avatar for jalpesh_007
0
281
Member Avatar for davkam

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for jalpesh_007
-1
210
Member Avatar for ashsha

Assuming the inner polygons have their coordinates defined in the same frame as the outer one (as ooposed to being relative to the outer polygon) then all you need to do is to apply the same absolute transform you used on the outer polygon's coordinates

Member Avatar for Taywin
0
395
Member Avatar for AngelOfRock
Member Avatar for tabmanmatt

You will go round the while loop up to 3 times, and you need a new roll of the dice each time, so the` nu = 1+ rollOne.nextInt(12);` must be insde the loop. ps: that line is not an accurate model of rolling two dice. There's only one way to …

Member Avatar for JamesCherrill
0
277
Member Avatar for stopah2008

Daniweb member rules include "Do ensure that all posts contain relevant content and substance and are not simply vehicles for external links" We also discourage people from simp/ky posting complete solutions.In future please help by pointing people in the right direction.

Member Avatar for JamesCherrill
0
257
Member Avatar for M-rhodes

You have not explained how you would like the panel laid out - you just said that centrally aligned is a "problem". Nobody can tell you how to write the code for an unknown layout! ;)

Member Avatar for JamesCherrill
0
223
Member Avatar for Violet_82

The Random class is a random number generator. It can generate all kinds of random values, eg ints, gaussian distributed doubles, arrays of random bytes etc. new Random() gives you a new random number generator - not a randon number, but a random nunber *generator*. You then use that to …

Member Avatar for Violet_82
0
204
Member Avatar for histrungalot

First a point of terminology: there's no such thing as an "anonymous outer class". Only inner classes can be anonymous. Anyway, "yes" to both your questions. You have to create an instance of the outer class before you can create an instance of the inner class (unless the inner class …

Member Avatar for histrungalot
0
176

The End.