Forum: Java Oct 14th, 2004 |
| Replies: 7 Views: 5,151 Hi Kumar,
Attempt to do your homework yourself, and then we can help you along the way. We do not do homework for you here.
Ed |
Forum: Java Oct 8th, 2004 |
| Replies: 5 Views: 3,100 Hi,
Your program seems very sequential. In Any programming language it is generally bad form to have an extremely long function, so we can do better by dividing the task here into many functions... |
Forum: Java Oct 8th, 2004 |
| Replies: 7 Views: 6,928 I assume you are talking about a JList that you have populated with Strings?
Try a System.out.println(List2.getSelectedValue()). This will provide you with useful debugging information by... |
Forum: Java Oct 8th, 2004 |
| Replies: 7 Views: 6,928 The problem here is that you are calling FileInputStream.open() on a directory (D:\Sample_pics). Append a filename to the end.
Ed |
Forum: Java Oct 8th, 2004 |
| Replies: 2 Views: 2,044 It looks like you renamed the class. Either change all references to DataSet to DataSet3 -OR- change all DataSet3 to DataSet
//Make it like this:
class DataSet
{
public DataSet()
... |
Forum: Java Oct 8th, 2004 |
| Replies: 7 Views: 10,774 A JFrame can have a JApplet as content. Simply make the class a JApplet, and add the main function like what you see here:
Hope this helps!
Ed
// from http://www.devx.com/tips/Tip/16650... |
Forum: Java Oct 8th, 2004 |
| Replies: 1 Views: 3,569 Use a progress bar. The problem with simply telling the user "please wait" is that sometimes the user gets impatient and just thinks that the process failed. Most of the time the user will simply... |
Forum: Java Oct 8th, 2004 |
| Replies: 4 Views: 11,833 Don't have the .class at the end.
Just run the line
java ChatClientApplication
Hope this helps. ;-)
Ed |
Forum: Java Oct 8th, 2004 |
| Replies: 2 Views: 7,182 Which XML Parser are you using? Please post a code snip. |
Forum: Java Oct 8th, 2004 |
| Replies: 1 Views: 2,584 What error are you getting?
I strongly recommend you to reorganize the StringToken section of code I've attached below because it is easy to make a logical error the way you have coded it. It is... |
Forum: Java Oct 8th, 2004 |
| Replies: 2 Views: 3,877 Hi,
You don't have to modify the classpath if you put those jar files in your JAVA_JRE_DIRECTORY/ lib/ext. What Servlet server are you running? There are also standard locations in servlet... |
Forum: Java Oct 8th, 2004 |
| Replies: 2 Views: 3,642 Hey OurNation,
Yes it is possible.
The straightforward way to find the difference in time is to simply use Date().getTime()... |
Forum: Java Oct 6th, 2004 |
| Replies: 3 Views: 6,429 Check the Java Almanac entry for StringTokenizer (http://javaalmanac.com/egs/java.util/ParseString.html)---it is very useful!
String aString = "555-555-55555";
StringTokenizer parser = new... |
Forum: Java Oct 6th, 2004 |
| Replies: 4 Views: 11,833 To implement an interface (in this case ActionListener or ItemListener), you must write all the functions that the interface provides. One such function you're missing is... |
Forum: Java Oct 5th, 2004 |
| Replies: 7 Views: 6,928 Ok. Sorry last post. I just noticed this problem of yours. Using the "\\" is very bad. That is a platform dependent file separator. Instead consider using File.pathSeparatorChar... |
Forum: Java Oct 5th, 2004 |
| Replies: 7 Views: 6,928 This is where your cast problem is. You should never cast an object to a type that it does not inherit or implement. Instead you should just create a new file object.
f = new File(l); // where l... |
Forum: Java Oct 5th, 2004 |
| Replies: 7 Views: 6,928 Whoa... long convoluted question ;-). I hope I understand what you are asking. You simply want to copy the array of files to a particular directory?
If you simply want to move the file, try... |
Forum: Java Oct 5th, 2004 |
| Replies: 2 Views: 1,960 Hey Rishi,
Yes do look at the JVM specs (http://java.sun.com/docs/books/vmspec/). Sun provides the book for download in html form for free. :)
How much of an engineer are you? If you are... |
Forum: Java Oct 5th, 2004 |
| Replies: 11 Views: 4,099 Rentro,
You it it right on. Java actually has a substring function.
String substring(int beginIndex, int endIndex)
// Returns a new string that is a substring of this string.
See... |
Forum: Java Oct 5th, 2004 |
| Replies: 1 Views: 2,570 Struts by itself does not do XML. This article (http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html) at JavaWorld shows how to use XML in struts. I recommend you read up... |
Forum: Java Oct 5th, 2004 |
| Replies: 2 Views: 2,625 Hi,
Sun's tutorial about WindowListeners might be helpful:
http://java.sun.com/docs/books/tutorial/uiswing/events/windowlistener.html
Another good source of examples is the Java Almanac:... |
Forum: Java Oct 2nd, 2004 |
| Replies: 1 Views: 1,559 I assume you mean to do this in Java? I don't quite understandy your question. Please explain it again.
Ed |
Forum: Java Oct 2nd, 2004 |
| Replies: 3 Views: 9,098 What do you mean by quality? Quality can be a very subjective measure. Or do you mean most bang for your buck quality == most frames per second and large resolution per megabyte of compressed data?... |
Forum: Java Oct 1st, 2004 |
| Replies: 2 Views: 2,332 This isn't a Java question. You must register with a service like DynDNS (http://www.dyndns.org/) if you have a dynamic IP (which most likely you have, static IP is usually the more expensive... |
Forum: Java Sep 18th, 2004 |
| Replies: 16 Views: 4,802 psylocke,
Another suggestion: Since you have so many related variables (i.e. Label peglbl1, peglbl2, peglbl3) it may make your code neater if you used arrays.
Instead of multiple Label... |
Forum: Java Sep 18th, 2004 |
| Replies: 3 Views: 2,670 I don't want to solve your homework for you. Start thinking about how you will solve it and post your ideas/code snippets/pseudocode here. Then people will help you.
Ed |
Forum: Java Sep 17th, 2004 |
| Replies: 3 Views: 2,670 Tell us what it is you think you need to do with this code, and try to solve it yourself. you should just put the small snippet of code that shows how you would like to solve the problem, then we... |
Forum: Java Sep 15th, 2004 |
| Replies: 3 Views: 2,150 Hi,
I don't see where you call print 6 times. Did you paste the wrong code?
Next time, Please put your code in [ CODE ] [ / CODE ] tags.
Ed |
Forum: Java Sep 15th, 2004 |
| Replies: 4 Views: 2,552 Hi Paul,
The problem is that javac is not in your path. To add it to your path, first find where javac is. For me this is in C:\Program Files\j2sdk_nb\j2sdk1.4.2\bin. Yours may be different. ... |
Forum: Java Sep 15th, 2004 |
| Replies: 4 Views: 2,552 oops... I accidentally hit submit. see my next post |
Forum: Java Sep 14th, 2004 |
| Replies: 4 Views: 7,484 What's the point of downloading the source code? you aren't going to present an extension to the IDEs are you?
The source code for any of those projects will be mammoths if you are new to Java... |
Forum: Java Sep 14th, 2004 |
| Replies: 6 Views: 6,916 What are the errors you're getting? When are you getting them? at compile time or run-time? |
Forum: Java Sep 14th, 2004 |
| Replies: 16 Views: 4,802 I don't see any code... and try to make some headway into the problem yourself... it's bad to simply ask on these forums for homework answers. Try to learn something. |
Forum: Java Sep 14th, 2004 |
| Replies: 4 Views: 32,436 Uhh... it's generally a bad idea to leave the deprecated statements in. Usage of functions marked as deprecated is generally discouraged because usage of that function in that way has some undesired... |
Forum: Java Sep 14th, 2004 |
| Replies: 5 Views: 5,630 freesoft: It seems highly likely that your test was flawed. spawning new threads for every gui action is generally a bad idea.
There are many factors that could have caused the performance you... |
Forum: Java Sep 14th, 2004 |
| Replies: 5 Views: 5,630 Really the best way to speed up your program's compile time is simply getting a faster compute machine. I don't really see the point in inproving the compile time as you are not taking hours to... |
Forum: Java Sep 13th, 2004 |
| Replies: 0 Views: 4,793 I recently bumped into this interesting problem when writing code that used serial port communications. Writing data to serial port fails after ~ 30 seconds of use. Everything works fine for the... |
Forum: Java Sep 10th, 2004 |
| Replies: 3 Views: 2,025 Why don't you try out eclipse? http://eclipse.org
Eclipse was originally created by IBM. They named it Eclipse not as a joke on Sun, but rather they felt it was the best thing they ever created;... |
Forum: Java Sep 10th, 2004 |
| Replies: 2 Views: 4,543 Hey sani,
Don't forget that you can always simply execute a command on the command line for this.
I remember back in the dos days doing lots of 'attrib -s +h' commands before... |
Forum: Java Sep 10th, 2004 |
| Replies: 1 Views: 2,491 Hi,
You need to have the function
public void actionPerformed(ActionEvent e) {
}
in any classes that implement ActionListener. Basically this function is called when something happens to... |