Java Intermediate
- "".equals(x) or x.equals("")
- Wed, 16 Jul 2008 18:15:00 GMT
- I've seen code written both ways - is there an advantage to doing it one way vs the other?"hello".equals(myString)ormyString.equals("hello")...
- ""+x versus String.valueOf(x)
- Wed, 16 Jul 2008 17:52:00 GMT
- I have been looking at the behaviour of ""+x versus String.valueOf(x) and while the first is slightly shorter and possibly easier to read, my guess is that it involves 3 String instances (one that is probably pooled) while the second would only create the one String instance.Not a massive differ...
- "#" sysmbol causing problem in downloading
- Wed, 16 Jul 2008 18:14:00 GMT
- Hi all,I have a applet class for downloading a drawing files from a unix server to a local NT box. It downloads the files well. But when the file contains "#" symbol in its name, it is not downloading the file... instead it is downloading some .jsp files instead of the drawing file. I would like...
- "APPLET SERVLET " NOT WORKING
- Wed, 16 Jul 2008 18:22:00 GMT
- I have an applet which simply has to communicate with the Servlet.My applet has textfield which send the data to the servlet .MY APPLET:--:public class CompanyMasterMaintenance extends JApplet { boolean isStandalone = false; GridBagLayout gridBagLayout1 = new GridBagLayout(); JLabel jtlcmpcode =...
- "Beginning Java Objects: From Concepts To Code" Details
- Wed, 16 Jul 2008 17:04:00 GMT
- If you are curious like me, you might be interested in the publisher's description here :"Beginning Java Objects: From Concepts To Code"...
- "build file build.xml does not found"
- Tue, 15 Jul 2008 20:25:00 GMT
- Hi, I already have build.xml file in the working directory. Still, when I run the build.xml file, I get the message build file build.xml does not found. Can anyone tell me what is wrong.Thanks,Srikanth...
- "Clean" programming practice?
- Wed, 16 Jul 2008 18:02:00 GMT
- Say I have a bit of code like: code:<font>StringBuffer output = new StringBuffer();InputStream in = conn.getInputStream();BufferedReader bf = new BufferedReader (new InputStreamReader (in));char[] buffer = new char [BUFFER_SIZE];int count = 0;do { count = bf.read (buffer, 0, BUFFER_SIZE);...
- "Corrupt GZIP Trailer"?
- Wed, 16 Jul 2008 18:08:00 GMT
- I got "Corrupt GZIP trailer" exception message in my program. I'm not sure what this is. Could somebody please advice?The code is actually fine when I run it in my local machine (windows).It retrieves the data just fine.But when I run it in the server (linux), it gives me this exception.Than...
- "Could not create task of type: echo"
- Tue, 15 Jul 2008 20:22:00 GMT
- I'm trying to use the Timer task in my Ant script. If I comment out the timer task, it runs properly and displays Hello World. Is there something I need to do in the classpath to append it to my current one?When I run it, I get:quote:Buildfile: <workspace>\Play\play.xmltest: [timer] Sy...
- "Eclipse Modeling Framework" book promotion
- Wed, 16 Jul 2008 18:19:00 GMT
- Hi all,I'm one of the authors of Eclipse Modeling Framework, and I wanted to let you know that we're doing a promotion this week in the IDE's and other tools forum.The Eclipse Modeling Framework (EMF) is a technology that effectively ties together modeling and Java programming, to en...
- "encripting" strings
- Wed, 16 Jul 2008 17:51:00 GMT
- I want to make a simple algorithm to "encript" a String. I mena, for example to change every char in the string for the char situated two places later en the alphabet. It sounds very easy, but how can I do it? How can I convert all the string in an integer (or every char in an integer) and do it...
- "Enterprise" applications & Object-Orientation
- Wed, 16 Jul 2008 17:45:00 GMT
- Hi all,This is a question that's bugged me for a while. I'm almost certain there are articles out there on it, but the obvious search terms (like J2EE, object oriented, design) yield zillions of unrelated sites.My question, basically: does the common design of 'enterprise' (parti...
- "File Watcher"
- Wed, 16 Jul 2008 17:51:00 GMT
- Does Java support the kind of "File System Watcher" that C# natively supports, that is, if something changes in a directory (like a file is put there, or other directory/file actions), you can raise an event?This is one cool thing I saw in C# that looked pretty cool.-- Mike...
- "foo".equals(foo) vs foo.equals("foo")
- Wed, 16 Jul 2008 17:38:00 GMT
- I was asked this question and was unsure of the correct answer,what would be the implications between these 2 approaches for comparing strings.String foo = "foo";so the 2 different ways would beboolean same = "foo".equals(foo); vs boolean same = foo.equals("foo");I have my guesses, but wanted to...
- "Graying out" a Checkbox.
- Wed, 16 Jul 2008 17:47:00 GMT
- I thought that there was a way to 'gray out' a Checkbox in Java, but when I was looking through the API, I couldn't find anything that does this. Can someone please tell me if this is possible, and where the method is that does this?...
- "Headless" image processing
- Wed, 16 Jul 2008 18:03:00 GMT
- Hi, my problem is:Need execute a application and not display this application on screen, but need save the main JFrame as image (JPG or other format) in one archive.Please help me. How i can do this?Thanks.[ EJFH: Edited subject line. ][ June 03, 2004: Message edited by: Ernest Friedman-Hill ]...
- "Identifier Expected" error in StringBuffer.append() method
- Wed, 16 Jul 2008 18:12:00 GMT
- Hi,Here's the code I'm working with:String updateSQLString;String initSQLWords = "UPDATE spraddr SET "; StringBuffer updateSQLSetClauseString = new StringBuffer(1024);updateSQLSetClauseString.append(initSQLWords);StringBuffer updateSQLWhereClauseString = new StringBuffer(1024); updateSQL...
- "if" vs. "switch", age old question-which is faster?
- Wed, 16 Jul 2008 17:52:00 GMT
- O.K. - I'll bet this has started many a flame war in the past, but I just want to know everyones opinion.Here is the situation. I am checking a value that I get back from a server. There are about 20 different values that might be returned and that I need to check for.Question is, which is f...
- "Image Fetcher" Threads?
- Wed, 16 Jul 2008 17:43:00 GMT
- Hi,I need help! Has anyone ever heard of 'image fetcher' threads?I have a java program, which, during its initialization, creates2 different objects - let's call them object A and B.Each of these objects contains a very simple loop whichloads a large number of ImageIcons. The referen...
- "include" capability?
- Tue, 15 Jul 2008 20:28:00 GMT
- One thing I haven't seen anywhere in the ant documentation or examples is an easy way to share common "snippets" between build scripts.I have ant build scripts for 17 projects (my answer to the question 'when should I use ant to automate building my project?' is 'always!') an...
- "Invalid Packet length" Error
- Wed, 16 Jul 2008 17:49:00 GMT
- I am getting this exception while executing this statementin.read(buffer,0,length); where "in" is "InputStream"java.io.IOException: Io exception: Invalid Packet Lenght at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716) at oracle.jdbc.driver.OracleBlobInputStream.needBytes(OracleB...
- "java util logging" in sdk 5 : can you configure Appenders per instance ?
- Wed, 16 Jul 2008 17:52:00 GMT
- Hi,I use java.util.logging, but I never liked the fact that, *if* you configure through the standard '.properties' file, then Handlers are configured per *class* and not per *instance* .E.g. if you need 3 different FileHandlers, they'll have the same configuration, same format, etc (...
- "javax.net.ssl.keyStore" system property inside a jar package
- Wed, 16 Jul 2008 17:46:00 GMT
- I am developing an application that must connect to an http server using ssl (https). During testing without packaging the application as a jar file everything works fine. As I am using the following code to specify the keystore file:System.setProperty("javax.net.ssl.trustStore", "/absolute/file...
- "LocaleBug"
- Wed, 16 Jul 2008 17:47:00 GMT
- Helo all!Consider following code:code:import java.util.*;class LocaleBug { static void main(String[] args) { Locale l; try { l=new Locale("en"); } catch(Exception e) { System.out.println(e); } }}I was surprised to receive NoSuchMethodException when I run LocaleBug class. I first thought that it...
- "maven site" fails on tests, while "maven test" runs without failures
- Tue, 15 Jul 2008 20:20:00 GMT
- Hi!I have a problem here with this maven build. (Maven 1.02)I have made a multiproject, where there is a test appliaction named bookstore. I have some classes in it and one test case testing one class and one method.anyway, when running "maven test" it runs successfully through the test.when I r...
- "Named" Arrays?
- Wed, 16 Jul 2008 18:20:00 GMT
- I'm actually using an applet but I thought this might be the better place to post and I was too scared to post in the beginner forum in the case this deemed either bit intermediate or advanced. I had initially written a program in Perl (which allows named arrays - hashes) but now I need to c...
- "Number Of Objects in Heap"
- Wed, 16 Jul 2008 18:06:00 GMT
- How do i find the number of objects currently placed in the heap?...
- "OS LOGIN & LOGOUT TIMES"
- Wed, 16 Jul 2008 18:14:00 GMT
- I HAVE A REQUIREMENT WHERE IN I NEED TO FIND OUT THE THE LOGIN TIME AND LOGOUT TIME WHEN EVER I GET IN TO WINDOWS OPERATING SYSTEM SO I REQUIRE CODE IN JAVA TO TRAP THE LOGINS AND LOG OUT TIMES OF ALL THE USERS...
- "Out of Memory" Error!!!!
- Wed, 16 Jul 2008 17:53:00 GMT
- Hi All,When i run my thick client application after a certain time i'm getting an error in the console "Out of Memory".What is the cause of this issue..I find that the instance of happening this varies from one PC to another.Can i do anything in the Java side to increase the performance.look...
- "out" field of System class
- Wed, 16 Jul 2008 18:17:00 GMT
- Hi, I want to know1)when and how does printStream out field in the System Class gets initialize?2)can I know (just in brief) which classes get instantiated when we run a java program?3)Is java open source code?can i see the implementation of its built in methods?Thanks......
- "Java Intermediate" Related Questions
- "javax.net.ssl.keyStore" system property inside a jar package
- I am developing an application that must connect to an http server using ssl (https). During testing without packaging the application as a jar file everything works fine. As I am using the following code to specify the keystore file:System.setProperty("javax.net.ssl.trustStore", "/absolute/file...
- "Image Fetcher" Threads?
- Hi,I need help! Has anyone ever heard of 'image fetcher' threads?I have a java program, which, during its initialization, creates2 different objects - let's call them object A and B.Each of these objects contains a very simple loop whichloads a large number of ImageIcons. The referen...
- "Beginning Java Objects: From Concepts To Code" Details
- If you are curious like me, you might be interested in the publisher's description here :"Beginning Java Objects: From Concepts To Code"...
- "OS LOGIN & LOGOUT TIMES"
- I HAVE A REQUIREMENT WHERE IN I NEED TO FIND OUT THE THE LOGIN TIME AND LOGOUT TIME WHEN EVER I GET IN TO WINDOWS OPERATING SYSTEM SO I REQUIRE CODE IN JAVA TO TRAP THE LOGINS AND LOG OUT TIMES OF ALL THE USERS...
- "Eclipse Modeling Framework" book promotion
- Hi all,I'm one of the authors of Eclipse Modeling Framework, and I wanted to let you know that we're doing a promotion this week in the IDE's and other tools forum.The Eclipse Modeling Framework (EMF) is a technology that effectively ties together modeling and Java programming, to en...
- "Headless" image processing
- Hi, my problem is:Need execute a application and not display this application on screen, but need save the main JFrame as image (JPG or other format) in one archive.Please help me. How i can do this?Thanks.[ EJFH: Edited subject line. ][ June 03, 2004: Message edited by: Ernest Friedman-Hill ]...
- "Graying out" a Checkbox.
- I thought that there was a way to 'gray out' a Checkbox in Java, but when I was looking through the API, I couldn't find anything that does this. Can someone please tell me if this is possible, and where the method is that does this?...
- "#" sysmbol causing problem in downloading
- Hi all,I have a applet class for downloading a drawing files from a unix server to a local NT box. It downloads the files well. But when the file contains "#" symbol in its name, it is not downloading the file... instead it is downloading some .jsp files instead of the drawing file. I would like...
- "java util logging" in sdk 5 : can you configure Appenders per instance ?
- Hi,I use java.util.logging, but I never liked the fact that, *if* you configure through the standard '.properties' file, then Handlers are configured per *class* and not per *instance* .E.g. if you need 3 different FileHandlers, they'll have the same configuration, same format, etc (...
- "Invalid Packet length" Error
- I am getting this exception while executing this statementin.read(buffer,0,length); where "in" is "InputStream"java.io.IOException: Io exception: Invalid Packet Lenght at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716) at oracle.jdbc.driver.OracleBlobInputStream.needBytes(OracleB...