7,116 Posted Topics
Re: That's very vague/general/large question. How much do you know already, and where does your difficulty start? Are you familiar with the content in the first few sections of the Oracle tutorials, and the last two (event listeners, custom painting)? http://docs.oracle.com/javase/tutorial/uiswing/index.html | |
Re: You specify that class that has the main method in the Main-Class entry in your manifest file. The class name should be fully qualified with its containing package structure, and that must match the folder structure in your jar. | |
Re: I *think* that compiled stub stuff related to an earlier version of RMI (pre Java 1.5), but the current version works at run time via reflection and so doesn't need the old skeleton/stub files. That's one danger of using a book rather than current online sources. codebase is an HTML … | |
Re: Just before starting the search, create a "global" int depth = 0; Increment it in the "down" method and decrement it in the "up" method. | |
Re: Why do you think that? Java char is a numeric 16 bit integer type, perfectly OK, and converted to int by Java whenever needed. Did you test that before posting? It may be an odd choice, but its not wrong. It certainly won't fix his (unspecified) problem, which is caused … | |
Re: Yes, that sounds very ambitious - unrealistic in fact. I don't want to sound discouraging, but maybe something more achievable would be a better choice. | |
Re: Kris. Content posted on Daniweb is subject to Daniweb's T&Cs, including DaniWeb LLC reserves full rights and privileges to information posted to anywhere within the daniweb.com domain by its members and staff. Any and all information posted on DaniWeb may not be copied or used elsewhere, in any way, shape, … | |
Re: Java 7 allows switches using a String. If you're not on Java 7 then you should be. | |
Re: 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 … | |
Re: You display the menu before entering the while loop,so it only gets displayed once. If you move it to be just inside the while loop it will be displayed every time you go round the loop. | |
Re: In general a jar *will* run on any higher jre version. It's possible you may run foul of tighter security settings, as there have been a number of changes there since 1.5. How exectly does it "fail"? - absolutely nothing happens - runs but wrong results etc? Did you try … | |
Re: It's not clear what it is you don't understand... I suspect you already know the answer but are looking for a problem that isn't really there? Maybe this will help?... When you set up a new ATM it will need a Screen abd a Keypad, eg public ATM() { // … | |
Re: You can use System.setOut(PrintStream out) to redirect all System.out.print data to the stream of your choice. If you use a ByteArrayOutputStream then you will get all the output in a byte array that can easily be converted to a String. Is that what you meant? | |
Re: There's no harm in not closing a Scanner on System.in The console is just a transient thing, unlike (say) a buffered disk file, so you aren't worried about losing any data when the application terminates. | |
Re: The name being bound is normally just an ordinary string, maybe starting with a package name just to keep it unique. The doc says it's not parsed, but it looks like the // at the front is causing someone to try to parse & interpret it. This is just a … | |
Re: You are drawing them all at the same position 250,200 You need to increment that position's x or y value after each print so the next string goes to a different position | |
Re: 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) … | |
Re: I just ran your code and yes, it does replace the chars correctly. | |
Re: To protect from scummy criminals, the security settings for running applets have been steadily increasing over a number of Java updates. The main thing is to sign your applet jars using a proper certificate from a trusted authority. Depending on the user's java security settings (in the Java control panel) … | |
Re: It doesn't print because it doesn't run because it doesn't compile! Read all the compiler error messages, fix all the compile errors, and maybe you will get a bit further. | |
Re: You overide paint for the whole applet, but in it you only paint the image. That leaves the rest of the applet unpainted. You could try a super.paint(g); as the first line of your paint, so the rest of the applet gets drawn properly befroe you draw the image. A … | |
Re: That's lot of code to search for unspecified errors. "barely work" and "just give errors" tells us nothing. Please tell us EXACTLY what the problems are - complete copies of error messages, detailed what-it-should-do vs what-it-did-do etc. | |
Re: Line 12 only returns 0 if the head node is null, ie the list is empty. That looks OK to me. In fact I agree with JeffGrigg (above) 100% | |
Re: You have to execute a SELECT statement via Java's JDBC SQL support, then you get a ResultSet that contains the data in Java variables. Just Google for *JDBC tutorials* | |
Re: Recent Java versions have direct support for embedded scripting languages, including sharing data etc. Here's a tiny eg I had lying about. // evaluate arbitrary jscript boolean expression... ScriptEngine js = new ScriptEngineManager().getEngineByName("JavaScript"); try { String condition = "a==b"; // expression to evaluate js.put("a", 2); // value for a js.put("b", … | |
Re: You have 99% of the code right there. There's one bug that jumps out at me... the new node that you add should contain the "element" object. | |
Re: Create small Runnable that adds the data, then start lots of Threads using that Runnable? | |
Re: That should be 4) Create new object "changed", and set s2 to point to that object now s1 -> "82938", but s2 -> "changed" | |
Re: mohammedfae: DaniWeb Member Rules (which you agreed to when you signed up) include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules As for your question - just look at the API documentation for the System class. The description of its … | |
Re: I think your original if test was correct. The problem is the semicolon at the end of line 8, which terminates the while block right there, so the message dialog is not part of the while, and always gets executed. Just get rid of that ; | |
Re: I googled `java rsa encrypt large file` and this was the second hit... [Encrypting and decrypting large data using Java and RSA](http://coding.westreicher.org/?p=23) ps: Did you see the warnings about how unsuitable RDA is for large files? Depending on how big your files are you could easily get into minutes or … | |
Re: Line 10 you have two `==m` presumably one of those should be an `==n` | |
Re: 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 … | |
Re: Now put lots of print statements into your code so you can see exactkly what is and what is not happening - eg is the client conecting? - does the server receive the message? ... etc etc | |
![]() | 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 Post what you have done so far and someone will help you from there. |
Re: Finding files froma Java program is always a difficult area, especially when moving from an IDE to a runtime environment. There's always confusion and doubt about where the files should be. The getResource is a good approach. If you change your path to "/Images/dragons.jpg" and place the Images directory in … | |
Re: What exactly is puzzling you? | |
Re: It all comes down to using the most appropriate layout manager. See http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html | |
Re: Lines 52-54 you have a synch block in which you wait on the lock object. But no other thread can get the lock to execute their notify, so the app hangs. Just synching on the same lock object will prevent simultaneous access from different threads. YOu only need to get … | |
Re: It's just like the Quit button you already have, but in the ActionListener instead of the `run()` method just being `system.exit();` itshould have the necessary code to set the text of the field you want to update. | |
Re: There's no "link" needed - it doesn't even make sense to "link" them. The first is a *template* - it's an example that shows you the "standard" code and where to add your own code. The second is an example of using that template - it has the same standard … | |
Re: JOptionPane.showInputDialog(null,"Enter Temperature: "); temp = input.nextInt(); You display the input dialog, but you do nothing with the result that it returns you. You then go back to the console to read an int. So the user enters something in the dialog, you ignore that, then he has to enter it … | |
Re: You can use String methods: indexOf(' ') to find the position of the first space (end of first word), and lastIndexOf(' ') to find the position of the last space (start of last word), then use use substring to get the text between those two positions. | |
Re: 1. Akeem Amure write this five years ago, he/she probably isn't here any more 2. You can use Google to find out how to run an applet 3. This is not a free coding service. Nobody will "rewrite the whole code" for you, and you are insulting us by asking … | |
Re: Declare a 30x5 array (an array of 30 elements, each of which is a 5 element array of ints). use your Day variable (line 14) to index the outer array, and hard-code the inner array refs, eg myDataArray[Day][0] instaed of the first "i" on line 16 | |
| |
Re: > I do not know how to make it so that, when you guess a correct letter, it reveals that letter in the hidden word while still keeping the other parts of the word hidden. You can use a StringBuilder - it's like a String but you can update individual … | |
Re: What exactly do you need help with? "I need help" tells us *nothing*. | |
Re: Unwrap your loop, ie SELECT * FROM myTable WHERE columnId < 45... result of current row goes to row1.txt; rs.next(); result of current row goes to row2.txt; rs.next(); result of current row goes to row3.txt; rs.next(); result of current row goes to row4.txt; (or maybe it would be better to … |
The End.