Search Results

Showing results 1 to 40 of 40
Search took 0.01 seconds.
Search: Posts Made By: harsh2327
Forum: Java Sep 3rd, 2009
Replies: 2
Views: 282
Posted By harsh2327
The class containing main method should be public

public class abc {
.....
}


and the filename should be same as class name...
Forum: Java Sep 2nd, 2009
Replies: 2
Views: 268
Posted By harsh2327
Running multiple copies of your code implies that you are creating an entirely new process.
Its like running 2 independent processes (like 2 IEs or 2 notepads executing at once). These two processes...
Forum: Java Aug 25th, 2009
Replies: 1
Views: 212
Posted By harsh2327
read() method in BufferedStream returns an int.

If you are want to read characters then you will have to typecast the integer to char like

char c = (int)<YOUR_OBJECT_HERE>.read()
Forum: Java Aug 25th, 2009
Replies: 2
Views: 262
Posted By harsh2327
I think this should be under JSP forum under Web Development if you are writing JSP code
Forum: Java Aug 24th, 2009
Replies: 6
Views: 310
Posted By harsh2327
I don't know hot to do it with Java, but you could use AutoHotKey (http://www.autohotkey.com) for such programs. This programming language is meant for such stuff. Your code for such a task will be...
Forum: Java Aug 24th, 2009
Replies: 2
Views: 301
Posted By harsh2327
Please post your code. No one will be able to solve your problem without it
Forum: Java Aug 24th, 2009
Replies: 7
Views: 792
Posted By harsh2327
I don't know about Java but I prefer using AutoHotKey (http://www.autohotkey.com) for such purposes. Have a look at it.
Forum: Java Aug 19th, 2009
Replies: 6
Views: 326
Posted By harsh2327
wat was the problem
I'd like to know
Forum: Java Aug 19th, 2009
Replies: 8
Views: 265
Posted By harsh2327
Well I have not understood your problem completely, but from what I have understood here's the solution

Step1. Take input to a string. Note: "50 5" will be bought in a single string
Step 2. Split...
Forum: Java Aug 19th, 2009
Replies: 6
Views: 326
Posted By harsh2327
I suppose your HTML code is incorrect
It should be


<applet width=300 height=300 code="../../build/classes/applettest/HelloWorld.class"> </applet>
Forum: Java Aug 18th, 2009
Replies: 4
Views: 290
Posted By harsh2327
Close the database connection.
Forum: Java Aug 18th, 2009
Replies: 2
Views: 335
Posted By harsh2327
In File DoodleBoardPanel.java, see method public void mouseDragged(MouseEvent e) {...}.

Here you are storing only the size and shape in ArrayList DOTlist. Hence, each dot is having different size...
Forum: Java Aug 18th, 2009
Replies: 4
Views: 290
Posted By harsh2327
Probably there is a problem with sysdate in the insert query

And pls enclose your code in
(code=java)
// Your code
// Use square brackets instead
(/code)


Its more readable that way
Forum: Java Aug 18th, 2009
Replies: 4
Views: 290
Posted By harsh2327
What exception is i throwing (if any)?
Please mention your database column names and attribute type as well.
Forum: Java Aug 18th, 2009
Replies: 5
Views: 228
Posted By harsh2327
Here's the link for Sun's tutorials

Sun Java Tutorials (http://java.sun.com/docs/books/tutorial/)
Forum: Java Aug 15th, 2009
Replies: 5
Views: 632
Posted By harsh2327
Forum: Java Aug 14th, 2009
Replies: 12
Views: 910
Posted By harsh2327
Yes I did !!


int t = Integer.parseInt(a.get(0)+"");
Forum: Java Aug 14th, 2009
Replies: 12
Views: 910
Posted By harsh2327
Yes, it says you have added Integer Class, a Double class and a String Class

import java.util.*;

public class temp {
public static void main(String args[]) {
ArrayList<Object> a = new...
Forum: Java Aug 14th, 2009
Replies: 12
Views: 910
Posted By harsh2327
import java.util.*;

public class temp {
public static void main(String args[]) {
ArrayList<Object> a = new ArrayList<Object>();
a.add(2);
a.add(3.3);
a.add("Hi");
...
Forum: Java Aug 14th, 2009
Replies: 12
Views: 611
Posted By harsh2327
Hey check this function


public static int indexOfSecondSmallest(int[] values) throws IllegalArgumentException {
if (values.length < 2)
throw new IllegalArgumentException("Your message...
Forum: Java Aug 14th, 2009
Replies: 12
Views: 910
Posted By harsh2327
Hey JamesCherrill,

thanks a lot for correcting me. Declaring an object array didn't come to my mind
Forum: Java Aug 14th, 2009
Replies: 7
Views: 14,887
Posted By harsh2327
You could even use Vector class.
Its implementation is much simpler.
Its in java.util package
Forum: Java Aug 14th, 2009
Replies: 12
Views: 611
Posted By harsh2327
Hey, in your own code, instead of doing
for (int i = 0; i < values.length; i++)
{
.
.
.
}

just try this and
int i;
Forum: Java Aug 14th, 2009
Replies: 12
Views: 910
Posted By harsh2327
Hi

there are many such classes in Java which can be used in similar ways and have similar functionality. eg.You could also use Vector class for dynamic allocation. You could use either of them...
Forum: Java Aug 9th, 2009
Replies: 2
Views: 459
Posted By harsh2327
Answer to Q2>

Method paintComponent(Graphics g) is already defined in JPanel class. What you are doing is OVERRIDING paintComponent() of JPanel. So, when paintComponent() is called, your...
Forum: Java Aug 9th, 2009
Replies: 3
Views: 331
Posted By harsh2327
That is good one.

And it is neither an error nor a bug.
Static blocks are executed when the class is first loaded into the memory. When you start your program, if all the classes load into the...
Forum: Java Aug 9th, 2009
Replies: 2
Views: 240
Posted By harsh2327
It is silly mistake.
Change your line no. 35 from

protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {


to

protected void destroyApp(boolean unconditional) ...
Forum: Java Jul 30th, 2009
Replies: 1
Views: 729
Posted By harsh2327
There is no way to clear the screen in JAVA. It seems that you are a beginner in Java and just migrated from age old Turbo C.

The reason because there is no clear screen is that you will never...
Forum: Java Jul 30th, 2009
Replies: 4
Views: 276
Posted By harsh2327
Hey,
You have called st.nextToken() twice. See, highlighted part.
On the first call i.e. inside if statement it returns you the nextToken but stores nowhere. That is why you are missing 1st token...
Forum: Java Jul 28th, 2009
Replies: 12
Views: 842
Posted By harsh2327
------------------------------------------

Have you even tried implementing my code. What you understood is completely wrong. That code is meant for reading from "HUMAN READABLE FILES."
Forum: Java Jul 27th, 2009
Replies: 3
Views: 163
Posted By harsh2327
Hey

that largely depends on how you code
Go through java.net package documentations to suit your needs
Forum: Java Jul 27th, 2009
Replies: 12
Views: 842
Posted By harsh2327
You can use FileReader class under java.io package. Use read method to read the file.

to read a line at a time




public class FileLineReader extends FileReader {
FileLineReader(File...
Forum: Java Jul 27th, 2009
Replies: 5
Views: 378
Posted By harsh2327
Sorry for the late reply .. was away from a PC


you can endsWith() use that also ... no harm
Forum: Java Jul 25th, 2009
Replies: 5
Views: 378
Posted By harsh2327
Please explain your problem properly. Cant get it what you want.


From what I have understood... to find whether a string that ends with "," or ".",
eg.


String str = "Hello World.";...
Forum: Java Jul 23rd, 2009
Replies: 4
Views: 191
Posted By harsh2327
Forum: Java Jul 23rd, 2009
Replies: 4
Views: 191
Posted By harsh2327
Obviously your countLeaves function is incorrect. It will always stop at the second if condition "if(leftSubtree==null && rightSubtree==null)" and return 1 because leftSubtree and rightSubtree is...
Forum: C May 17th, 2008
Replies: 9
Views: 2,424
Posted By harsh2327
Hey,

I have just upgraded my C++ compiler from old TurboC++ to CodeBlocks as per Salem's suggestion. (Check this post) (http://www.daniweb.com/forums/post604085.html#post604085)


But I am...
Forum: C May 11th, 2008
Replies: 6
Views: 701
Posted By harsh2327
Thanks guys for your help!!

Ya switching compilers is a bit of a problem but it did solve my original problem

Thanks a lot everyone!!!!
Forum: C May 10th, 2008
Replies: 6
Views: 701
Posted By harsh2327
Hey Salem

Thanks a lot for your help:)


But why void main() is wrong
I mean if main() is not returning a value then why force it to return values??
:-O

Cheers!!
Forum: C May 10th, 2008
Replies: 6
Views: 701
Posted By harsh2327
I want to read files and folder names from directories.
I have used the following code.
But the problem is that in the output the file name gets truncated.(See the output below)




#include...
Showing results 1 to 40 of 40

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC