I need to store "500 choose 30" numbers and pass each of those to a function to calculate f(x).Then I want to sort the numbers say based on ascending order of the result f(x).... what is the best data structure to use. I don't think I will be inserting/deleting items in the middle. The only ...
10186 byte By
weebib at 2007-9-30 14:06:40
Hello.I have been doing my own utility class for zipping directories into a single file. Credit given to whomever will recognize part of his/her own code collected on this forum.Here is the result :import java.io.*;import java.util.zip.ZipOutputStream;import java.util.zip.ZipEntry;import ...
I have a question about when static initialization takes place. Actually, I guess I understand that it takes place at class load. I guess the question is "when does a class get loaded?" Is loading guaranteed to be as lazy as possible?Consider the following program. Assume that there is a file ...
Just being dropped into a project here and we are currently at the design stage ... (sorry, THEY are at the design stage, I'm just lost )All I hear is talk about Interfaces here, there, and everywhere. Do I understand correctly that you can lay out the skeleton of an application using define ...
Hi,Can anyone of you suggest a nice project in java?I am BTech II year student.
I am getting a strange result when I multiple two double. For example I am doing this:double wage = 5.15;double hours = 45.00;System.out.println(wage*hours); Gives a result of: 231.75000000000003why is it printing all the zeros and a 3? ...
380 byte By
waiII at 2007-9-30 14:07:06
i need to write a program to read the latest stock information from some websites,then summarise the information to generate some reports in my final year project.It is because the format of these websites may be changed , so it is difficult to extract correct information from these websites. ...
577 byte By
xixso at 2007-9-30 14:07:07
Hi this is a simple problem, I am just confused over this, I am pretty sure I know what I am doing, but just wanted to be sure.what does data.toDispatch() signify in element form. and the method toDispatch is in class variant defined as public native Dispatch toDispatch();but there is no method ...
4090 byte By
quaxi16 at 2007-9-30 14:07:08
Well, I tried to programm a little server programm (client later)...It opens up a java.awt window (success :) and opens up port 3000 and is listening... But I have not understand what to do now - (the lines down there are copied with the date). Any help pls :) import java.awt.*;import ...
Hello, I am getting an OutOfMemoryException when I am initializing a new array of bytes:byte[] barr = new byte[Integer.MAX_VALUE];Why? Thanks,Corrine
String FileS = JOptionPane.showInputDialog(null, "Please enter path to file:", "Getting Pathname", JOptionPane.QUESTION_MESSAGE);String FileP = FileS.replaceAll("\","\\");This is what I have how can I get it to work?
1430 byte By
JDGizmo at 2007-9-30 14:07:19
Hi Guys,In my run() method, I am making a call to a method from an object provided by third party...now sometimes it just takes forever for that method to return the response back and we have to impose restriction to abort it if it is taking more than some amount of time. I tried to read some ...
Been doing excercises from the Thinking in Java book, the bit I am stuck on is:"Create three interfaces, each with two methods. Inherit a new interface from the three, adding a new method. "I can create the three interfaces and create a class whitch implements the three interfaces but cant work ...
212 byte By
zcox456 at 2007-9-30 14:07:28
I've seen documents and posts about where the Preferences API stores preferences on Windows (registry) and Linux (/etc/java and $HOME/.java), but does anyone know where they are stored on Mac OS X?
when you google for"introduction to JSP" google asks if you really meant "introduction to ASP" lol
1241 byte By
javan00b at 2007-9-30 14:07:41
Hi,I am trying to see if there is a way I can just get the directory structure of the current file open, because I want to be able to have any window that opens open to the last used directory. I want to be able to store the directory information minus the file name and extension. Here is the ...
Hi I am trying to sort an object array of two arrays in descending order in any way other that Bubblesort.int [] intArray = .....;String[] stringArray = ......;Object [] arrayofArrays = {stringArray, intArray};How is the best way of sorting these?I have tried using a comparator but it fails to ...
I definitively not a regexp expert ! ;)Here's my problem.I'm working on a string that looks like :sin(1)+12.22-x2+x3+1/x4+1*17+56*ln(32+sin(26*x1))+exp(58)+1+ln(12)+sin(26)+pow(2,3) etc etc ....This string is built by an user, and I have to refactor it so that the jvm could understand it.x1 ...
3227 byte By
Devyn_ at 2007-9-30 14:07:57
Hi,I've searched this forum for a suitable answer but nothing solved the problem. I'm trying to get a gif to animate on a JLabel. I overwrite 'imageUpdate' and 'paint' to refresh whenever 'FRAMEBITS' and 'ALLBITS' flags are true. I tried to use ImageIcon but the result is the same. ...
How do i cast between the two date classes.Sorry if this seems really easy i'm now really stuck.Thanks in advanced.Tom
823 byte By
gmoniey at 2007-9-30 14:08:07
Hi,I have an application, which writes class objects to file, and then reads the class objects from file when the application is started up.Now the problem is, that if i create/modify/etc fields in the class, then all my data is lost (i.e., i cant read the data in when the application ...
Hi. I need to have running only one instance of my application which is a single stand-alone program. It is invoked from a .bat file, how can i do that? Any ideas?Marla
173 byte By
Stanzi82 at 2007-9-30 14:08:16
Is there any possibility to access a virtual COM Port with java?I could not find any information about it in the API reference?thx
166 byte By
Stanzi82 at 2007-9-30 14:08:17
Is there any possibility to access a virtual COM Port with java?I could not find any information about it in the API reference.thx
I have successfully implements a state_changed method to handle clicking on the tabs in my JTabbedPane. However, I notice that the state_changed method not only gets called when I click on a tab, but also when I dynamically create a new tab. This is something that I do NOT want. How can I ...
277 byte By
pliadies at 2007-9-30 14:08:37
I am continually getting the following message on screen "Java- Exe The procedure entry point re-initialise critical section could not be located in the dynamic link library Kernal 32 DLL". I am a novice and I would appreciate any advice to sesolve this problem.
737 byte By
pre_pra at 2007-9-30 14:08:45
Hi, I have this jar file named "Lm.jar" which is purely developed in java. Also, i have this CVS to track the code everytime i make changes. in CVS this jar application has a new version number everytime i do modifications. But i want to distribute this version number explicitly along with the ...
9404 byte By
cloudjun at 2007-9-30 14:08:46
I was searching for some code which can read/write windows ini files in the forum, but no one is suitable for me. So I wrote the following class. It can browse the ini file, and update a certain key in a certain section. Hope it can save time for someone who is looking for the same thing as I ...
dear folks,I have created a Process from an exethis exe prints out something to the screen in the beginning as the following(matlab code)//in the beginning fprintf('status=0.1\n');//does more work I monitor what this process prints out by doing the following:BufferedReader br=new ...
Hi all -I am trying to work on an sending SMS in java program.when I type the SMS commands in the hyper terminal, all of them end up giving an OK response but in my java program, only AT+CMGF returns OK while AT+CMGL does not. In both cases I was appending a line feed.Can some one please elp me ...
344 byte By
jfreebsd at 2007-9-30 14:09:26
I'm starting at a young own soft. company wih other members and was wondering what kinda of software should I built according to the enterprise needs, etc so I would appreciate if someone on the market can tell me ideas of a software that can be pretty asked lately, etc, etc.All suggestiong ...
2215 byte By
war59312 at 2007-9-30 14:09:57
Hey,Trying to tech myself java. Doing pretty good I guess since its only been a few days now.Anyways, how do you get a string from the keyboard so it would work with my below code?Now I know its not any where near complety I just cant figure out how to get the damn string instead of an ...
Trying to execute a java program which uses the java.util.logging for logging the debug statements on the linux Advanced Server with jdk 1.4 gives the following error:Any inputs for resolving it will quite helpful. Can't load log handler "java.util.logging.FileHandler"java.io.IOException: ...
hi, I want to read the "Current Date in (DD/MM/YYYY) format " using java script. i need to store that date in a variable & then compare that variable with other date of same format. pls help me how can i do that. thanks.. Deb
I want to know what is Hex Dump? I tried to search in google butdidn't get useful results. From java programmer's perspective,when do we need to use hex dump? what's the importances of hex dump?please advise. thanks!!
546 byte By
VktrVktr at 2007-9-30 14:10:13
Hi !I want to write my own JTextField, and set my setText() method. for example:JTextField jt = new JTextField(String str) { public void setText() {myFunction();blablablah}}Well, after that I cannot se text to this JTextField, because setText function is overloaded.How to wvwrload setText ...
From where I can download JDK1.02 its urgent.Kindly respond ASAP.
Hi,I want to encapsulate a logger , log4j for example. At first sigth, I wrote this :public class MyObject{private Logger mylogger;public MyObject(String myclass){mylogger=Logger.getLogger(myclass);}public void debug(String message){mylogger.debug(message);}....}The pb is : when you call debug, ...
1052 byte By
Dcaptain at 2007-9-30 14:10:41
i understand that floating point numbers are represented in java at binary numbers..and that there are decimal values that cannot exactly representable in binary..one of that i think is 0.1but why is it that 0.1 can be represented exactly but in the computation it cannot.i have this ...
278 byte By
MOctav at 2007-9-30 14:10:43
I have a EPSON Stylus Photo R200 Series which is able to print on paper or directly to CD.But I can't print on CD from Java. I don't know what attributes to request. Can anyone help?PS: MediaTray attribute category is not supported by this printer.
Hi,I would like to make softcopy of the class. My class hierarchy is as follows:class A extends Objectclass B extends A implements Cloneableclass C extends Bin class B I have implemented clone method like this: public Object clone() {Object o = null;try {o = super.clone();} catch ...
Hi,I am creating a current week scheduleThe current week is week 31 of this fiscal yearWhat i want is that week 31 should have dates from26thJuly-1st Augalong with days and datesWith the code that I am writing I am having list of dates and days starting from today's dateHere's the codeclass ...
public class Test{public static void main(String args[]){ Test tes = new Test(); tes.call(null);} public void call(Object o){} public void call(String s){} } why does it end up calling call(String s) ? why not call(Object o) ? Does it choose the one which is lowest on the hierarchy or ...
how to use ButtonEvent instead of "Ctrl+End" in JScrollPane
I have created a small webserver application where i am receiving http requests from a siebel client. I am using content-length parameter to read the complete data in a buffer string using the command inputstreamreader.read. It works fine in all the cases, except when its used with a firewall. ...
Hi again,I have a function that returns an int element; I would like this function to return more than 1 int...how is this possible?Thanks!Alberto
232 byte By
mraheel at 2007-9-30 14:11:51
What is the easiest way to check the valid Java Class Name.I am working on an application which write a template Java Code, I want to check the class name user enters for its class is valid or not. Thanks
248 byte By
kingzl at 2007-9-30 14:11:52
Hi,I have get a map and display on the screen using java.But i have a problem in getting the coordination on the display.What can i do on using java codes to make coordination on the map?Thank you very much
Hello, can anyone please help me!! I'm having problem with a lottery game I'm developing on Jbuilder. I have to make a lottery game that has three different settings with different number of balls, lottery 1 - 7 balls range of numbers 1-39, lottery 2 - 6 balls range of number 1-29, lottery 3 ...
72 byte By
yawmark at 2007-9-30 14:12:12
http://today.java.net/pub/a/today/2004/07/20/fluidiom.html