Search:

Type: Posts; User: DavidFongs

Page 1 of 5 1 2 3 4

Search: Search took 0.29 seconds.

  1. Replies
    2
    Views
    479

    [SOLVED] Re: Trying to learn and I'm stuck

    Length is a method, not a field. the correct way to get the length of studentID is studentID.length() not studentID.length

    You can look at the String documentation here: String (Java Platform SE...
  2. Replies
    4
    Views
    3,635

    Re: Accessing static method

    This is not true. Would have to see all of his code to know the reason. I would guess that the object that contains the method, that contains that code, is extending JFrame (or extending something...
  3. Replies
    9
    Views
    934

    Re: Cannot find symbol error

    That, and you also had assignment errors.

    While you are right that mistakes do happen, they don't happen if you TRY it first. Which is incredibly simple to do. Instead, by being lazy, you are...
  4. Replies
    9
    Views
    934

    Re: Cannot find symbol error

    javapenguin: You posted code that doesn't compile. Why do you insist on continuing to do this?

    OP: The code you posted compiles just fine for me. Compiling AccountTest.java alone should do all...
  5. Replies
    3
    Views
    3,796

    [SOLVED] Re: bound mismatcherror?

    1. You should reread the Generics section of the java tutorials. Generics can get complex, and it doesn't hurt to read this section many times to ensure you understand them and are using them...
  6. Replies
    7
    Views
    533

    Re: Help with java logic

    Actually in this case, it does mean that they are the same object in memory. JButton inherits its .equals method from Object. By the definition of the equal method in the Object class, .equals will...
  7. Replies
    3
    Views
    790

    Re: Input method

    How is spoonfeeding the guy the answer better than linking him the javadoc and letting him figure it out? There is value in learning how to read a javadoc.
  8. Replies
    3
    Views
    790

    Re: Input method

    There is no implicit variable named input that holds user entered input.

    You can use the Java class Scanner (Java Platform SE 6) to read in input (That's a link). There is an example in the...
  9. Replies
    3
    Views
    461

    Re: Why rs...still connected

    And if it was null, you would never make it to that null check, because a NullPointerException would be thrown when you called close()
  10. Replies
    8
    Views
    903

    Re: java.lang.NoClassDefFoundError

    Ran unchanged for me. Please post how you are attempting to run your code, and any errors.
  11. Re: Display prime numbers from 100 to 200 in Java

    Think about it this way. Right now you initialize an int variable to 1, then if you determine the number isn't prime, you assign that int variable to 0. Later in the code, if that int variable is 1,...
  12. Replies
    2
    Views
    1,127

    Re: Quick easy Java question.

    When I run the code you have, replacing the equalsIgnoreCase with what you have commented out on the same line, it runs as expected.
  13. Replies
    10
    Views
    3,273

    Re: java grid and colors/graphics

    you need to change grid = new color[width][length] so that it is creating a 2d array of JButtons. Right now it is trying to create a 2d array of colors
  14. Replies
    10
    Views
    3,273

    Re: java grid and colors/graphics

    Grid is a 2D array of JButtons. You assigning a 2D array of color objects to it. This will cause a compiler error.

    You import Color and color. I'm pretty sure you want to use Color (you are...
  15. Re: Display prime numbers from 100 to 200 in Java

    While what you have now may work, I would make the following changes:

    1. All class names should begin with a capital letter.

    2. The variable f should be a boolean, for readability.

    3. When...
  16. Replies
    19
    Views
    938

    Re: need help with 2D array

    What does that have to do with the syntax?

    EDIT: Didn't notice there was a second page. KevinWorkman is on it.
  17. Thread: Auto Select

    by DavidFongs
    Replies
    14
    Views
    1,723

    Re: Auto Select

    You are. e.getComponent() returns an object of type Component. Without the cast, there is a compiler error
  18. [SOLVED] Re: Boolean Flag Not Working to Move Between While Loops?

    When you compare answer to "yes" or "no" you should use the .equals() or .equalsIgnoreCase() method from the String class

    == checks the equality of the references. .equals() checks the equality of...
  19. Replies
    5
    Views
    1,363

    Re: Need some help with OSX Java (Terminal)

    On other OS's based on linux/unix (like OS X is) I've used the command dos2Unix to remedy this.

    Not sure if that command comes standard with OS X or not, but if not you can probably add it.
  20. Re: i think something wrong with array...plz help!!

    I have some things I don't understand

    1. Why did you post incorrect code?

    2. Why did you define a variable in the constructor, that is never read locally, which generates a warning?

    3. Why...
  21. [SOLVED] Re: Replacing letters in a string NOT WORKING.

    You can use your same values for replacement, you just need to make sure you only replace characters that were originally in the String to be "encrypted"

    This can be done many ways. The simplest...
  22. [SOLVED] Re: Replacing letters in a string NOT WORKING.

    Seems pretty obvious.... Although your original code is nowhere to be found in the post that contains "all" of your code

    Lets say the original String was something simple like "a"

    The first if...
  23. Replies
    15
    Views
    1,672

    Re: renaming/deleting file

    From your original post, its obvious you are using Windows to do this. On a windows system, what you are trying to do will fail if a file already exists with the name you want to rename the temp...
  24. Replies
    15
    Views
    1,672

    Re: renaming/deleting file

    renameTo(File dest) returns a boolean that indicates whether the rename operation was successful or not. I would recommend checking this return value to determine what behavior you should expect.
    ...
  25. Replies
    23
    Views
    1,422

    Re: looping and arrays

    This is some of the worst advice I have ever read in my life
Results 1 to 25 of 108
Page 1 of 5 1 2 3 4