Please help me with this.I need to know how do i save a file, i am using FileDialog.LOAD and i need to know how to use FileDialog.SAVE, the thing is, i'm using a TextArea where i write something and i have to save this in a txt file.how do i do that.Tanks for helping ...
How do u get a decimal to work on java..like for a calculator? I have no idea how to do it because there's no way to do exponents in Java, apparently.public void pressOne () {if (wholeNumber= true)display = ONE + display * 10;elsedisplay =
519 byte By
vahedasa at 2007-9-29 15:47:32
I'download jakarta-regexp-1.3.jar file from jakarta-apach site for validate a email adress..But i did not find any doc to telle me where put this file..I put it in the jre subdirectory of my sdk directory but the javac compilerdo not recognize this part of my code import org.apache.regexp.* ...
403 byte By
shaninaa at 2007-9-29 15:50:55
Friends,I want to replace some values in the property file from my java application.ie my propert file contain a key value pairdefDir=<dir name>I want to set this value from my application.ie I ahve to change the value in the file from my application.I am useing ResouceBundler for reading ...
HiWhat the difference between Thread.currentThread().getContextClassLoader().loadClass(value) and Class.forname(value)?I'm using property files and storing the name of class file in propert file .I want to use Class.forname(value).In that condition how I'll create the instance of the ...
213 byte By
steppe2a at 2007-9-29 16:02:34
Is there an Object that can contain more text than a String (more than 255 characters)I need an Object to store the text of a message on a forum ...Any idea?thanksgrsteppe
208 byte By
husanea at 2007-9-29 16:07:27
Hi,When a thread is executing in a static synchronized method on a class, can any other thread execute in a non-static synchronized method of an instance of that class? thanksroger
Hican someone tell me how to embed a command line in my java code?for example to send email using my java program. The operating system can execute this command line.Is it the system class? Please help.Thank you.
370 byte By
patelk9a at 2007-9-29 16:09:18
Hi,I am trying to format a string e.g. "ou=Applications"to just extract the "Application" part of the string?I think you can use the StringTokenizer class and "=" as a delimeter, but I tried that and it did not work for me!Can someone please tell me how to do this and give me an example piece ...
Hi allI hope someone over here might answer my problem. I need to run a Shell script form my Java code, which does perform some operations like writing/copying files to a specific directory and my Java code then starts reading the files and do necessary stuff like parsing it for some info ...
What are the differences between java.util.date and java.sql.date?
Hi,1) I want to know is it possible that we can send a class reference in url.2) How to type cast the String into User defined class reference variable.I've written these in my fileObject obj = (Object)req.getParameter("credentials");credentials = ...
5267 byte By
patelk9a at 2007-9-29 16:23:38
Hi,I am running a JSP page, which contains two HTML forms. I have given the part of the code which I am having trouble with below. The forms basically submit a field from a drop down list (call it "dropdown list 1" for explaination purposes), which according to what is selected, populates ...
520 byte By
elensiaa at 2007-9-29 16:28:50
Hi,all. I'm a fresher of java programming.I want to know the execution order of the follow class:public class example{int aProperty = 10; // No. 1private example(){// No. 2...}public static void main(String args[]){....} // No. 3}Can you help me to ensure the execution steps of No. 1 2 and 3 ...
Hi,I am trying to read keys from resource bundle to enumeration object.the code i have written is Enumeration enum = bundle.getKeys();this one adds keys odd number keys first and even number keys later ( i,e 1,3,5,... later 2,4,..) I want keys in order , how can i achive ...
1398 byte By
Erictoma at 2007-9-29 16:31:38
Hi, I am trying to read data into ByteBuffer using SocketChannel.The following code working fine but the problem is with ByteBuffer size.The data varies from request to request .How do I read data into ByteBuffer with out specifing size .The problem with size is some records has more than 500 ...
242 byte By
aliaga at 2007-9-29 16:35:58
Hi, I want to know how does synchronized work. There is one object which has two synchronized methods, if one thread visits one method, other thread can visit another method at the same time?Thank you.Regards,aliag
If we have to do custom serialization we have to implement private void writeObject(java.io.ObjectOutputStream out)throws IOException private void readObject(java.io.ObjectInputStream in)throws IOException, ClassNotFoundExceptionWhere is the default implementation of these methods? if it is ...
Hi Java Gurus,Similar questions have been asked on this problem. But, I have not come across any feasible solution that works!I have also seen that most of the work arounds given is to use threads.I tried, but not able to interrupt the main thread.Here is a snippet of my code. public MyClass ...
HiI have written an application which reads records from "transaction" table and inserts in another table ("master") and deletes the record from "transaction" table from where it picked. Later it will process the few columns of the record to some other application and finally some changed ...
hello sir,i want to know that , how we can create .exe file in java. If yes, then help me in details.
hello sir,i want to know that , how we can create .exe file in java. If yes, then help me in details.
hi all,We have this application based on client server architecture.Client and server are more or less symmetrical.Now the problemis code works fine when we run it on same machine but when we runclient and server on two different machines program raises exception.File is transferred without any ...
724 byte By
DK21a at 2007-9-29 17:02:23
hi all,and thanks a lot for your help.I have created the following class which as you can see creates an object and can sort an array of such objects with respect to the deadline variable using the compareTo method.import java.util.Date;public class Task {Date deadline;long runtime;public int ...
1706 byte By
achsasxa at 2007-9-29 17:10:50
Hello!I have a very strange problem with the following piece of code:public class Acquire extends ....{private Panel panelTimer;private JPanel panelMode;public Acquire() {panelTimer = new PanelTimer();panelMode = new PanelMode();panelTimer.doSomething(); // works fine ...
I need to know how to make a custom_cursor.The thing is that i need to change the cursor "image" to a gif image.I know that there is a way to do it.Please somebody help me.Tanks
Hi all,Please, can you advise me?I want to check if two variables are instances of the same class. It can be done by the following line, but is it full proof? Or is there a more elegant way to do this?a.getClass().getName().equals( b.getClass().getName() )Many thanks.Best ...
56 byte By
DPJavaa at 2007-9-29 17:35:22
A philosophy?A style?I dont know...
Hi,can anyone suggest some good charting / graphs apis/tools that could be used for browser ( image based or through applets ).Thanks
we are facing different kind of problem in Netscape 4.8.First user will enter number of images to be upload. Once user selects the number of images, click on submit, we will display number of applet that user enters. Its working fine in IE and Netscape 7.x. But we are facing problem in ...
242 byte By
hoshawna at 2007-9-29 17:44:53
Hi, Here is what I want. A user clicks a "Help" menu-item, and it opens "Help.pdf" or "Help.doc" automatically on the screen without a JFileChooser. If anyone has an idea, please, help me. Thank you.
268 byte By
hoshawna at 2007-9-29 17:44:59
I add a JtextArea to a JScrollPane. The JTextArea reads contents from a file, so the thumb of the JScrollPane goes all the way down. After that, how do I make the thumb move up in my code? That is, how do I control the position of thumb?Thank you.
3133 byte By
lupegara at 2007-9-29 17:47:04
I have created a try-catch statement, I have also created a home made Invalid value exception class. I have also thrown the InvalidValueException in a calculate method in a seperate class. I am getting the error of unreachable catch block. Here is my code for this process. Please Helpprivate ...
71 byte By
lupegara at 2007-9-29 17:47:06
Does anyone have code that will extract classes from a jar file?
I encounterd this problem when programming with socket:On my server side, I construct ObjectOutputStream(socket.getOutputStream()) each time when socket is getted by handler from queue, and the client side, use ObjectInputStream(socket.getInputStream()) to accept responses. But the problem is, ...
Hi, all, Have there someone be familiar with JExcel?I have a problem when I try to write some data into a xls file.I want to merge two cells, and how can I do it?Thanks in advance.
when i run following code by $java check3nothing happens, no output comes, neither does the program terminate : import all;public class check3{public static void main(String[] args){ try{ String filename = "receixxveridfdfdf"; RandomAccessFile rf = new RandomAccessFile(filename,"rw"); ...
I have a bean class, which accesses a data access object interface and the concrete class that implements that interface; therefore, I have a statement like:EditorDAO ed = new MySQLEditorDAO();There is a static method in this bean class. I got a compilation saying that the instance with the ...
Hello, I need if somebody can help me to find the serial number of the "license enterprise" in this file of javaThis software I need much and the price is much money and I cannot buy itThe java code it can find it in http://www.rpdgratis.com.ar/radius.txtThank you very much ...
HiCan anyone help me out with sockets. I have created a client socket which will continuously listen at a port for data. But there is sever problem that its taking 98% of CPU usage. can any one help me out with better programming techniques.note: my socket should listen continuously as my ...
Hi,The proper way to stop a thread seems to set up a flag in the thread. The thread just have to check the flag to know if it has to exit.In my case, I have a thread reading a BufferedInputStream.The read() methods of InputStream are blocking, so how the thread can check its flag ?Any idea ...
717 byte By
cvidyawa at 2007-9-29 18:12:23
We have a server talking to client through socket. Server is reading from the socket using ObjectInputStream.readObject().When no messages are sent from the client, say for about 2 minutes, we are closing the ObjectInputStream through another thread spawned from a timer task. In Java 1.3, when ...
Welli need to know how to convert strings to binary data ("Chapter One">100111000011) to compress them using Lempel Ziv compression algorithm, and print a new file with binary codes.I know that i have to use OutputStream and ImputStream classes, but i don know how it works...Please help me ...
how can i convert a binary code like [B@18fe7c3 into a Vector ?first i did this:Vector a= new Vector; // create a vector...//addElements.......String b=a.toString();//(b=[12, 2, 234, 5]) vector to stringbyte [] c=b.getBytes(); //string to bytesString d= c.toString(); //c="[B@18fe7c3" bytes to ...
looking for java implementation example of single signon ? thank you.
Hi ,Pls help me to identify the empty tokens.I'm using SteamTokenizer to parse the csv file.I need to treat all characters in the text as word and at the sameI need to identify empty tokens.Below is code that I have written. Right now it is unable to identify Empty tokens.The line to be parsed ...
518 byte By
Dr_Dukea at 2007-9-29 18:25:51
hi,I'm sending different sizes Datagrams from a datagram socket so how can I receive them I've tried to send the packet in two packets the first one is fixed size that carries the size of the real data then create a suitable buffer on the client side to receive the second packet but the ...
We use Thread.start() method to start a Thread Process , which internally calls run() method. why don't we call run() method directly? what does start() method do internally?
How can we stop a Thread without using Thread.stop() method?
Hi friends,I have a situation where I need to convert a word document to html document using java.I dint get any idea about this. Can any one help on thisthanks in advance.Srinath.