Search Results

Showing results 1 to 40 of 83
Search took 0.02 seconds.
Search: Posts Made By: cosi ; Forum: Java and child forums
Forum: Java Oct 14th, 2004
Replies: 7
Views: 5,151
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
Which XML Parser are you using? Please post a code snip.
Forum: Java Oct 8th, 2004
Replies: 1
Views: 2,584
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
oops... I accidentally hit submit. see my next post
Forum: Java Sep 14th, 2004
Replies: 4
Views: 7,484
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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
Posted By cosi
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...
Showing results 1 to 40 of 83

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC