7,116 Posted Topics
Re: [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. | |
Re: 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 | |
Re: 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? | |
Re: 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. | |
Re: "Lol. The code works." You are demented. Almost every other line contains an error. It a long way from even compiling. | |
Re: 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? | |
Re: "jdbc:mysql://host:3306/dbname" is the server really called "host"? | |
Re: 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/ | |
Re: 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? | |
Re: 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 … | |
Re: > 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. | |
Re: 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 … | |
Re: 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 … | |
Re: The loop to print all the Cars terminates on line 22, so it includes printing the number, but excludes the rest of the prints. | |
Re: <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) | |
Re: "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 … | |
Re: 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 … | |
Re: That needs quite a lot of code covering more than one major area of the JAva API. What have you done so far? | |
Re: 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. | |
Re: Line 93 is a comment, so the code you posted does not correspond to the exception. Which line causes the NPE? | |
Re: 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 | |
Re: 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 … | |
Re: 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) | |
Re: Why do you think that PBEWithMD5AndDES will generate any kind of AES key? | |
Re: 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. | |
Re: [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. | |
![]() | Re: 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 … |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: How about checking the values of `getEditingColumn()` and `getEditingRow()` ? (Details are in the API doc as always.) | |
Re: 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 … | |
Re: 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 | |
Re: ... 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. | |
Re: 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 | |
Re: Which part of that is the problem? Responding to the enter button, adding a blank row to a table, or something else? | |
Re: 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. | |
Re: I noticed the decrypted values are just the original values - 130 That must be a clue to the problem | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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); | |
Re: 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. | |
Re: Maybe newToken is not an array of longs, but if it is, then certainly because tokens[tokens.length-1] isn't a String | |
Re: The structure looks like this (pseudo cde) // do your initialisation do { // do one transaction answer = ask user "do another?" } while (answer is yes); | |
Re: 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 | |
![]() | Re: Use a modal JDialog to hold the components (see API doc for details) ![]() |
The End.