3,927 Posted Topics
Re: [QUOTE=l_03;705893]by the way,,i found the solution,, Sams Teach Yourself CGI in 24 Hours(Second Edition) but it has no free ebook,,do you have free ebook on this?? [/QUOTE] If that's the "solution" you need, then buy the book. Do you think the author spent time writing it just because he liked … | |
Re: [QUOTE=Guskayak;706472]Yeah, what I was hoping to do was take a button and it's function. The vehix site has all my cars on it and on the individual car page there is a button for sending that car's information to the customer's cel phone via sms. I'd like to offer the … | |
Re: It's somewhat dependent upon what "com.toedter.calendar.JDateChooser" returns when you call getDate() if nothing has been chosen. Does it return a null? A default date? If you were just checking for a valid date from a string you'd just catch the exception thrown by SimpleDateFormat.parse(). Since you're using some custom component … | |
Re: [QUOTE=stultuske;704108]if you would have written it correctly, it would've been playing right now, wouldn't it?[/QUOTE] Not if he no sound card or his speakers are not connected, not turned on, or turned all the way down :P Since he stated he wrote it correctly, one of those must be the … | |
Re: Your exact usage is a little bit vague, but it sounds like you want to use a [URL="http://java.sun.com/javase/6/docs/api/java/util/Map.html"]Map[/URL] structure. The Hashtable that JavaAddict mentioned is one implementation of that, though it's an older one and [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/HashMap.html"]HashMap[/URL] is generally preferred now. There are a couple of other implementations as well that … | |
Re: Yeah, she was pretty charming as she vacuously stumbled through the Couric interviews. :-/ Talking Point Wind-up Doll is a pretty apt description. Maybe she'll get lucky and they'll ask about hockey and moose hunting. | |
Re: Swing does have that component. It's called a Spinner. Here's the tutorial link on it: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html[/url] Edit: Oops, I missed page two. I'm referring to the incrementing component you asked about on page one. | |
Re: That is probably the worst suggestion you could make for this. Separate classes is appropriate design for this. Just because Java will let you create a procedural program by stuffing everything into static methods and variables doesn't mean it's the correct way to use the language. | |
Re: Bare-bones example: [url]http://www.exampledepot.com/egs/java.io/ReadLinesFromFile.html[/url] | |
Re: You didn't show how Cell is declared, but you mentioned that it was a nested inner class. I would guess that you didn't declare it static. It would need to be static if you want to use it in a static context. Non-static inner classes require an instance of the … | |
Re: I'd agree with masijade. It looks like embedded RTF style info to me. Try to save the file as plain text. | |
Re: If you only want the sound to be played on app-triggered repaints and not system-triggered (like repainting on resizes or other windows being dragged over it), you can override the update() method[code=java] import java.awt.Color; import java.awt.Graphics; import javax.swing.JOptionPane; public class PaintExample extends java.awt.Frame { public PaintExample() { initComponents(); } private … | |
Re: Well, I guess you weren't paying attention at all in class when sorting was discussed. You haven't even started a skeletal implementation of a single algorithm. I'd say you have some reading to do first: [url]http://en.wikipedia.org/wiki/Sorting_algorithm[/url] | |
Re: If you don't have an API that you can use for the target program then about the only thing you could try would be the [URL="http://java.sun.com/javase/6/docs/api/java/awt/Robot.html"]Robot[/URL] class. There's a tutorial that demonstrates how it can be used to interact with other programs here: [url]http://www.developer.com/java/other/article.php/2212401[/url] It would be a clunky solution … | |
Re: Use ".equals()" to compare strings - not "=="[code](input.equals("Quit"))[/code]or to avoid potential null pointer exceptions[code]("Quit".equals(input))[/code]. You also don't need to test booleans for "== true". The boolean, or boolean expression, is true or false by itself[code]if ( employee[k].getEmployeeName().contains(input) )[/code] | |
Re: Assuming that each transaction line item is an object in a List, you can simply call [URL="http://java.sun.com/javase/6/docs/api/java/util/Collections.html#sort(java.util.List,%20java.util.Comparator)"]Collections.sort(java.util.List, java.util.Comparator)[/URL] with an appropriate Comparator to compare on amount. | |
Re: Yep, better get acquainted with these pages: [url]http://java.sun.com/docs/books/tutorial/uiswing/index.html[/url] | |
Re: It may simply be a matter of incorrectly specifying the pixel values, because when I use this code (from the example in the [URL="http://java.sun.com/javase/6/docs/api/java/awt/image/MemoryImageSource.html"]MemoryImageSource[/URL] API)[code] for (int y = 0; y < height; y++) { int red = (y * 255) / (height - 1); for (int x = 0; … | |
Re: In the first version, I think the only problem is that you are calling cancel on the timer, instead of the timekeeping task. I ran this simplified example here and it works just fine.[code=java] import java.util.Timer; import java.util.TimerTask; public class FrameThread extends javax.swing.JFrame { Timer timer; TimeKeeping timeKeeperTask = null; … | |
Re: The compile error is due to the fact that BlockingQueue does not implement the List interface anywhere in it's hierarchy, which is what the SwingWorker requires in the process(List) method. You really only need to specify the type for the List parameter when you override it, because it is called … | |
Re: You need to learn your employer's business domain and the technical details of that domain and your companies offerings, which your employer should provide guidance on, unless you did misrepresent yourself as AD suggested. | |
Re: Want to know what? This isn't even a question. Why don't you read up on the two of them on the Eclipse site? | |
Re: [URL="http://java.sun.com/javase/6/docs/api/javax/sound/sampled/AudioInputStream.html#read(byte[])"]AudioInputStream.read(byte[])[/URL] will read into a byte array buffer. This example may be of use: [url]http://www.exampledepot.com/egs/javax.sound.sampled/StreamAudio.html[/url] | |
Re: Bookmark the [URL="http://java.sun.com/docs/books/tutorial/uiswing/index.html"]Swing tutorials[/URL]. | |
Re: I'm not sure what you are using to compile it, but that message may stem from the fact that you have no closing brace for the end of the class (assuming you posted the whole thing). There certainly isn't a line 72 in what you posted. | |
Re: So declare "filescan" static then.[code]static Scanner filescan = null;[/code]It's worth noting that making everything static and calling it from main() is not how Java is meant to be used, though intro courses often start with such programs. Java is an object-oriented language and should be taught as such. Making it … | |
Re: Well, you certainly have nothing to lose by starting to look. Worst case you cannot find anything. Best case you find an excellent job with a stable company. In fact, if you are really concerned about layoffs, looking around now rather than getting caught flat-footed with no job and a … | |
Re: [quote=world_weapon;425878]Intresting note. Got a link here that I came across while looking this character up. [URL]http://www.alchemylab.com/AJ3-4.htm[/URL] That is just a collection of views of Hermes. <snip> [/quote] Ouch! Holy Wall-of-Text there! Interesting comments, but please put a few paragraph breaks in! ... ok, back to your discussion... | |
Re: And perhaps you're smart enough to figure out why no one is going to help you with this, given the progress of this thread. | |
Re: [QUOTE=dspnhn;686435]..the reason i am saying this is people are lost in here...[/QUOTE] They certainly are... but separate sub-forums will not solve that problem. | |
Re: [QUOTE=cutedipti;699459]tried hard to align but give up[/QUOTE] That would be because you failed to read this prominent [URL="http://www.daniweb.com/forums/announcement9-3.html"]Announcement: Please use BB Code and Inlinecode tags[/URL] at the top of the forum. | |
Re: The Sun Swing tutorials also cover this: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html[/url] Keep that tutorial trail bookmarked for future reference on using Swing components. | |
Re: Perhaps he is just looking for a way to control his thermostat from his PC... :P | |
Re: Your requirement, as stated, is non-functional. | |
Re: If you create an instance of SimpleDateFormat using a pattern that corresponds to your intput, you can use the [URL="http://java.sun.com/javase/6/docs/api/java/text/DateFormat.html#parse(java.lang.String)"]parse(String)[/URL] method to convert the string input to a [URL="http://java.sun.com/javase/6/docs/api/java/util/Date.html"]Date[/URL] object, which you can then use to get the day of the week. [URL="http://java.sun.com/javase/6/docs/api/java/util/Calendar.html"]Calendar[/URL] is what you should really use for … | |
Re: Make it a class level variable - not a public static member. | |
Re: Only if you start with an effort to outline your thoughts on how to implement the program or some code that you have written to start with. Write it in pseudocode if you don't understand how to do it in Java and ask specific questions about the portions that you … | |
Re: [QUOTE=adiel224;697636]public void update(....){ //complete here .....[/QUOTE] Brilliant. Absolutely brilliant. | |
Re: There are some tricky nuances to clone() and you are probably best served by using a copy constructor in it's stead. [url]http://www.javapractices.com/topic/TopicAction.do?Id=71[/url] | |
Re: That was a great episode. This one is good as well: [url]http://www.thedailyshow.com/video/index.jhtml?videoId=184113&title=john-mccain-reformed-maverick[/url] | |
Re: [QUOTE=digitaldesperad;698254] this my hel;p u[/QUOTE] Sure, maybe... if he was using PHP, but since this is the Java forum and his code is Java, your suggestion seems to fall a little bit short of helpful. And this isn't a chat room, so you can leave the IM-speak at the door. | |
Re: You can't - it's null. It has no value and the only context your method has for a relationship to a class is the parameter type, which you have denoted as Object. You don't mention the larger context of this usage, but it raises suspicion of a design problem that … | |
Re: [URL="http://java.sun.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)"]String.split(java.lang.String)[/URL] is also very useful for such things. | |
Re: Keep in mind that updates to Swing components should be done on the AWT event queue. [url]http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html[/url] | |
Re: I suppose we're to just reach down the "tubes" and put this together for you? ;) | |
Re: If you are trying to store a serialized object then you'd need to use the [URL="http://dev.mysql.com/doc/refman/5.0/en/blob.html"]BLOB type[/URL]. | |
Re: Try this method: [URL="http://java.sun.com/javase/6/docs/api/javax/swing/text/JTextComponent.html#setComponentOrientation(java.awt.ComponentOrientation)"]setComponentOrientation(ComponentOrientation o)[/URL] |
The End.