7,116 Posted Topics
Re: Why promote the use of DriverManager.getConnection when, to quote Oracle's documentation, "a DataSource object is the preferred means of getting a connection." as of Java 1.4? | |
Re: You have created a little class to hold the item names and prices. That's what any Java programmer would instinctively do. The problem is that the specification you have been given tells you to create two parallel arrays. Presumably you teacher is assuming that you haven't learned about classes yet? … | |
Re: Build the process with ProcessBuilder. Start the process. Star at 30 minute Timer. Get the available results as they are written to the process' output stream (may need to code the script to display results as they are created). When the Timer fires terminateForcibly() the process. | |
Re: DO you have any explanation for creating 52 variables, 52 if tests etc when a simple array or a map<char, int> would be so much better? And why use strings to hold single chars? | |
Re: You really should learn how to use arrays and maps before posting any more repetitive code (eg 147-178). | |
Re: Please let us know the email address for your teacher so we can submit the code directly to him/her and save you all that tedious copy/pasting. I'm sure you'll get an A+ for finding such a cunning way to handle the assignment. | |
Re: > 14.31 has number 1 on the its integer side and a 4 on its decimal side, hence its a variant of 1.4. ??? | |
Re: With 5000 soldiers that should be 5000 random numbers. The 1/15000 chance requires just one random number. | |
Re: You didn't say anything about the error. Is it line 38 - invalid syntax? | |
Re: Sounds like you had failed to provide a meaningful toString() method for the MArry class, so it's just inheriting the default toString() from Object, which just returns the object's hash, which is typically it's memory address. Overide `public String toString()` in your MArry class to return a String that represents … | |
Re: In Outlook you can configure the outgoing server(s) to be whatever you want (eg Google). There's absolutely no requirement to use outlook.com or any other particular server. | |
Re: The last time you posted a data file lines 2 and 3 were the same. If the user/pw matched those lines you would get two Booking forms. Lines 55-65 should really be replaced by a method call, eg `isLoginSuccess = isValidUSerAndPassword(user, pass);` .... and refactor the user/pw validation code out … | |
Re: You call the constructor for the new frame. That creates the frame but it does not display it. You also need to call `setVisible(true)` on the new frame. See line 446 for example. | |
Re: Java arrays are zero-based, so the two array elements created by `line.split` are [0] and [1], not [1] and [2] | |
Re: Why not `List<List<String>>` ? | |
Re: You need to share the exact details of the socket exception | |
Re: My ambitions to do a PhD in Theoretical Physics were destroyed when I discovered the joys of cannabis in 1968. My resulting BSc grade left me looking for a job. IBM offered me one as something called a "trainee programmer" which sounded quite interesting. The rest is history... | |
Re: To make your Ukley class sortable you make it implement Comparable. Comparable is an interface with one method - compareTo(other) - that you implement by comparing the year, then the month etc. Once you do that you can use Collections.sort to sort any list of Ukleys. Check the web for … | |
Re: You are almost there for the yes/no. You correctly read the user's input into the variable N, but then you compare the wrong variable (n) with "No" and `"Yes". It really helps if you give variables meaningful names because the code is then easier to read, and mistakes are more … | |
Re: > I need someone who can write the program and explain it to me Do you have the slightest idea what a university course is for? What are you studying - a BA in plagiarism? A BSc in cheating? Your C++ is there to teach you how to write programs … | |
Re: When you call setup you always pass 0 as the index, so all the Tile instances are stored in tile[0] and all the other elements of tile are still null. | |
Re: Yes, definitely a missing import. In general we would advise against importing whole libraries (eg. import java.util.* ) because you are adding a huge number of names that you don't know to your namespace. That can lead to really baffling errors when a name clashes (eg awt.List vs util.List), or … | |
Re: It looks like you are using a directory inside c:\Program Files\ for your own files. That's never a good idea. Create a directory in your home for such use. Make sure that's the working dir in your command prompt. Make sure the JDK dir with javac.exe etc is in your … | |
Re: How far have you got? What’s stopping you? | |
Re: The error is in the Interface class, but I can't see the code for that. The exception appears to be telling you that you have passed a null value for location when trying to create an ImageIcon. | |
Re: You have options here: Populate the JPane with two JPanes left and right (use the default FlowLayout) then populate the left pane with the canvas and right pane with a vertical stack of components (use a BoxLayout or a GridLayout). or GridBagLayout will do it all. Steep learning curve but … | |
Re: Given some way to set memory bytes, then it's totally possible. I did something like that with an IBM System 7 process control machine when we were preparing low-level software around 1970 in preparation for the first hardware shipments. It didn't even have an assembler at that time, so I … | |
Re: Help: yes. Write it for you: no. What help do you need to get started? | |
![]() | Re: That is really impressive. Look like you are doing an amazing job! Are you looking for help here, and if so what can we do? |
Re: > roulette wheels generally have slots with both a color and a number, and you have to get both right to pay off Each number is red or black according to a fixed pattern: "In number ranges from 1 to 10 and 19 to 28, odd numbers are red and … | |
Re: It's not clear what yo are asking... can you explain your question in more detail? | |
Re: Well done. You posted *exactly* the same question as the first post in this old thread. I guess you didn't read the complete discussion, or the complete solution in the last post. Then you asked for "help" without saying what help you needed. People here wil help you, but you … | |
Re: Assuming that your results should include "project management" rather than "project", then it looks like the logic is something like: for each word in all words if the word is in keywords and the previous word is in keywords the previous word and the word form a multi-keyword (etc for … | |
Re: wow, all that uncommented code with zero error handling just to replace `getDesktop().browse(uri);` | |
Re: What are you trying to say??? | |
Re: 99% of the time this problem arises because the keyboard focus is not on the component that has the listener. It can often be fixed by the slightly tacky approach of adding the listener to all the JComponents involved. The better solution is explained in [this](https://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html) Oracle tutorial. ps: looping … | |
Re: paintComponent still only paints the first image g2D.drawImage(bi, x, y, this); The draws to big and big2 don't achieve anythig as far as I can see | |
| |
Re: The instructions are pretty clear and detailed, so what exactly is stopping you from making progress? Ps: what is the ConsoleInput class? It’s not part of the Java SE API. | |
Re: SimpleDateFormate? Where does that come from? Did you mean the standard API class SimpleDateFormat ? | |
Re: I've been building Java GUIs since the mid 90's and in my opinion the best builder is no builder. Yes, you can drag and drop a pile of controls into a layout, and get a few hundred lines of incomprehensible code, but as soon as you start to think about … | |
Re: I guess I would count as a "seasoned member". So what would I get that would be worth $60 in a year? I can't see the value proposition. | |
Re: > VT-x is disabled in the BIOS Seems clear enough. Re-boot into your BIOS configuration and enable VT-x | |
![]() | Re: According to Dell's website the Windows licence is specifoc to each particular machine and its details are burned into the BIOS. Is it possible that the original OS was Home edition (in which case the licence is not valid for Pro)? Have you tried installing a Home edition? |
Re: Does anyone else believe that OP wrote that code in the 3 minutes between Norms' reply and his posting it? | |
Re: In theory you should be able to code and test on a sufficiently up-market Android phone. There are also quite few apps that teach you the basics of programming on Android or iPhones. They coud be a good place to start. In any case it's going to be painful working … | |
| |
Re: Check your switch, and remember that execution wuill drop through to the next clause unless you execute a break or a return... | |
The End.