Search:

Type: Posts; User: DOLZero

Page 1 of 2 1 2

Search: Search took 0.16 seconds.

  1. Replies
    12
    Views
    260

    Re: Casting error using String with generics

    I found another way to get around the problem I had. It's more of a bandaid fix as I still have an issue with casting, but I can at least get the String value I want now and create a new ListNode...
  2. Replies
    12
    Views
    260

    Re: Casting error using String with generics

    Exception in thread "main" java.lang.NumberFormatException: For input string: "comedy"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at...
  3. Replies
    12
    Views
    260

    Re: Casting error using String with generics

    I tried running the line you wrote for the scanner and got an error when I tried to compile the program. I am fairly certain that the initial error that is causing me problems has to do with trying...
  4. Replies
    12
    Views
    260

    Re: Casting error using String with generics

    All that I have entered for user input is "a comedy" and "1". The rest is output from the program.

    Should I modify the following line to match what you typed in?


    Scanner stdin = new...
  5. Replies
    12
    Views
    260

    Re: Casting error using String with generics

    I think I get what you are saying. In situations where there are no items in the list, it will try to getNext() when there is no item to get. I will see about how I can fix this.

    @Norm: Here is...
  6. Replies
    12
    Views
    260

    Casting error using String with generics

    I'm getting a bug with this program I am writing for my CS class. Pretty much got it nailed down to a casting error. It happens when I try to retrieve a value from a node in an existing list...
  7. Re: Keyboard Listeners to Control object states

    Sounds like a plan. I am gonna rewrite much of my code and try to clean up all of that mess I have going on. My system for collision detection is far from efficient, and really bogs down the game...
  8. Re: Keyboard Listeners to Control object states

    I had thought about that, but the main reason I didn't want to include a break for those was because I wanted players to be able to press multiple buttons at once. If someone is holding down up and...
  9. Re: Keyboard Listeners to Control object states

    I was having problems getting the toggle breakpoint to start where I wanted the debugging to start. Not sure why, but when I clicked to add a breakpoint it never showed up. I will try adding in some...
  10. Keyboard Listeners to Control object states

    I am trying to develop a simple 2D gaming engine. The latest bug I have come across involves the keyboard input not correctly changing the proper variables and the display output is getting confused...
  11. Replies
    7
    Views
    432

    [SOLVED] Re: Layout Manager and Keyboard Panel

    I think I figured out a way to do what you are suggesting. I created a JFrame variable to use as the general frame and made it static so I could access it anywhere in the code. It seems to work,...
  12. Replies
    7
    Views
    432

    [SOLVED] Re: Layout Manager and Keyboard Panel

    I got it. It's old code that I haven't optimized. That doesn't help me with my current issue.
  13. Replies
    7
    Views
    432

    [SOLVED] Re: Layout Manager and Keyboard Panel

    I am not quite sure I follow you. Are you referring to this:


    JPanel p2 = new KeyboardPanel();
    p2.setSize(0, 0);
  14. Replies
    7
    Views
    432

    [SOLVED] Layout Manager and Keyboard Panel

    I am working on a program to run a game engine. Right now I am working with a frame that has two panels in it. One is for the main display, and the other is for the keyboard controls. The problem I...
  15. Replies
    2
    Views
    469

    Re: BorderLayout and getHeight/getWidth

    Thanks for the reply. What you said makes a lot of sense and I will definitely give it a try. I am pretty new to GUI and the layout stuff, and didn't even think of that.
  16. Replies
    2
    Views
    469

    BorderLayout and getHeight/getWidth

    I am running a code that uses border layout to manage 2 frames. One frame is a window in which I am displaying some graphics, located in the CENTER region. I have another frame in the SOUTH location...
  17. Thread: JFrame errors

    by DOLZero
    Replies
    10
    Views
    480

    [SOLVED] Re: JFrame errors

    Ah, that's right. You helped me realize where I went wrong. When I was creating each environment object I was putting it in environment[i] in the loop, which i always increased by 1, whether it made...
  18. Thread: JFrame errors

    by DOLZero
    Replies
    10
    Views
    480

    [SOLVED] Re: JFrame errors

    Okay, I think I have got it narrowed down. It seems there is something going on in this bit of code here:


    for (int i = 0; i < environment.length; i++){...
  19. Thread: JFrame errors

    by DOLZero
    Replies
    10
    Views
    480

    [SOLVED] Re: JFrame errors

    I added in "system.out.prinrln(environment);" right before the line and it printed out "[LMark2.environment;@5d6d2633" in the console.

    Although I am not sure if that is exactly what you meant....
  20. Thread: JFrame errors

    by DOLZero
    Replies
    10
    Views
    480

    [SOLVED] Re: JFrame errors

    line 121 appears to be this line in the code:

    for (int i = 0; i < environment.length; i++){

    I am pretty sure that environment is already initialized as an array before the program ever reaches...
  21. Thread: JFrame errors

    by DOLZero
    Replies
    10
    Views
    480

    [SOLVED] Re: JFrame errors

    The errors happen whenever the program tries to paint graphics to the frame. With the timer code commented out, the errors only appear the one time:

    edit: errr, it appears twice:


    Exception in...
  22. Thread: JFrame errors

    by DOLZero
    Replies
    10
    Views
    480

    [SOLVED] JFrame errors

    I have been working on a program to run a basic 2 dimensional sidescrolling game. Right now I am trying to get the basic image window working. I was able to get a simple version to run, but now that...
  23. Replies
    7
    Views
    1,582

    Re: Pixel grid vs Hitbox (collision detection)

    Its going to be more of a mario style game. It also sounds like I should be just fine with the pixel based system that I already started building. Thanks guys :)
  24. Replies
    7
    Views
    1,582

    Pixel grid vs Hitbox (collision detection)

    I have been working on a program for a little while now. Now that I got my GUI stuff figured out (had no idea what I was doing when I started) I am working on getting the rest of my game together....
  25. Replies
    7
    Views
    536

    [SOLVED] Re: Keyboard Listeners and ImagePanel

    Thanks for the input. I haven't had a chance to get back to the program since last weekend. I got things working as far as moving stuff around the screen by putting in a timer and an action listener,...
Results 1 to 25 of 28
Page 1 of 2 1 2