Search:

Type: Posts; User: OutputStream

Page 1 of 2 1 2

Search: Search took 0.09 seconds.

  1. Re: Cant get the ball to bounce around the canvass

    I did all updating on the EDT. The JPanel looked fine when rendering, no frames were wrong.
  2. Re: Cant get the ball to bounce around the canvass

    All I had was a JFrame which I added one JPanel to. When I switched to a Canvas I just had one JFrame with one Canvas on it. The only thing I changed in the rendering process was how I obtained the...
  3. Re: Cant get the ball to bounce around the canvass

    Not saying JComponents are bad or anything, if it's working for you then stick to it.
    I had an old game project once which used JPanels and repaint() for rendering. However, I noticed it started...
  4. Re: Cant get the ball to bounce around the canvass

    JComponents uses passive rendering (which means you have to wait for the EDT to render the JComponent).
    With a Canvas, it's very easy to set up a BufferStrategy. You then use that BufferStrategy to...
  5. Re: Cant get the ball to bounce around the canvass

    I thought Canvas was the only way to get direct rendering with Java2D?
  6. Replies
    3
    Views
    1,499

    Re: LinkedList outputs ONLY last element

    Glad you solved it :)
  7. Re: Help!, newbie, interested in Java, Very simple code, completely stuck!

    createSite is not a static method, so you can't call it without having an instance of that class.

    Also, that doesn't look like "very simple code" to me. "Hello world" is very simple code. If...
  8. Replies
    3
    Views
    1,499

    Re: LinkedList outputs ONLY last element

    c.setName();
    l.add(c);
    c.setName();
    l.add(c);

    You update the name of an object and add it to the list. Then you update the name again of the same object and add it again to the list again....
  9. Re: using if statement on string System.getProperty("os.name") not working

    Your way of comparing strings is wrong
  10. Replies
    7
    Views
    1,479

    Re: Incorrect Key Input

    Did you follow Norm's link and did you have a look at the tutorial? It explains a lot on how to use a KeyListener.
  11. Re: my code displaying some minor wrong o/p ....plz suggest me an answer !

    public void setweight(int newweight){
    if (newweight > 0){
    weight = newweight;
    }
    }

    If newweight is greater than zero, you update the weight of the dog. Cool!
    However, what if the weight is...
  12. Replies
    7
    Views
    1,479

    Re: Incorrect Key Input

    if(key=='1')

    You are comparing an int to a char. Remove the single-quotes and compare key to an int instead.

    Also what error message are you getting?

    EDIT: keyDown is a deprecated method. I...
  13. Replies
    3
    Views
    1,430

    Re: Array Search Method

    Can you please show the code where create and fill the 'String[][] line' array?
  14. Re: File.listFiles(FileFilter) won't compile

    That method wants a java.io.FileFilter while you're trying to give it a javax.swing.filechooser.FileFilter.
  15. Replies
    5
    Views
    2,048

    Re: char to int cov problem

    edit: nvm, haven't had my coffe yet ^^
  16. Replies
    7
    Views
    1,236

    Re: Help with a Game that's gone wrong.

    There are no brackets after the class definition
  17. Replies
    3
    Views
    2,983

    [SOLVED] Re: Send File (path) as argument to method

    What are you trying to do? Where is the array named "list" declared?
  18. Re: The java-output doesn't give the right result?

    If you remove the synchronized keyword from both methods then you would probably get different results every time you run the program.
    There is nothing wrong with the loops, they are looping exactly...
  19. Re: The java-output doesn't give the right result?

    Basic math:
    3 * 2'000'000 = 6'000'000
    1 * 2'000'000 = 2'000'000

    Add them together and you get 8'000'000.
    How can 7'999'982 be the right output?
  20. Re: 1st Java class assignment, and having some difficulties. Little help please.

    With todays modern hardware (and the excessive amounts of RAM available) you won't be saving much memory by doing that. I suggest staying away from bytes and shorts (unless you have a very good...
  21. Replies
    2
    Views
    1,775

    Re: Code require for Drag and drop

    What have you tried so far?
  22. Replies
    1
    Views
    3,031

    Re: Netbeans 6.8

    Update to the latest netbeans (v 7) and see if that helps
  23. Re: Simple while loop exercise but problem with stopping when empty line is typed.

    What you want to do is to check if the string is empty (i.e. it's length is equal to zero).
    Check the following link, if you check the "Method Summary" table you will most likely find a method or...
  24. Replies
    4
    Views
    1,926

    Re: Need Help Creating a Loop.

    bglueck, don't spoonfeed. Also don't compare Strings with the equals operator (==), use equals() or equalsIgnoreCase() instead.
  25. Re: Lazy Thursday Question: Weird Syntax You've Seen?

    Not necessarily weird syntax, but abusing the finally clause can produce some really weird results:


    try {
    return true;
    } finally {
    return false;
    }
    The above code actually returns...
Results 1 to 25 of 32
Page 1 of 2 1 2