Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Darin Niard

Ranch Hand
+ Follow
since Jun 08, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Darin Niard

Open up a prompt with "cmd" first.

17 years ago
Is there a particular reason that you can't use a JPanel?
17 years ago

Originally posted by prashu bk:
How do i achieve the exact functinality of MicroSoft Excel


Exact? Well, that's a lot to ask for

This question is very broad... have you checked out JTable?
17 years ago
Well, oddly enough, it works only with the keyReleased() method.

I tried this, and it seems to work, unless you lose focus of course

[ August 04, 2004: Message edited by: Darin Niard ]
17 years ago
Couldn't you just grab the print-screen key event and clear the clipboard at that very moment?

edit: A normal KeyAdapter doesn't pick it up. Interesting...

edit2: Correction: It works with keyReleased() , but not keyPressed()
[ August 04, 2004: Message edited by: Darin Niard ]
17 years ago

Originally posted by Peter Shipway:
I would have to use a counter until it reaches 5 or n


Hint: You already have a counter, there's no reason to add another.

0
0
0
0
0
0
etc.


Notice how I pointed out that there will only be 5 new lines, not 25. So, printing a new line with each value is not what you want to do.
[ August 03, 2004: Message edited by: Darin Niard ]
17 years ago
It's not just printing the first line -- it's printing everything on one line. Think about when you want a new line to be printed. After a single row is printed, right? If you have a 5x5 array, you're going to print a new line only 5 times... think about it.
[ August 03, 2004: Message edited by: Darin Niard ]
17 years ago
You don't have a compiled class to run, and the class you posted here isn't going to compile the way it is.

  • Your main method ends too early, and the rest of your code ends up outside of it.
  • You capitalized the "i" in "if" twice.
  • Always compare Strings with the equals method, not = or ==.
  • Semicolons everywhere
  • This really needs to be written as a loop.


  • [ August 03, 2004: Message edited by: Darin Niard ]
    17 years ago


    There's no reason that either of those wouldn't work...
    17 years ago
    Classes don't share members with each other unless there is an inner/outer relationship, and of course in the case of inheritance.

    All classes DO have access to your "filename" variable, ie, docMaker.filename is available for use.
    [ August 03, 2004: Message edited by: Darin Niard ]
    17 years ago
    Toolkit's beep() uses the system's beep sound, not the bell character.
    17 years ago
    To answer your question...

    Just write a for loop that uses your 'count' variable as a stopping point to append spaces to a string, then stick that string on the beginning of your print statements. You need to pass ++count or count+1 instead of count++ though, because right now your program is just passing 0s in each call.
    [ July 31, 2004: Message edited by: Darin Niard ]
    17 years ago
    What JRE do you have installed, Vijay?
    17 years ago
    Toolkit's createImage() currently only supports GIF, JPEG, and PNG (since 1.3).

    The javax.imageio package can do pretty much anything as long as you have the appropriate plugins installed for it.

    In JRE 1.5, javax.imageio supports JPG, PNG, BMP, WBMP, and GIF. Prior to 1.5, neither BMP format is supported, I believe.
    17 years ago