Top.Mail.Ru
November 9th, 2005 - Java developers — LiveJournal
? ?

Java developers

November 9th, 2005

12:58 am - gyrle - java problem

i've tried for awhile... maybe i am making it harder than it really is, but my method is NOT working or just not returning anything.

the method is suppose to search for a value in a binary search tree and then return it if it exist.

public NodeBST findNode( int searchKey)
{
int temp = root.getKey();
while (root != null)
// search key is at root
if (temp == searchKey) return root;
else
if (searchKey > temp)
root=root.getRight();
temp=root.getKey();

if (searchKey < temp)
root=root.getLeft();
if(searchKey=temp)
temp=root.getKey();
System.println("Found node: ");
return root;
}

09:49 am - taiidani - Compiling External Programs

I'm trying to make a program that will compile another program (long story) and I keep getting caught on this one piece of code.

When I send the javac command to compile the program, the program will lockup while waiting for it to be finished. It only happens when there are multiple classes that need to be compiled with the main class.
I assume it's because javac isn't finding the other classes to compile, but I haven't had this problem before. Any suggestions?

Code SnippetCollapse )

EDIT: Ok, so I found that I can just explicitly declare each file that needs to be compiled with the Main and, while it's a pain, it's doable. Still, this has brought up another question. How can I have my program determine if the (compiled) program had error messages or not?
Thanks for the help,
~Tai
 

12:41 pm - jvinicius - Clearing console screen.

Is there an easy and multi-platform safe way to clear the console screen in Java?
I mean, without using JNI, without making a for statement call System.out.println() several times or without using Runtime.exec().

I took a look into Google and found no satisfactory answers. It's hard to believe that java does not have an object or static function that clears the console screen automatically.

01:09 pm - localstorm - AWT problem under Linux

Good day, everybody!
I'm just a very young Linux user, and I'm really confused. I've installed JRockit JVM (from BEA) and all is well, but only until I start GUI application. It crashes down with "can't connect to X server :0.0" and it said about DISPLAY variable. May be someone had body such problem?

02:13 pm - zewrestler - jsp tomcat problem

Hello,

I am trying to get code for jsp working.  the problem is, everytime i try to run the code, i get the error seen below.  This happens with the latest version of tomcat. I have jdk1.5.0_01 on my machine as well as jre1.5.0_05.  The JAVA_HOME environmental variable is pointed to "C:\Program Files\Java\jdk1.5.0_01; C:\Program Files\Java\jre1.5.0_05"

I have no idea what to do. 
ErrorCollapse )

11:03 pm - zewrestler - One more question

I don't mean to ask like 20-thousand questions tonight.  also, forgive me in advance if this is a noob question.

In regards to my last question about tomcat not working, i have managed to borrow a different pc for the remainder of my project.  i will look into getting it working on a different date.

anyway, i'm still programming in jsp. I have a survey program that I am writting and between 12 questions, there will always be the same 2 options as answers. (something along the lines of true and false)   the options for the answer are written directly into the code using html. the following segment is the code for it.

<li style="background-color: rgb(155, 205, 100);"> Is this question true or false?<br>
    &nbsp;&nbsp;&nbsp;&nbsp; <input name = "choice" type = "radio" value = "1">True
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input name = "choice" type = "radio" value = "2">False
</li></ol>
<input type="submit" value="Submit survey"> 


Since my survey asks one question a page, how can i take the result submitted in the previous radio button code and put it in some sort of bean or string that i can manipulate.
Powered by LiveJournal.com