Forum: Java Sep 3rd, 2009 |
| Replies: 2 Views: 282 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 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 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 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 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 Please post your code. No one will be able to solve your problem without it |
Forum: Java Aug 24th, 2009 |
| Replies: 7 Views: 792 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 wat was the problem
I'd like to know |
Forum: Java Aug 19th, 2009 |
| Replies: 8 Views: 265 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 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 Close the database connection. |
Forum: Java Aug 18th, 2009 |
| Replies: 2 Views: 335 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 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 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 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 Hey Java uses UNICODEs and not ASCII values |
Forum: Java Aug 14th, 2009 |
| Replies: 12 Views: 910 Yes I did !!
int t = Integer.parseInt(a.get(0)+""); |
Forum: Java Aug 14th, 2009 |
| Replies: 12 Views: 910 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 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 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 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 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 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 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 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 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 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 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 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 ------------------------------------------
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 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 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 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 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 |
Forum: Java Jul 23rd, 2009 |
| Replies: 4 Views: 191 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 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 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 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 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... |