Search:

Type: Posts; User: The_Mexican

Page 1 of 4 1 2 3 4

Search: Search took 0.09 seconds.

  1. Controlling an external motor controller

    Hi, I recently have started experimenting with motorcontrollers, specially ones that control servo motors. I wanted to use Java because I am most familiar with this language, and I am learning...
  2. Replies
    4
    Views
    1,376

    Re: How should I do this?

    I would still have to use 1,849 statements for this though...I don't want to have to copy + paste + change slightly that many times.
  3. Replies
    4
    Views
    1,376

    How should I do this?

    So I'm making a Unit Converter which will be able to convert 43 different type of units (temperature, currency, volume, mass, length, speed) to any of the 43 types. But right now I'm a little unsure...
  4. Replies
    10
    Views
    1,918

    Re: String[] to String

    Thanks, it works now. :D
  5. Replies
    10
    Views
    1,918

    Re: String[] to String

    That makes it work. However, when I print the text, it strings all the lines in the text together, with no enters to separate lines.

    This is the text file:

    One
    Two
    Three
    Four
    Five
  6. Replies
    10
    Views
    1,918

    Re: String[] to String

    Hmm, technically I did read the file once, to get the value of num (which is just the number of lines in the file). However, I used two different readers to do this (see the code in my first post).
  7. Replies
    10
    Views
    1,918

    Re: String[] to String

    For some reason, when I do this, it prints out: "nullnull". I have no idea why.


    StringBuffer sb = new StringBuffer();
    String[] notesarr = new String[num];
    ...
  8. Replies
    10
    Views
    1,918

    String[] to String

    Hi, I would like to convert a String array (String[]) to a String which I can print. I don't know how to do this as there's no simple method like String s = stringArray.toString() or something as far...
  9. Replies
    5
    Views
    1,951

    Re: Timer digit

    Yes, I am aware I'm displaying the milliseconds and yes what I'm trying to do is "set the maximum" number of digits shown. Okay, so you told me why SimpleDateFormat isn't going to work for this. But...
  10. Replies
    5
    Views
    1,951

    Timer digit

    Hi, I have a problem where I want to get rid of the last digit a timer displays, which I'm not sure why it's displaying. As you can see from the runnable code below, it's adding on another random...
  11. Replies
    10
    Views
    2,214

    Re: Updating timer

    I wasn't sure how to use a swing timer so, as you can see, I set it up so that I can call .getElapsedTime on anything that is able to 'start' such as the variable s in the program. It should work...
  12. Replies
    10
    Views
    2,214

    Re: Updating timer

    Okay, here is the shortest possible program that I could make that still demonstrates my problem while being runnable:


    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import...
  13. Replies
    10
    Views
    2,214

    Re: Updating timer

    I did this and now it just goes into the while loop once the timer is started and is stuck there forever, you can't click any buttons and the timer isn't even updating anyway. :(
  14. Replies
    10
    Views
    2,214

    Re: Updating timer

    Ya, I realize that I am doing this, but my question is how do it get so that when you click the button the time in the text box updates consistently as the timer continues.
  15. Replies
    10
    Views
    2,214

    Updating timer

    Hi, I'm having trouble getting my timer to be continuously updating. Once I click the button to start the timer it just shows 0. However, it shows the correct time after you finish.


    public long...
  16. Replies
    9
    Views
    2,035

    Re: Problem with throwing an exception...

    Yes I see now, thanks to both of you. What I had to do is simply move the statement into the next method then surround pretty much the entire program in a try/catch block. There is probably another...
  17. Replies
    9
    Views
    2,035

    Re: Problem with throwing an exception...

    I can't do that, this is what it's like:


    public class GameClient2 extends JPanel implements ActionListener {
    public GameClient2() throws Exception{ //Line 60
    URL myurl =...
  18. Replies
    9
    Views
    2,035

    Re: Problem with throwing an exception...

    I'm not sure what you mean by the "big" class, but I think I must be doing that. However, there's no other way I can do it since I need this to be visible to places later in the program.
  19. Replies
    9
    Views
    2,035

    Problem with throwing an exception...

    Hi, I'm having a problem where I get an error at a throws declaration.

    This is the error:


    Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
    at...
  20. Replies
    15
    Views
    3,071

    Re: renaming/deleting file

    Well I guess I'll just do it the manual way copeg suggested. Thanks anyway guys!

    EDIT: Ah yes! I partly figured it out! :D Ok, so what needed to happen is that I had to delete/rename the files...
  21. Replies
    15
    Views
    3,071

    Re: renaming/deleting file

    I have Java SE 6 Update 21. I guess I'll update it to 23 but I doubt that's the problem...
  22. Replies
    15
    Views
    3,071

    Re: renaming/deleting file

    1. Windows Vista. I seriously doubt I would need elevated privileges in order to delete these text files. I've tried deleting them manually and it works.

    2. Yes, I checked using the way you...
  23. Replies
    15
    Views
    3,071

    Re: renaming/deleting file

    I tried what you suggested but it still came up as false and nothing happened :( It guess the only way this will work is doing what copeg suggested?
  24. Replies
    15
    Views
    3,071

    Re: renaming/deleting file

    dir is basically where the program is running from. I can't remove the static because I was taking these lines somewhat out of context, there is a reason I need the static there.
  25. Replies
    15
    Views
    3,071

    Re: renaming/deleting file

    Ok, so I checked the return value and saw that they both came up as false. But now is there a way I could make it work? Does renameTo() just not work if there's always a file by that name?
Results 1 to 25 of 81
Page 1 of 4 1 2 3 4