7,116 Posted Topics

Member Avatar for robert.swaine1

[This Oracle tutorial](http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html) tells you how to create a dialog that prompts the user and gets the user's input.

Member Avatar for stultuske
0
254
Member Avatar for itzlavanya

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

Member Avatar for JamesCherrill
-2
120
Member Avatar for sky_B

A bit late (3 years) don't you think? Did you try your solution? Do you have a complete minimal executable demo of it in action?

Member Avatar for dodo11
0
160
Member Avatar for dany12

stuktuske is right. Nobody is smart enough to be able to learn "intermediate" Java in a week, or a month. Best that you re-evaluate your goals.

Member Avatar for stultuske
0
243
Member Avatar for Jack_11

"Lol. The code works." You are demented. Almost every other line contains an error. It a long way from even compiling.

Member Avatar for happygeek
0
426
Member Avatar for Jack_11

Either you have a truely exceptional ability or you don't really understand what it means learn or know a language. Maybe if you post some examples of your best code people here could tell you which it is?

Member Avatar for <M/>
0
672
Member Avatar for london-G
Member Avatar for london-G
0
381
Member Avatar for ~s.o.s~

Eclipse Juno SR2 (version 4.2) is the latest stable recommended release. The "Windows 64 bit" is the version you need. Go for the "Eclipse IDE for Java Developers, 150 MB" configuration unless you need the facilities of another version (eg Java EE) http://www.eclipse.org/downloads/

Member Avatar for ~s.o.s~
46
6K
Member Avatar for Ryan_14

With focus in the Netbeans editor window showing your main class, CtrlF5 (cmd/shift/F5 on OSX) shoud bring up the Output window with 2 tabs (the normal system output window + the debug console). What exactly is the sequence of states/events that you are using, and what exactly do you see?

Member Avatar for JamesCherrill
0
203
Member Avatar for CoderGuy101

Separate the model from the view... Start with a CookingTimer class that implements all the required functionality as public methods (no user interface of any kind). Test/debug it by hard-coding calls to those methods and printing the results. Then, and only then, write a GUI and/or other UIs to front-end …

Member Avatar for JamesCherrill
0
150
Member Avatar for kwonzo

> The number 0 is included in the sequence of integers and should be included in all of your calculations. You stop looping as soon as you see the 0, so you never process that 0, so it's not included in your calculations.

Member Avatar for kwonzo
1
345
Member Avatar for Cripop

Hi Cripop It's good that you have already done so much, and posted yur progress so far. What's missing is a clear and concise statement of exactly what help you need. You can't expect people to read the spec, read yur code, and figure out which bit(s) you haven't done …

Member Avatar for JamesCherrill
0
237
Member Avatar for iamcreasy

Java is strongly typed, which means the compiler can work out the type of an expression. See the Java Language Spec section 15.1 for details. (or are you asking how the parser knows about the "must be boolean" rule? - in which case its because parsing the sysntax is just …

Member Avatar for JamesCherrill
0
179
Member Avatar for rob.sigmon.1

The loop to print all the Cars terminates on line 22, so it includes printing the number, but excludes the rest of the prints.

Member Avatar for pookie47
0
568
Member Avatar for vivekH

<Sigh> I'm sure you know this by now but... Do provide evidence of having done some work yourself if posting questions from school or work assignments (DaniWeb Member Rules)

Member Avatar for rubberman
-1
234
Member Avatar for Hongero

"if some body been given a question and has no idea he cant be help" We help people who show effort. You have been given a detailed step-by-step set of instructions for what to do, but you haven't even tried to follow them. Just start writing code and stop wasting …

Member Avatar for JamesCherrill
-2
197
Member Avatar for SammyT79

20 differ = annualSales, What is this intended to do? annualSales wasn't initialised explicitly, so differ will just be a copy of its default value of 0 if (n < -1 && n > NUM_EMPLOYEES -1) Unless NUM_EMPLOYEES is negative, this expression can never be true. Lots of people (me …

Member Avatar for Traevel
0
360
Member Avatar for didyone

That needs quite a lot of code covering more than one major area of the JAva API. What have you done so far?

Member Avatar for JamesCherrill
0
383
Member Avatar for Fahad_5

If uyou have multiple public classes (as is normally the case) then you must have multiple .java source files. You could put them all in a single .zip file.

Member Avatar for stultuske
0
121
Member Avatar for CodeWarrior14

Line 93 is a comment, so the code you posted does not correspond to the exception. Which line causes the NPE?

Member Avatar for CodeWarrior14
0
3K
Member Avatar for Nation

You could use a layout manager (eg GridBagLayout) that will grow components according to the available space. http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

Member Avatar for Nation
0
1K
Member Avatar for sameer.i.w

Jagex T&C include "Jagex®, RuneScape®, War of Legends® and FunOrb® are registered trade marks of Jagex Limited in the United Kingdom, the United States and other countries. All third party trade marks are the property of their respective owners. You must not reverse-engineer, decompile or modify any Jagex Product client …

Member Avatar for JamesCherrill
-1
89
Member Avatar for Stefce

StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead. (from the API doc)

Member Avatar for Slavi
0
2K
Member Avatar for CodeWarrior14
Member Avatar for Nation

This is the downside of not using a layout manager! Try adding a listener for the resize events and resetting the necessary bounds in the event handler.

Member Avatar for Nation
0
2K
Member Avatar for muhammad_74

[This thread](https://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq) (at the top of the Java forum) will give you lots of useful info about where to start.

Member Avatar for Nation
0
263
Member Avatar for humorousone

I agree with the above. Time spent on variable, method/function, and class names is time well spent because it leads to code that needs no further explanation. Personally I'm a fan of the quick one-liner at the top of each block of code stating what it dis going to achieve …

Member Avatar for rubberman
0
152
Member Avatar for CodeWarrior14

The output of the encrypt is a byte array that can contain any sequence of byte values, yet you try to convert that into a UniCode String using your system's default charset and back again and hope that will give the same byte array. Unless you are very lucky, it …

Member Avatar for JamesCherrill
0
879
Member Avatar for Nation

You can do almost anything with a GridBagLayout, but it's not easy to write, and even harder to read! The simplest approach is just to use JPanels within JPanels to build it up starting from the smallest groups. At the topmost level a JTabbedPane will give you the tabs and …

Member Avatar for Nation
0
203
Member Avatar for MiicahLiim

If you don't know what language you are coding in then you need more help than anyone here is likely to give. Regardless of language, this is an easy exercise for a beginner, so try to do it yourself before asking for help.

Member Avatar for JamesCherrill
0
264
Member Avatar for Nation

Presumably the `row` variable contains a row number in the range 0 to (n-1) where n is the number of rows in a JTable, and `InteractiveForm.this.tableModel` is a reference to the JTable's table model, in which case... `InteractiveForm.this.tableModel.getRowCount()` gives the number of rows, so `InteractiveForm.this.tableModel.getRowCount() -1` is the number of …

Member Avatar for Nation
0
161
Member Avatar for Nation

How about checking the values of `getEditingColumn()` and `getEditingRow()` ? (Details are in the API doc as always.)

Member Avatar for Nation
0
125
Member Avatar for trishtren

JavaFX has a rich set of classes to handle animation, so you don't need to mess about with low-level timers or (shudder) timing loops. Have a look at the `javafx.animation.Animation` class and its `TimeLine` subclass, and the `AnimationTimer` class and related tutorials ([this one](https://carlfx.wordpress.com/2012/04/09/javafx-2-gametutorial-part-2/) looks pretty good). It's a higher-level …

Member Avatar for trishtren
0
1K
Member Avatar for COKEDUDE

Don't forget that Java 8 has been out since last Spring, so you should be using a Lambda expression instead of that clunky anonymous inner class, eg c.addItemListener(ie -> System.out.println("Your choice was" + c.getSelectedItem())); http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#approach9

Member Avatar for JamesCherrill
0
616
Member Avatar for ali11

... yes to all those, plus: if(n>=Long.MAX_VALUE || n<=Long.MIN_VALUE){ That's just nonsense. The person who wrote that didn't know what they were doing. I agree with stultuske: this code is absolute rubbish. Don't waste time trying to understand it, just delete it and write some code of your own.

Member Avatar for Taywin
0
131
Member Avatar for cppgangster

A quick Google showed loads of tutorial or sample code for Android voice recognition - including [this one](http://wwwhttp://www.javacodegeeks.com/2012/08/android-voice-recognition-tutorial.html) in Java

Member Avatar for JamesCherrill
0
200
Member Avatar for Nation

Which part of that is the problem? Responding to the enter button, adding a blank row to a table, or something else?

Member Avatar for Nation
0
5K
Member Avatar for Nation

You could create a simple form to capture the info for one quote. Maybe a bit more work than a JTable, but you could make the user interface look a lot more familiar to the user.

Member Avatar for JamesCherrill
0
209
Member Avatar for CodeWarrior14

I noticed the decrypted values are just the original values - 130 That must be a clue to the problem

Member Avatar for Taywin
0
2K
Member Avatar for Udai_1

With a file, sooner or later it's inevitable that the program will terminate abnormally in some way, leaving the file in the wrong state. You could open a ServerSocket (a concurrent second attempt will throw a BindException), which has the advantage that the port should be released whenever the JVM …

Member Avatar for JamesCherrill
0
214
Member Avatar for ankit1122

In as *PURE* OO langage like SmallTalk that's true, but not for Java. The designers of Java were worried about the overheads of using an Object for simple stuff like numbers or true/false, so they decided to have some data types, called *primitives*, that are not objects, and have none …

Member Avatar for stultuske
0
119
Member Avatar for abhishek.ashwini

Please explain what you have tried and EXACTLY what problems or error messages you are getting. The more you tell us, the better the answers you may get.

Member Avatar for JamesCherrill
0
55
Member Avatar for ali11

You never initialise your layout variables (line 24), so all your panels have a null layout manager. ps: all this padding and boilerplate exit.addActionListener(new java.awt.event.ActionListener(){ public void actionPerformed(ActionEvent e){ exit_ActionPerformed(e); } } ); can now be replaced with exit.addActionListener(this::exit_ActionPerformed);

Member Avatar for JamesCherrill
0
220
Member Avatar for mohamed_44

You want what's called a "deep copy". Google that for examples of how to do it, and discussions about why it's a pain in the * and what the alternatives are.

Member Avatar for JamesCherrill
0
224
Member Avatar for nan nan
Member Avatar for zolymo
-3
158
Member Avatar for redtribal23

Maybe newToken is not an array of longs, but if it is, then certainly because tokens[tokens.length-1] isn't a String

Member Avatar for vivekH
0
256
Member Avatar for mee123

The structure looks like this (pseudo cde) // do your initialisation do { // do one transaction answer = ask user "do another?" } while (answer is yes);

Member Avatar for stultuske
0
145
Member Avatar for akam aziz

Very interesting. And your reason for posting it was...? ps 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

Member Avatar for JamesCherrill
0
328
Member Avatar for Search_not
Member Avatar for Search_not
0
420
Member Avatar for divinity02

The End.