Forum: Java Apr 8th, 2009 |
| Replies: 8 Views: 2,406 you are trying to run the jar file
do you have this in there?
public static void main(String [] args)
i'm assuming you don't, but for a jar file to be run, just like any other code, it... |
Forum: Java Nov 18th, 2008 |
| Replies: 5 Views: 501 use the same for loop concept, put it at the bottom of the while loop
for(int i=0; i<index; i++)
{
System.out.println(num[i]);
} |
Forum: Java Nov 18th, 2008 |
| Replies: 5 Views: 501 you are doing a single check with the if loop
do a for
bool contains = false;
for(int i=0; i<index; i++)
{
if (number == num[i])
{ |
Forum: Java Nov 18th, 2008 |
| Replies: 22 Views: 1,282 depends upon the context, a lot of times you will check to see if bytesRead > -1 or sometimes you check for CRLF (carriage return line feed), other times you will pass how many bytes you will be... |
Forum: Java Nov 18th, 2008 |
| Replies: 22 Views: 1,282 i believe its because you have to "tell" the server when you are done sending, since you want the server to send the request back you have to say i'm done, now send the information |
Forum: Java Nov 18th, 2008 |
| Replies: 22 Views: 1,282 lol it is working and you are asking what is wrong?
what part doesn't work? or you mean why it didn't work before? |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 ah hah, forgot to look at the previous post, i've had some trouble, normally not, but sometimes yes, just want to try and eliminate all possibilities |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 and also just to make sure you aren't running client and server on the same machine are you? |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 sorry to bombard you with links, but here is another server example
http://fragments.turtlemeat.com/javawebserver.php |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 sorry don't have time to debug it right now,
are you getting an ioexception in the server from the first trycatch? |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 nm, think i was thinking of something else
can you please post the server and client code, at least the guts part where its sending and receiving |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 i don't think it will return null, until the socket gets closed
not for sure if this is the terminator, but did you check for "." (period) with crlf?
also check -1 |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 sorry, forgot it was java, here's a sample java tcplistener
http://www.koders.com/java/fid857615100E60AA30093DF6D87C3135D7AE75C4F5.aspx |
Forum: Java Nov 17th, 2008 |
| Replies: 22 Views: 1,282 here ya go, just needs slight modification on response and your listening ports
http://www.codeproject.com/KB/IP/tcpclientserver.aspx |
Forum: Java Nov 14th, 2008 |
| Replies: 5 Views: 984 try this
Character.isLetter('1'); |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 737 same lines as i am thinking, don't understand the need for an interface when its not used, and a getter that is void
maybe it is these instructors now days |
Forum: Java Nov 12th, 2008 |
| Replies: 8 Views: 737 if you are calling getArms or getLegs why should that return void? when you call a getter something should be returned, i guess he is just wanting output, but anyway beyond my rant
From i guess... |
Forum: Java Nov 11th, 2008 |
| Replies: 3 Views: 3,811 nice job catching your mistake
also do the the validate before repaint |
Forum: Java Nov 11th, 2008 |
| Replies: 8 Views: 558 you can do something like return a boolean
public boolean loadFile(){
boolean readFile = Boolean.FALSE;
try {
//load file
readFile = Boolean.TRUE; |
Forum: Java Nov 11th, 2008 |
| Replies: 5 Views: 451 you can pass parameters using
<applet .....
<PARAM name="param" value="value">
</applet>
in your init |
Forum: Java Nov 7th, 2008 |
| Replies: 3 Views: 1,094 i would create a method called isInSet and you iterate through the characters and check, you can't do a character check the way you are wanting to unless you add them to a list or an array of some... |
Forum: Java Nov 7th, 2008 |
| Replies: 18 Views: 3,629 and you are getting 0's for everything after you put in lets say 3 entries? |
Forum: Java Nov 7th, 2008 |
| Replies: 18 Views: 3,629 hmmm, i have the same code and it is working for me
this piece is above the while loop
if (grade>=0 && grade<=100)
the piece of code i meant |
Forum: Java Nov 7th, 2008 |
| Replies: 18 Views: 3,629 read closely at my previous post
notice 100.0
Apercent = (((double)Acounter/counter)*100.0);
i know you have an if statement before the loop, the problem is that you are reading inside... |
Forum: Java Nov 7th, 2008 |
| Replies: 18 Views: 3,629 looks like lowest grade needs to be changed a little bit
if ((lowest>grade) && (grade > -1)){
lowest=grade;
} |
Forum: Java Nov 7th, 2008 |
| Replies: 18 Views: 3,629 what about this
Apercent = (((double)Acounter/counter)*100.0); |
Forum: Java Nov 3rd, 2008 |
| Replies: 1 Views: 427 here is some pseudo-code for you
List<Book> usefulBooks;
int cashAvailable = cash;
booklist = query books by usefulness descending
for(Book book : booklist)
{
if(cashAvailable -... |
Forum: Java Oct 30th, 2008 |
| Replies: 4 Views: 859 You should have it, but here's the link
http://java.sun.com/products/java-media/sound/index.jsp |
Forum: Java Oct 29th, 2008 |
| Replies: 6 Views: 593 here's a tip
use while loops when you don't know the number of iterations (you never know when the user will type "no")
use a for loop for a known size
(for each hour in the day, have 5... |
Forum: Java Oct 29th, 2008 |
| Replies: 6 Views: 593 Sure thing, always show your effort and we will be more than willing to help |
Forum: Java Oct 29th, 2008 |
| Replies: 6 Views: 914 Ok, so you are meaning its correct then? |
Forum: Java Oct 29th, 2008 |
| Replies: 6 Views: 593 close, you need to make the loop go outside of all that, also please place code in code tags
System.out.println(" Do you want to enter information ?");
String choose = input.nextLine();
... |
Forum: Java Oct 29th, 2008 |
| Replies: 6 Views: 914 the problem looks to be this inside of stop_sub
commandString = fileScan.next ();
there is no command with it, therfore you are reading "output" inside of the stop_sub section |
Forum: Java Oct 29th, 2008 |
| Replies: 5 Views: 2,248 I'll give you a place to start
The problem you are running into is with indexing urls that are "urlrewrite"
This isn't specific to horse racing, its widely used, but theres a place to start |
Forum: Java Oct 28th, 2008 |
| Replies: 4 Views: 859 lol your guess is correct
either its not installed, or you need to add it as a reference or classpath or whatnot |
Forum: Java Oct 28th, 2008 |
| Replies: 1 Views: 355 The scanner constructor takes a string as a source to read from, the string is not a filepath
use this
File file = new File(fName);
Scanner in = new Scanner(file); |
Forum: Java Oct 27th, 2008 |
| Replies: 7 Views: 588 Agree with stultuske. You need to create something like a "wrapper" class. Lets say for example the jar file will load an employee, but you want to add a check if the employee is still active.
... |
Forum: Java Oct 22nd, 2008 |
| Replies: 9 Views: 557 Sure thing. Any other questions, feel free to post to the forums. |
Forum: Java Oct 22nd, 2008 |
| Replies: 9 Views: 557 no, that is a negative -1
then it will count
for (int number=10; number > -1; number--)
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
if you don't want to include the 0 set |
Forum: Java Oct 22nd, 2008 |
| Replies: 9 Views: 557 it will be this
for (int number=10; number >= 0; number--)
you must say, while number is greater than or equal to 0
i normally also try to avoid >= in for loops and use only > |