1,678 Posted Topics
Re: Your directions seem insufficient. Did you not include all of the project directions? | |
Re: [url]http://www.pcmech.com/article/monitor-your-computers-bandwidth-usage/[/url] Just the first thing I found. Something like that is what you're talking about, right? Since there are pre-existing programs that do what you want, anyone of any experience level can accomplish this task. | |
Re: You can only make updates to SWT controls from within the SWT UI thread. You need to use either synExec or asyncExec to accomplish running other code that updates SWT controls because these methods cause the code to be run on the SWT UI thread. See : [url]http://book.javanb.com/swt-the-standard-widget-toolkit/ch05lev1sec7.html[/url] P.S. you … | |
Re: im ahvren trublesz givien advics ?? but i dink dat u shud google!!!! | |
Re: [QUOTE=kvass;1142341] [B]O(n) [/B]means that the algorithm is [B]linear[/B]. . [B]O(n^2) [/B]means that the algorithm is [B]quadratic[/B] . . O(n^3) [/B]means that the algorithm is [B]cubic[/B]. . [/QUOTE] To follow up on that, the essential characteristic to remember is that if an algorithm is "linear", that means that if an algorithm … | |
Re: Your English was confusing to me, but if it helps, you can output an Object [URL="http://java.sun.com/developer/technicalArticles/Programming/serialization/"]using Serializable[/URL] | |
Re: What is wrong with you? This thread is over two years old. And you added nothing to it. | |
Re: I prefer the forums where I can leisurely browse to "live" chats, so that's why you'd rarely catch me there regardless of whether lots of people used it or not. But Narue is right, the majority of members probably have no idea that it exists. | |
Re: 1.541900433861831E-6 is an extremely small value. Perhaps you are experiencing a precision problem due to how small it is, it can only register as 0 in a double? A second possibility is that println() is not printing your value to enough decimal places in order for you to see anything … | |
Re: You posted a lot of code. If you post any amount of code, you should use code tags. Reading the forums rules would have told you this (as would general observation, i.e. looking at the reply box) | |
Are different in different places. I'm not sure if this is considered a problem or if Dani is aware, so just letting you know. | |
Re: As long as the list, a swing component, is getting updated by the EDT (the swing thread), not your other thread, everything should work fine. I'm not an expert but that has been my experience. Is that the case? You can test by calling [URL="http://java.sun.com/javase/7/docs/api/javax/swing/SwingUtilities.html#isEventDispatchThread%28%29"]this method[/URL] in the method where … | |
Re: It says to pass the capacity to the constructor. The capacity of an array is simple how many slots/indexes it should have. This is an int, not a double, and the array should be created to be the size passed in. Look up how to create an array in Java. … | |
Re: If it is made by Acer then I'd never buy it. Buy a different brand with a better reputation. Acer laptops are made cheaply. They will not survive any wear and tear. | |
Re: I heard people at my [previous] internship talking about this, it is called an SQL injection. So look up how to prevent mySQL injections on google. I found how to prevent them in php fairly quickly. But I'm assuming your problem was a lack of the right search terms, so … | |
Re: You put the absolute path of the file, but did it find the file? You enclosed your directory names in single quotes, which doesn't make sense to me. I doubt it is finding the file. Read [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html"]this[/URL] which describes what will happen if the image isn't found: nothing will happen, … | |
Re: Umm... why? I'm running Ubuntu in a VM for my OpSys class and it is only currently using 7.1 gigs of hard drive space. It is set to max allow 8GB of space. It also only needs 256MB RAM (but I just set it to twice that). | |
Re: The first bad habit I noticed is that you initialized your stID array as an array of 100 ints, but then you have this piece of code: [CODE] for(int i = 1; i<=numStu;i++){ System.out.println("Enter Student ID: "); sID[i] = scan.nextInt(); outputFile.println(sID[i]); }//end of for[/CODE] If the user enters a number … | |
Re: You don't need a boolean array. You need a String. Then you need to iterate over the String, determining if each piece of the String is a character or not. Check out the [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html"]isLetter method[/URL] of the Character class. You can determine if a specific piece (i.e. index) of a … | |
Re: I shut down every time I'm not using the computer. | |
Re: You can simply use hasNextInt() to determine if there is one in the input. If there isn't then I believe it will continue gracefully. | |
Re: Both the String class's split method and regular expressions would be good solutions for this problem. Using the split method and splitting on "[|]" would probably be easier though. The reason you would have to split on [|] and not on | is as follows: (quoted from s.o.s's post in … | |
Re: [url]http://java.sun.com/docs/books/tutorial/essential/exceptions/[/url] Does this do the trick? Use a try catch block. | |
Re: Well. . you said you've taken Java before. Do you know what an array is? And what a parameter is? [QUOTE]Write a method that takes a full array of double as a parameter[/QUOTE] [CODE] public static double arrayMean (double getMean)[/CODE] Your arrayMean method takes a double as a parameter. It … | |
Re: Before you leap into GridBagLayout I would strongly advise you to read a little about each of the various Layout Managers. . (GridBagLayout, BoxLayout, GridLayout, etc). I'm pretty sure each of them contains a section explain what they are useful for doing and why. You should choose your layout manager … | |
Re: [CODE] int number = 2567; String num = Integer.toString(number); String str = num.substring(//put correct argument here); [/CODE] I'm intentionally omitting the argument to substring so that I'm not just giving you all of the code. Oh, and keep in mind that in order to properly get the substring, you should … | |
Re: Right before you call the if statement, why don't you try printing out the value of each of those equals() method calls and tell us what it says. [CODE]System.out.println(mail.equals(usermail)); System.out.println(date1.equals(date)); System.out.println(title1.equals(title));[/CODE] | |
Re: It is called a Binary Heap when you are storing it as an array. [url]http://en.wikipedia.org/wiki/Binary_heap[/url] (that may not be the best resource, it is a little hard to understand - but start googling "binary heap" and you'll find numerous useful articles). | |
Re: For playing sound, you can use the Java Sound API. Specifically, it sounds like the section in this article on [URL="http://java.sun.com/docs/books/tutorial/sound/playing.html"]Using a Clip[/URL] is relevant to what you are trying to do. | |
Re: So "what they did in class" was to assign a lot of blank methods that [I]you[/I] are supposed to implement. You would've heard the teacher's spiel about doing your own work, too, except you weren't there for that either. My point here is this: do your own work. We're here … | |
Re: So you can see inColecaoPanel but you can't see the panel inside of it? Did you try calling inColecaoPanel.revalidate() after you called setVisible on it? Oh, and if you attach your project as a zip file, I'll run it on my machine and try to figure out what is going … | |
Re: [QUOTE=Narue;1131804] This is a very simple algorithm that requires little more than common sense. Just pretend someone is handing you money and that you get to keep the smallest and largest bills. When you're done outlining the steps, turn the process into a flow chart. It may sound harsh, but … | |
Re: [URL="http://www.geekpedia.com/tutorial272_Bubble-Sort-Algorithm-in-Java.html"]This link[/URL] has an implementation of bubble sort in Java. If you look at the bubble sort code, all you need to do to adapt it to your needs is modify it so that it compares your book numbers and so that it swaps your book objects. Two simple modifications. … | |
Re: I see you have HashMaps stored in your ArrayList. What is it that you want to average exactly? Do you want to add up the values of each HashMap? Because you have Objects stored as the values in your HashMap. I think you need to give us more information on … | |
Re: Read the rules before you use the forums. Use code tags. | |
Re: Why wouldn't you just package it in the jar? | |
Re: [CODE] for (int i = 0; i < 200; i++) { patient = (Patient) in.readObject(); }[/CODE] Why do you need a for loop there? And why a hard-coded for loop at that? And why do you need to test to see if the patient's name is Luke anyway? If you're … | |
Re: Your add method is wrong. It says to add 'value' to the array. You added one to value, and never added it to any array. | |
Re: Is that a serious question? People take college courses, high school courses, certification programs, ask work related questions, have their own projects, etc | |
Re: Netbeans is arguably easier but you will learn more by designing GUIs by hand. Sometimes netbeans has a difficult interface to use, but for most issues, it is probably easier. I prefer not to deal with the netbeans issues though, and I do it by hand. | |
Re: You were supposed to post a normal thread not a code snippet for asking questions about your code. Anyway, the error message shouldn't correspond to that line, it should correspond to a line where you used SphericalCone class (i.e. where you used the new statement). I think you may have … | |
Re: For your first answer the printValues method is wrong. You printed out the words "integer1, float1", but what they want you to do is print the [I]values[/I] of those variables. [CODE] //This is wrong, it prints the words integer1 and float1, not the values. public void printValues() { System.out.println("integer1, float1"); … | |
Re: [CODE]public static void main(String[] args)[/CODE] is different than what you have. | |
Re: If you use merge sort to sort anything at all, your algorithm will be at least O(nlgn), so your algorithm will not meet the qualifications. In fact, you cannot use any comparison sorting algorithm, (merge sort being an example of one) because any comparison sort is at least O(nlgn). Look … | |
Re: [QUOTE=wee_shark;1137041]Thanks for that its a very cool thing. I did not know about it. I'm afraid I wanted to display the txt with a Jlabel underneath the button. Any ideas on that?[/QUOTE] Yeah. Intercept the event from JButton (I [I]think[/I] you could do this by making your own class that … | |
Re: You're using JTable I assume? See "setting and changing column widths" [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#width"]here[/URL] In particular, you might be interested in the section of text where it says, "For an example of setting cell widths based on an approximation of the space needed to draw the cells' contents, see the initColumnSizes method" … | |
Re: It depends where you defined the tree object. If you defined the tree object within main, then you can only use the tree object within main. The only exception to this rule is if you pass the tree object as a parameter to a method. [url]http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html[/url] You may also want … | |
Re: If you extend an abstract class you have to either A) implement its method B) declare your class abstract as well [url]http://java.sun.com/docs/books/tutorial/java/IandI/abstract.html[/url] | |
Re: You know Java has a premade Stack class already, right? If your teacher is forcing you to make your own, that makes sense (you'll learn a lot more), but otherwise, you might want to use the existing one. Anyway, where you said [CODE]System.in.read()[/CODE] you should be calling one of BufferedReader's … | |
Re: I'm waiting until I graduate either way, but I'll eventually be getting that certification. I'm assuming by the end of the summer it will be transferred to oracle? |
The End.