console combined with sleep command

311 byte By pelegk2 at 2007-9-30 14:23:10
what i want to do is this :i want a console to wait for my commandand on a key pressed to check the key and call the relevent functionat the same time i want a certain function to happen every 10 minutes for exaple|!is this possible?thanks in advancepeleg ...

Help please: Vector, its components and the variables of its components

3061 byte By Peter@Smith at 2007-9-30 14:23:12
Hi guys,somebody know why and how I can work out the following problem? The below FIRST small program works, but the problem is that I need to uso the components vectors and their variables many times in different parts of a big program, and they are more complex objects. I need to be able to ...

encoding Weka and Java

786 byte By GraziaR at 2007-9-30 14:23:29
Hi, has anyone in this forum ever used Weka, the data mining software ? I really hope someone has. I just realized that when reading an .arff file (the .arff is jsut the format of the input files required by weka), there is no way I can specify the encoding of the file for weka. Even if I make ...

Change console

154 byte By must41 at 2007-9-30 14:23:36
I made a console-based program ( System.out, System.in ) how can I change the console? ( most users do not enable the console in the prefs )

Inheritance question

495 byte By brokolyx at 2007-9-30 14:23:39
I have a superclass Accountand two seperate subclasses Savings and CreditBoth Savings and Credits extends Account In my main i have an object like this:<code>CreditAccount customer1 = new CreditAccount();SavingAccount customer2 = new SavingAccount();</code>I was just wondering how ...

Inseting a char in a string?

203 byte By chadorbaf at 2007-9-30 14:23:50
Hi,Any method available to insert a character at a specific position in a string?example: st = "abde"< Original string st= "abCde"< Add "C" in position 2

outofmemory while creating a new object of file with size more than 100 MB

373 byte By g_chandra04 at 2007-9-30 14:24:05
I have created an application which generates a report by getting the data from our archived files (.zip file).By the time, the application is reaching a file with size more than 100 mb, it is running out fo memory while creating the object of that particular file. Can some one help me by ...

Detecting Connections on a socket

7655 byte By ZionStorm at 2007-9-30 14:24:13
Im very sorry if all this sounds confusing but there are several questions i have to know the answer toI have been working the past hour or two on a chat program. When a client connects ot the server the client sends an object over a stream that contains the value of the client's username and ...

PrintWriter BufferedWriter JspWriter FileWriter- HELP!

803 byte By vikingsteve at 2007-9-30 14:24:20
Help!I am confused. So many Writers!I wonder if someone can recommend an elegant solution.I am writing some utility classes that write to output. This output could conceivable bea) a web page (thru JspWriter)b) a file (thru FileWriter I guess)and it needs to be able to write to either of ...

implicit SSL

101 byte By te0543 at 2007-9-30 14:24:24
How does the implicit SSL and explicit SSL work in ftp?I have to know in detail.

doubleToLongBits

151 byte By Dcaptain at 2007-9-30 14:24:26
hello,does anybody know where can be find the source code(implementation) of the doubleToLongBits(double) method?thank you.

JPanel and Layout Managers

3915 byte By rjmad at 2007-9-30 14:24:29
Hello, I have written a very basic JApplet program. The output is supposed to be 4 JPanels in a Grid layout, with 4 buttons within each of the 4 JPanels. I believe I have achieved that output, but am not 100% sure, as I am just learning about Layout Managers and the JPanel class. If anyone ...

Mouse Listener

520 byte By Szityu at 2007-9-30 14:24:30
I guess I'm one of those rookies..I'm trying to set up a mouse listener to my Panel. I'm using lots of labels on that panel, but when I click on one of those labels, the program doesn't seem to react. I don't really like to use separate listeners to every label, coz their are too many and ...

String substring

149 byte By widiyantosg at 2007-9-30 14:24:31
Hi,I just want to ask how to make "c:\OS\example.java" to "c:\\OS\\example.java.Thank you..any sample code?

java certification logo

276 byte By suzzcoffeecup at 2007-9-30 14:24:35
Is there a logo(soft copy) which Sun gives you after passing the java certification? I thought I saw a section somewhere which said something like that. If thats true, I would be appreciate it if someone could point me to where i can get it.Thanks.

How can I to write swap()

976 byte By Generics at 2007-9-30 14:24:38
There are tow objects named objA,objB.I want to swap them.How can I to write the function code to complete!public void swap(){}There is a resource:import java.io.*;public class TestSwap{private String str;public TestSwap(String str){this.str=str;}public void print(){System.out.println("This is ...

objects and initialization.

330 byte By xviddivxoggmp3 at 2007-9-30 14:24:48
why can i not instansiate a global class object, then initialize it later in a member function?I keep getting null pointer exceptions everytime i do this.doesn't an instansiated class work as an address pointing to that object?I get this even if i pass it to the function as a reference. ...

Problem matching JTextField input to an item in a JList box

1412 byte By MizzK at 2007-9-30 14:24:49
Hello,I am trying to read the user's input in a text field and take the user to a match in a list box located underneath the textfield. To do that I have implemented the following code:m_pathwayNameTextField.addKeyListener(new KeyAdapter() {public void keyTyped(KeyEvent e) ...

inputstream coupled with buffered reader

611 byte By sumit_johar at 2007-9-30 14:25:02
I am using buffered reader coupled with inputstream reading from a socket.i use following code to read the message from the bufferedreader. char[] buff = new char[msgLength]; is.read(buff, 0, msgLength);it works in most of the cases , but fails when being used with firewall which divides the ...

java compilation and several other questions

1072 byte By Andrew_sg at 2007-9-30 14:25:07
I have several questions:1. Consider two java programs, one use package by import packages. Another is just put all classes and files in one folder. What are the differences in terms of the compilation process, compilation time, execution speed, class file size, and memory usage at runtime?2. ...

Anonymous class replacement

1528 byte By huskerch at 2007-9-30 14:25:11
I wonder if there are any thoughts on the following technique. I have a real distaste for anonymous classes; while I understand the convenience, nothing can blow up a nice compact method like a bunch of braces. So I have come up with the following:public class Utility{public static ...

regarding certification

349 byte By saravanaaz at 2007-9-30 14:25:23
Hi,I have taken my SCJP ceritification, Iam thinking of taking the next level certification can someone suggest me in this regard. which one could be better, I have three options webcomponent developerarchitectIBM UML ceriticationpls help. u will get dukes too :)regards,saravana ...

module communication via reflection

1314 byte By Paladin123 at 2007-9-30 14:25:35
Morning all, I need some urgent help on a reflection situation i have. here's the setup: I have a "container" that has the ability to load modules or module groups these are typically jpanels thatperform some or other database processing. My problem is this: I need these modules ( they are ...

NoSuchMethodError

743 byte By pollacchi at 2007-9-30 14:25:51
I am getting the following message: java.lang.NoSuchMethodError: Move.<init>(LPosition;)Vat PartialMove.convertPartialToFullMove(PartialMove.java:250)at MoveGenerator.buildMoveList(MoveGenerator.java:117)Even though at line 250 I have : Move m = new Move(dp); and the move constructor is : ...

Java 1.5 autoboxing and conversion

203 byte By kasper@itu.dk at 2007-9-30 14:25:59
Hi,What is the correct cast sequence for this.Short s;Integer i = 8;s = (short)(int) i;This works, but seems somewhat ackward. Any better?-- Kasper

Problem with Vectors and ObjectOutputStreams

3812 byte By ZionStorm at 2007-9-30 14:26:00
Ok i posted some of the same stuff earlier for a different problem. I just realized that not all my clients are recieving the same information. I have implemented some output statements to show the information being sent from the server to the client and such. The server does send data to all ...

How to use a class as a repository

392 byte By Alberto_Vaghi at 2007-9-30 14:26:10
Sorry if I write again...but I'm in trouble.Well I have some info I have to pass from frame to frame; someone some days ago suggested me to use a class (eg. Vector) to keep these info. Ok, but how can I? I use RMI. Client calls login function that retrieves from DB infos and returns a User ...

file timestamp

559 byte By bigandyt at 2007-9-30 14:26:13
i want to create a file using java that contains a timstamp for examplebookmark020704.csvso it is like "bookmarks" + date and time + ".csv"any suggestions on how to do this? as what i am doing at the moment isnt workingtry {Calendar calendar = ...

how do i get the current time and date?

53 byte By pelegk2 at 2007-9-30 14:26:14
how do i get the current time and date?

tree formed from database

956 byte By mykybaby at 2007-9-30 14:26:16
I have a table of values stored similar to this, BaseNumber NameUniqueNumbernull Parent 11Child21OtherChild32grandchild4In the above table a 'null' value in BaseNumber signifies that an entry has no 'parent'. 'Child' has a BaseNumber of '1', meaning that it is the child of the entity ...

Boolean hashCode

181 byte By dcminter at 2007-9-30 14:26:17
Why is Boolean's hashCode method defined as returing 1231 (true) and 1237 (false) ?Are these values arbitrary, or is there deeper magic behind it ?Dave.

tree formed from database

1003 byte By mykybaby at 2007-9-30 14:26:18
I have a table of values stored similar to this,BaseNumber NameUniqueNumber nullParent11Child21OtherChild32grandchild4 In the above table a 'null' value in BaseNumber signifies that an entry has no 'parent'. 'Child' has a BaseNumber of '1', meaning that it is the child of the entity ...

Reading from a string.

847 byte By cj. at 2007-9-30 14:26:21
Sorry, I am only new to java, and am having some troubles.Here is the probem i need a solution to:I need to read a sentence from keyboard entry, i've done that, i need to convert all non-letters to a space, i've done that. The next part is the part im struggling with:I have to read each word ...

writing log file

126 byte By pelegk2 at 2007-9-30 14:26:38
i want on every exception that occures to write a Log file how do i do that?thnaks in advancepeleg

array length

259 byte By viaphone at 2007-9-30 14:26:43
I define an array and assign value to it , and I want to appent it , how can I do it with all element remained there unchanged ? such as , and I want to the 3rd element to it ! int intArr [] = {1,2} ;

getSource()

1034 byte By megabyte214 at 2007-9-30 14:26:53
When using getSource() is it better to use equals() or ==. I did it both ways and they both worked. I learned that I am suppose to use equals() with Objects and since getSource() returns an Object, I would think that I would use equals(), but, every example that I have seen uses ==.public void ...

convert empty value("") to Integer object

394 byte By SAIRAM_VENGALA at 2007-9-30 14:26:54
Hi,Is it possible to convert empty value to Integer object?Actually i had an xml element which is empty specified like <day\> and I want to store the value extracted from this as Integer object.I tried with Integer.valueOf(e.getchildText("day")) But is is giving NumberFormatException ...

more random

264 byte By David_Green at 2007-9-30 14:27:01
Ihin my class I using Random instance, I notice that the random has strong inclination to choose the first numbers of its range. I'm not using any seed(and I dont know what it is) . how can I make it mare randomly?thanksD

some explnations needed

199 byte By David_Green at 2007-9-30 14:27:02
HiI've explored some of the classes in java, I saw some combinations I dont understand. What is the use of return without a n element to be returned?ThanksS

Ant Task through Web

298 byte By mraheel at 2007-9-30 14:27:09
Hi,Is it possible to run a Ant Task from a web interface. What I want a nice little web interface with some buttons on it like Run JavaDoc, Deploy, Compile, Unit Test etc and when a developer clicks on any of the buttons, performs ANT Task.Any ideas? Thanks

Java GUI problem

138 byte By kingzl at 2007-9-30 14:27:14
How to create a java gui map with the coordination? Grid layout? Or can just do with the JPanel?Thanks.

Java Tutorials

321 byte By varkys@home at 2007-9-30 14:27:24
hello allI am a programming enthusiast and a lover of java. I would like suggestions on where i can download java tutorials on how to create my very own components(by extending Component) and also how to write events and event listeners. I would also like tutorials on java beans, and enterprise ...

hi all

726 byte By IamJoeBlack at 2007-9-30 14:27:25
I am developing one HTTP client software and saving response times.I use the following algorithm to get a specific file from HTTP server.(socket connection and URL stuff...)time1BufferedInputStream bis = new BufferedInputStream(url.openStream());time2while (( bis.read(buff,0,BUFFER)) != ...

java and sql

1385 byte By kacalyci at 2007-9-30 14:27:28
Hi there I have the following code and it seems that the sql query isn't correct. when i try to display the data from the resultset it gives an invalid cursor state. i have checked the query by trying it in the access databse and it works fine. Can you please telle me where's the prob ...

NetBeans modules

528 byte By GuitarManARS at 2007-9-30 14:27:30
(Sorry if this is the wrong forum, not sure where to put this...)I'm using the metrics module for NetBeans. It opens a class file and analyzes it, returning various software metrics (or complexity measures). However, I would like to be able to create a Java program that allows the user to ...

Please help with JSP collaborative application

387 byte By Jhon_Larsson at 2007-9-30 14:27:40
I need information over an Java/JSP open source Web-Enable collaborative Application runnable embedded in a Standard Web Browser such as Internet Explorer or Netscape Navigador that include some of this features: Instant Messaging with roster and groups management, file transfer, chat, ...

Check to see what programs are running

143 byte By matp93 at 2007-9-30 14:27:41
is it possible to make a program that checks to see what other programs are running on the computer (For Example: Microsoft Word)

InflaterIputStream & ZIP - GZIP

784 byte By ajtait at 2007-9-30 14:27:49
We have a number of clients in the field that are making an HTTP request for data. The data is compressed with DeflaterOutputStream on the server and then inflated with InflaterInputStream on the client.I need to develop a version of this client that does not depend on a JVM. Both ZIP and GZIP ...

Key event without focus

364 byte By ryusasai at 2007-9-30 14:28:02
Hi,Could you tell me how to get F1 key event which is nothing to do with any control's focuses?For example, suppose there's a button saying "F1 exit",and the focus is on some other button.In such case, if user pushes F1, program should exits.That's what I want to do.Thank you. ...

ResultSet methods dont work...?

2808 byte By moerderin at 2007-9-30 14:28:03
I'm trying to get the primary key for the the row that I insert into the database. every time i use any of the ResultSet methods the program goes all haywire goes into some kind of infinant looop (at least thats what it seemd like when i debugged it line-by-line) here's my code: (by the way ...