7,116 Posted Topics

Member Avatar for wids101

EXACTLY what code are you executring and EXACTLY what is thet COMPLETE error message? ps Did you intend that line 9 will create a *new* "NumberArray" variable? The NumberArray that you initialise in setNumberArray isn't the one declared on line 5!

Member Avatar for wids101
0
156
Member Avatar for shaquib65

You can use `System.setOut(PrintStream out)` to send all your console output to a file instead of the console, without having to change any other code.

Member Avatar for shaquib65
0
219
Member Avatar for anku83

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 JamesCherrill
0
120
Member Avatar for Goldfinch

That's not enough info for anyone to understand where or why you are having difficulty. How far have you got - is there any code or documented design yet? Have you got as far as pushing each non-terminal node onto a stack and popping it when you finish processing its …

Member Avatar for iamthwee
0
197
Member Avatar for sammy1231

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 JamesCherrill
0
142
Member Avatar for Pyler
Member Avatar for JamesCherrill
0
261
Member Avatar for XodoX

> To access the kangaroos, you simply use getKangaroos(). What exactly does that return - is it a Kangaroo object? If so, what attributes/methods does that support?

Member Avatar for JamesCherrill
0
181
Member Avatar for MatthewYeend

You need to create some `new` instances of TelephoneDirectory, then use them to call all the methods and print the results to see if they are correct. ps: TelephoneDirectory is a very bad name for this class. Instances of the class represent single entries in some directory. A class called …

Member Avatar for JamesCherrill
0
278
Member Avatar for santi.ayasamy

So there we have 698 lines of highly technical code with zero useful comments and no specification, and we are supposed to know why it doesn't do what you expect. You *may* be lucky, but I suspect that you are looking for far too much work from us here.

Member Avatar for JamesCherrill
-1
525
Member Avatar for Doogledude123

I tried your fxml file in Netbeans/Java8 and it loaded OK and diplayed a (slighly wonky) calculator-type screen. No errors. Maybe you have an old version, or a mismatch between the layout editor and the compiler versions???

Member Avatar for Doogledude123
0
999
Member Avatar for brittney_2

It looks like the problem is with the arrays you are using, noy how you print them. You create a 2d memberNames array that looks like it should have one row for each family and member names for that family in the row, but its an array of ints, not …

Member Avatar for Steve_O
0
244
Member Avatar for Doogledude123

Here's a less esoteric example that is used all the time in image processing... a common way to store a pixel is an a 32 bit int, with the red, green and blue values each occupying one byte of the int. Here's how you extract those values: int r = …

Member Avatar for Doogledude123
0
186
Member Avatar for anand01

stultuske was right until last month. The latest version of Java (Java 8) allows static methods and "default" instance methods to be defined in interfaces, which are inherited by any class that implements the interface.

Member Avatar for jwenting
0
184
Member Avatar for Ndey yassin

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's an insult to the many people who give their time to help others here. There are lots of people here who will freely give their time to help you become the best Java …

Member Avatar for JamesCherrill
-3
124
Member Avatar for sasikrishnasamy

Strings are supported as a special case in the compiler and are very highly optimised. The fact that they are immutable allows all kinds of optimisations that are not possible for mutable objects, especially in a multi-threaded environment.

Member Avatar for jwenting
0
122
Member Avatar for anand01

APU doc says > public boolean add(E e) > > Adds the specified element to this set if it is not already present. More formally, adds the specified element e to this set if this set contains no element e2 such that (e==null ? e2==null : e.equals(e2)). If this set …

Member Avatar for JamesCherrill
0
234
Member Avatar for LegendX
Member Avatar for romdan94

Spend what time you do have learning about arrays and forget trying to finesse extra credits. If you don't understand arrays you certainly won't get any further anyway.

Member Avatar for JamesCherrill
0
256
Member Avatar for nhrnjic6

For OS internals, drivers etc C++ definitely. Java is for applications - it deliberately isolates you from all the low-level OS stuff.

Member Avatar for deceptikon
0
505
Member Avatar for Manu_5

"might exist in the JavaFX APIs but I don't have those installed here" That's very worrying from a security viewpoint. JavaFX is included with Java 7 update 6 and all later versions.

Member Avatar for jwenting
0
846
Member Avatar for syasya

a and b are reference variables. The == operator for references tests if those two references are equal - ie that they both refer to the same object. Read the API doc for the String class, specifically its `equals` method.

Member Avatar for jwenting
-1
604
Member Avatar for michelle.trinsky

That implies that `last` is null when that line is executed, as only the `last.next` expression will generate an NPE. That would be the case if the while loop on lines 44-48 was executed zero times (and maybe under other circumstances as well).

Member Avatar for stultuske
0
1K
Member Avatar for syasya

Did you execute that code? I thought not. Try running it - it *does* generate the output `they are equal` It looks like you are asking the wrong question.

Member Avatar for hannahaddad
-2
112
Member Avatar for syasya

Just google for it. The WikiPedia article on "event driven architecture" has a section specifically about Java Swing GUIs

Member Avatar for JamesCherrill
0
114
Member Avatar for vincecamha

Start a loop Print the menu using System.out.println Get the user's input using a Scanner if the input was "exit" then break out of the loop use a switch to invoke the appropriate action (end loop) See http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html

Member Avatar for vincecamha
0
454
Member Avatar for Aman_5

Java support for media has beena shambles inthe past - JMF never worked properly. The good news is that JavaFX is now a standard component in all the current versions of JavaSE. JavaFX has excellent support for media. See this recent thread - especially the last two posts http://www.daniweb.com/software-development/java/threads/475808/how-to-play-mp3-files-in-java-using-eclipse

Member Avatar for JamesCherrill
0
358
Member Avatar for romdan94

There's a much simpler solution that stultusk's - no need for two arrays or sorting Remember that chars in Java are integer values, and the alphbetic letters are represented by consecutive values, so you just need one array to hold the counts. For each letter in the input: .. convert …

Member Avatar for JamesCherrill
0
277
Member Avatar for Halkawt.Papula

Same as searching any other list. Start with the first entry, use a loop to check each entry to see if it's the one you want.

Member Avatar for jwenting
0
184
Member Avatar for duncan55
Member Avatar for asaidi

Yes, 1.6 is no longer supported, and security bugs in 1.6 are not fixed any more. It's ***essential*** that you update to a supported version - 1.8 or the latest 1.7

Member Avatar for jwenting
0
274
Member Avatar for cvandal

Look at your initial value for minDistance. Do you think you will ever find a smaller value than that? So the if test on line 10 will always be false. Start minDistance at some very large value (larger than any distance you will calulate) Integer.MAX_VALUE would be the obvious choice.

Member Avatar for cvandal
0
212
Member Avatar for Reapt
Member Avatar for parsa123

In your method you are passed an instance of `f` and you need to access that instance's value of `number`. How you do that depends on how the class `f` was written. If its number field is public then you can refer to it like this public void someMethod(f someF) …

Member Avatar for Doogledude123
0
162
Member Avatar for Emelnuel

You only need one Scanner. You don't need an Iterator to use a Scanner. Before posting code here, compile it and deal with as many of the compiler errors as possible before asking for help. You were asked to implement a new data type ("class" in Java), and you have …

Member Avatar for Emelnuel
0
510
Member Avatar for SoloMonk

Centering things is a responsiblility of the layout manager. Have a look at [this](http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html) and chose a layout manager that handles sizing & centering the way you want. Note also the the frame has a layout manager that positions the panels, but the panels have their own layout managers (not …

Member Avatar for SoloMonk
0
2K
Member Avatar for xolani.ntsiba.7

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others here. There are lots of people here who will freely give their time to help you become the best Java …

Member Avatar for stultuske
0
119
Member Avatar for Pyler

(Edit) deleted text of post that was based on an incorrect reading of sepp2k's post. My mistake. He is right.

Member Avatar for JamesCherrill
0
248
Member Avatar for Doogledude123

> The player would be moving, so how would you determine which object is the closest since you wouldnt just want to check if the player is colliding with all other objects? Checking for rectangles overlapping is so quick & easy that you may as well just do it for …

Member Avatar for jwenting
0
484
Member Avatar for mellixa
Member Avatar for JamesCherrill
0
883
Member Avatar for Doogledude123
Member Avatar for DawnofanewEra

"an annoying error something with Scanner method" It would be a lot more helpful if you gave us the exact complete error message, including the all-important line number(s) (edit: this post should have appeared before the previous one!)

Member Avatar for jalpesh_007
0
4K
Member Avatar for software girl

What exactly are you saying here? Sounds like "I don't like any of the tutorials on the web, so write one just for me"? Anyway - you don't need to worry about make files for this simple example. Just compile all your classes with javac.exe, run the server and run …

Member Avatar for jwenting
0
443
Member Avatar for koduruabhinav
Member Avatar for JamesCherrill
0
584
Member Avatar for farwajafri90

I don't know of any simple solution. You may have to create a tiny class with the data value and its original index as its two instance variables. Then you can sort an array of those objects on the data value, but still retrieve their original indexes.

Member Avatar for jwenting
0
263
Member Avatar for Pyler
Member Avatar for Pyler
0
297
Member Avatar for jwenting

Questions: Why have a whole HashMap implemetation just to find enum values from their "f" String. Since enums usually have a small number of values you could simply search `Foo.values()` for a match (with the option of a case-insensitive search if you want) And why the extra code for lazy …

Member Avatar for jwenting
0
248
Member Avatar for xrerd

Your methods need to return a boolean (true or false) not a String if you want to call and use them like you do in lines 14 and 16. The String class has methods `equals` and `equalsIgnoreCase`. You can find the details in the Java API documentation [here](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true) For example: …

Member Avatar for jwenting
0
2K
Member Avatar for sobias

for (File afile : files) { if (afile.isDirectory()) { this.childFolder = new Folder(afile); parentFolder.add(childFolder); } recursiveTraversal(afile, this.childFolder); } If the first n Files are files (not directories) the variable childFolder is noy set and presumably inherits some left-over value from a previous class? ps: This kind of thing is much …

Member Avatar for JamesCherrill
0
312
Member Avatar for yaya123

YOu can use the jvisualvm profiler that comes as standard with the JDK - you'll find it in your JDK bin folder. It's really easy.

Member Avatar for dasi
0
264
Member Avatar for DawnofanewEra

"It doesn't work" tells us nothing. Did you get an exception? Was the file created but with the wrong location and/or name? Etc? The exception on line 22 (catch) contains details of any errors. It is a bad mistake not to use that. Add an `e.printStackTrace();` inside the catch clause …

Member Avatar for JamesCherrill
0
554

The End.