7,116 Posted Topics
Re: What's the requirement for keeping them ordered? | |
Re: C and C++ are two languages. Java is another, completely different, language. You can't use a Java compiler for C or C++. JDK 1.5 is many years old, no longer supported, and has unfixed security errors. If you want to code in Java you should download the latest version of … | |
Re: Maybe if you told us what the "warnings and problems" were then we could help. We're not mind readers. | |
Re: http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/stereotype/Repository.html | |
Re: Although it is theoretically possible to use Java and .net, in practice it's not feasible. Java comes with its own API that provides a superset of .net-like capsbilities, and is compatible across Windows Linux and Mac. Most Java developers use either NetBeans or Eclipse IDE - both free and downloadable … | |
Re: It would be helpful to know exactly what the error message says. | |
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: Your problem description is wrong. I ran your code with a print statement in the mouseClicked method as it WAS being called. It's the setBackground that's not working - presumably because you have a custom cell renderer that sets the background to fixed values. ps: I ran this on a … | |
Re: I think this is an old micro-optimisation thing that is irrelevant with modern compilers. The preincrement just adds 1 but the postincrement theoretically requires you to store the initial value before incrementing. Nowdays that would be optimised out anyway. | |
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: I agree. It's an installation problem. Possibly missing files, but more likely some old files that are sitting in the classpath somewhere and masking the Java 8 versions. I would formally uninstall all Java versions, then manually search & destroy all java-related directories, and delete the classpath variables, then download … | |
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: Whenever the user changes either text box just update the total amount to $5 x (number in box 1) + $10 x (number in box 2) | |
Re: JavaFX (part of Java 8) has extensive media playing capabilities. Just Google it for tutorials etc. | |
Re: Interesting question. A quick Google doesnt reveal any subclasses for Graphics2d - maybe they are private? You could do something that gives you a Graphics2d object (eg overide paintComponent) then test the runtime variable to see exactly what class it really is. With the actual class name it may be … | |
Re: Hi - you didn't upset me, so don't worry. I can't see any code there that calculates a value for `gpay`, so its value remains at 0. Similarly for `netpay` and `payrate` | |
Re: `orders` is an arraylist of `Orders`, so (unless `Product` is a subclass of `Order`) you can't add a `Product` to it. | |
Re: 1. Is SphericalCoordinate *a kind of* PolarCoordinate? If not, it shouldn't be a subclass. EndOf. 2. Are there situations where you will use or accept a PolarCoordinate without worrying about whether it's cylindrical or spherical? If so, the common superclass will be useful 3. Is there a useful amount of … | |
Re: You don't change what the dimensions are called, you just take a value for `side` and use it to set both dimensions to the same value. | |
Re: `first` is a variable, not a class, and it *is* defined, so that's not the problem. Read the error message: cannot find symbol ... method setMPG(double) it tries to call setMPG but there is no such method. | |
Re: Best not to reinvent the wheel. List already has a `contains` method `boolean contains(Object o)` Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that `(o==null ? e==null : o.equals(e))`. so for clarity … | |
Re: There's no code there that displays anything. You have not written any code to display any output. So there is no output. You forgot to write print statements such as System.out.println("add: " + e.add(15,5)); | |
Re: I'm not sure where you intend to use the Observer pattern. It's a common way to attach a GUI to a model, or to allow a "referee" to watch players that can move in real time, but for a strict turn based game the ref just needs to access the … | |
Re: There are more than one ways to do this, but here's one: Start with an ArrayList containing the numbers of the columns with no queen. Initially it will contain the numbers 1..8. For each row, pick a column number from the ArrayList at random, place a queen at that row/col, … | |
Re: What offset issues? You are unlikely to find anything faster than the standard API method, so the best approach is to work with it. Have you tried creating a transparent BufferedImage for the fill as I explained in your other post? | |
Re: Why do you have a 3x3 array of buttons when the board is 9x9? | |
Re: A Comparator is the right way to do it, so there seems to be something wrong with your implementation. If you post your code someone will help. | |
Re: AWT was Sun's first try at a Java GUI and it wasn't very good. So in 1998 (yes, seventeen years ago) they released Swing to replace AWT. Since then all the development has been in Swing, which has got better and better, faster and faster, while AWT remains stuck in … | |
Re: That code looks sensible. What exactly is your question? | |
I've opened this thread following rotten69's suggestion for "Java projects for beginners". To get things started I've posted a project in a format that makes sense to me; please feel free to follow that format, or to do it in some completely different style if that seems better. Let's see … | |
Re: What do you mean "will not allow me"? Is there an error message? What does your jar spec look like? | |
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: 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: Are you sure the .fxml file is in the correct directory structure inside your jar? | |
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: There are lots of people here who will freely give their time to help you become the best 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) include: … | |
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 programmer … | |
Re: Debugging is not an answer. The behaviour of that code is undefined in the standards, so any compiler.now or in the future, can implement any order of evaulation it wants. Confirming that it works with one particular compiler is just setting yourself up for a disaster later. The code is … | |
Re: 2 + 2x4 + 2x4x6 + 2x4x6x8 + (etc) see the pattern? Exactly what help do you need? | |
Re: What exactly is the code supposed to do? What's the list `min` all about? | |
Re: You can't do this by editing in place. You have to read the file one line at a time and write those lines to a new file. When you read a line starting with 6 write that line folloeed by the "79..." line. | |
Re: "without arrays/stacks/queues" makes this a lot more interesting - presumably that bans dictionaries as well? You could use a nested loop like (pseudocode) for i = 0 to string length for j = i+1 to string length if char j == char i, remove char j | |
Re: I haven't time to read that all now, bu I did get as far as public static int lastValue = Integer.MIN_VALUE; ... if (root.data < lastValue) { // this can never happen! | |
Re: There's nothing wrong with repeating things like Cancel buttons. They all have their own place/size in ther own forms. If they all do exactly the same thing then it would be OK for them to share a single actionListener. | |
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 have methods called printXXX() that change the data values and print nothing. That's baffling. No surprise that the numbers change each time you try to print them. You repeat number of tickets in each subclass instead of implementing it once in the superclass. You have repeated identical blocks of … | |
Re: That fragment of code makes no sense withoutall the other code that you didn't post here, so it's impossible to understand. You have shared variables, classes, and parameters that we know nothing about, and a method that seems to be all about its side effects. In particular line 9 looks … |
The End.