Search:

Type: Posts; User: beansnbacon

Page 1 of 2 1 2

Search: Search took 0.55 seconds.

  1. Resizing an image without losing transparency

    I'm making an image editing software in java and need to resize the images so that users can edit images pixel by pixel. However, whenever I use image.getScaledInstance(newWidth, newHeight,...
  2. Replies
    4
    Views
    255

    Re: Java help with Methods (Begginer)

    Sometimes you get an exception that appears in the console window as red text. It might say nullpointerexception or stackoverflowerror etc. If none shows up, what's your error?
  3. Replies
    4
    Views
    255

    Re: Java help with Methods (Begginer)

    Please surround your code with "code" and "/code" in square brackets so we can read it easier. Also, are you getting red text at the bottom of the screen? If so what is it?
  4. Replies
    1
    Views
    171

    Re: Request Information

    Your error is in the constructor with two integers. In the beginning you made the variables month and year private and in your constructor you try and access them as if they were public. To fix this,...
  5. Replies
    0
    Views
    155

    Trouble with files

    I have a java project in eclipse that uses a text file and some png's. Whenever I run it in eclipse it works perfectly, but when I export it, it doesn't get any information from the files. I am...
  6. Re: Homework question having to do with arrays...

    Use Math.max(int x, int y) in a loop to figure out which is the ultimate highest of them all. By the way, if you don't have hardly any experience, this should be easy for you.

    UPDATE: Use...
  7. Re: Guyyzz,the output is not coming-- PLS HELP

    It is way too confusing. Make a separate method to check if a given number is prime and in your method return all prime numbers nos and lower.



    public boolean isPrime(int x){
    for(int z = 2;...
  8. Replies
    2
    Views
    280

    Re: What is wrong with this method?

    Are you checking the string for spaces?
  9. Re: Java algorithm to print all the combination of the integer array

    It seems as if it is a matter of the length of the array. Ignoring the possibility of two of the same number in the array, this should work:



    public int combinations(int length){
    if(length...
  10. Replies
    2
    Views
    399

    How to make .wav player in java

    I've been trying to research how to make a simple java .wav player, but I can't find anything useful. If there is a way to play the file if it's already in my project folder, then that would be...
  11. Replies
    12
    Views
    1,562

    [SOLVED] Re: Minesweeper Recursion Method Help

    I have fixed another part of the problem. The mouse's x and y were used as the x and y in the clearBlockers method. So when I was detecting whether a neighboring cell had 0 mines, it would always be...
  12. Replies
    12
    Views
    1,562

    [SOLVED] Re: Minesweeper Recursion Method Help

    So far I found one error: In line 126 I said x+-40 instead of x-40. That didn't do anything to the code when I changed it, though.
  13. Replies
    12
    Views
    1,562

    [SOLVED] Re: Minesweeper Recursion Method Help

    I figured out part of my problem: in lines 116 and 117 I forgot to divide the number by 40, so it was requesting a number that was out of the boundaries of an the blockers array. But now I have a...
  14. Replies
    12
    Views
    1,562

    [SOLVED] Re: Minesweeper Recursion Method Help

    This is what is said one time after I launched this game and the first click was a blank cell:

    Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 1951
    at...
  15. Replies
    12
    Views
    1,562

    [SOLVED] Re: Minesweeper Recursion Method Help

    They're not needed for me, but for viewers on this forum who may wonder what all the variables and methods I created stand for. I also code by myself, so the only other people working with my code...
  16. Replies
    12
    Views
    1,562

    [SOLVED] Re: Minesweeper Recursion Method Help

    To me, comments seem to waste space in the code and it is annoying for me when it's simple enough for me to understand it without comments. The information that might normally go into a comment, I...
  17. Replies
    12
    Views
    1,562

    [SOLVED] Minesweeper Recursion Method Help

    I am trying to make a java minesweeper game. As you may know, if an empty cell is revealed in minesweeper, it reveals its surrounding cells. I believe making a recursive method should allow this...
  18. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    I fixed it! The one mistake I made indeed involved the double buffering. It was not a logic problem in the code. The problem was that the line g.drawImage(offscreen, 0, 0, this); was included in an...
  19. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    I am debugging the code now. I'm adding comments, but I'm not updating the code here. The "h" variable is true when the h key is down and false when it is released. This variable is working...
  20. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    I already did that and I realized that the booleans that activate the menus that don'e appear are not being activated when they're supposed to. In the code, do you see anything wrong with the...
  21. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    Well, knowing that the variables are supposed to change when you press keys, maybe something is wrong in the portion of the code with action listeners and key listeners. I have no clue why the...
  22. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    What's supposed to happen is when the green and red squares touch, it displays the same screen that appears in the beginning except that another line appears that says "GAME OVER" and instead of...
  23. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    I just now figured out that when I type g.clearRect(0, 0, 400, 400); it has the same effect of super.paint(g); Same goes for g2: passing g2 in super is the same as g2.clearRect(0, 0, 400, 400);...
  24. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    When you ran it yourself, are you sure the entire program functioned perfectly? When I run it, besides flickering, the screen goes blank when it is supposed to display the game-over menu and it does...
  25. Replies
    16
    Views
    307

    [SOLVED] Re: Double Buffering Problem

    I tried that just now, but instead it flickers even more than before, and still doesn't paint the game over menu or the how to play menu. But it is different. When I passed g2 it froze instead of...
Results 1 to 25 of 26
Page 1 of 2 1 2