Search:

Type: Posts; User: steel55677

Page 1 of 2 1 2

Search: Search took 0.47 seconds.

  1. Replies
    1
    Views
    696

    Permutations using Arraylist

    I'm having problem with not outputting the correct result. I only get the original permutation back. It doesn't want to iterate through the rest of the letters.

    Question is, I'm following the...
  2. Replies
    1
    Views
    753

    Permutations using Arraylist

    I'm having problem with not outputting the correct result. I only get the original permutation back. It doesn't want to iterate through the rest of the letters.

    Question is, I'm following the...
  3. [SOLVED] Re: Question about using the toString method.

    toString method is to format whatever you want to print out from a class (object).

    The general form is Object newObject = new Object(Constructor parameters );
    The toString method doesn't need...
  4. Replies
    8
    Views
    1,232

    Re: ArrayList question

    Because my teacher wants us to code our own code which means we can't use java's api other than arraylist. we had to make our own arraylist class from array. and i get that, i'm just making a simple...
  5. Replies
    8
    Views
    1,232

    Re: ArrayList question

    I'll go ahead and try that. I think I should be able to implement/extend ArrayList class. Thanks
  6. Replies
    8
    Views
    1,232

    Re: ArrayList question

    Yes, that code is exactly what I want. I want an arraylist of arraylist. But, I don't know how to generate generic arraylist so that the names aren't predefined. The name of the arraylist is whatever...
  7. Replies
    8
    Views
    1,232

    Re: ArrayList question

    Thanks, I tried to do it last night. This is my map currently.

    public class OwnMap<Key,Value>{

    static private Object Key, Value;

    public OwnMap(Object Key, Object Value){
    ...
  8. Replies
    8
    Views
    1,232

    ArrayList question

    Hi,

    How do you create ArrayList for individual items like this:

    Object str = "A"
    ArrayList<Objects> str = new ArrayList<Objects>();

    I'm making my own Hashmap but I don't know how to create...
  9. Replies
    11
    Views
    1,203

    Re: how to use graphics g

    thanks, i've gotten it to work correctly now.
    i got one last question, is there a way to store rectangle/oval or any shape so that when i make an eraser button, i can remove it?
  10. Replies
    11
    Views
    1,203

    Re: how to use graphics g

    Thanks, now I've changed it to:



    public class PaintHere extends Canvas{

    }

    I'm hoping canvas would work because on the description it says: "A Canvas component represents a...
  11. Replies
    11
    Views
    1,203

    Re: how to use graphics g

    got it, my first step. I added it as an inner class, is that okay? or do i need to make it outside of my etch a sketch class?

    public class paint extends JPanel{

    }
  12. Replies
    11
    Views
    1,203

    Re: how to use graphics g

    Yeah =\. I wished I did mine out of scratch but we're suppose to use our prof's pre-made program and then do the modifications there. I made a quick tester just like that and it worked when I used...
  13. Replies
    11
    Views
    1,203

    Re: how to use graphics g

    I see. I added repaint(); after mouseReleased and whenever I tried to draw a rectangle, it still won't show up :(. I'm really confused on how it is able to draw on the GUI when it's at mouseDragged...
  14. Replies
    11
    Views
    1,203

    how to use graphics g

    when i make a

    public void paint(Graphics g){} in this program, it wouldn't do anything. But when I put it at the method mouseDrag, it would draw. But it doesn't work if I want to make rectanges...
  15. Replies
    7
    Views
    1,321

    Re: Selection sort code needs reverse

    Yes sir,

    I've looked at his pseudo code


    and this what I came up with.

    for (int stopInd = arr.length - 1; stopInd >= 0; stopInd--) { // for stopInd = index of last element DOWNTO 0...
  16. Replies
    7
    Views
    1,321

    Re: Selection sort code needs reverse

    Here: int positionOfMax = indOfMax(arr,stopInd);

    We're to write a method that finds the biggest item's index in the indofMax method.

    then we're to use the indofMax method to make the range...
  17. Replies
    7
    Views
    1,321

    Selection sort code needs reverse

    Hi, I've been working on this part of the code for at least 10 hours.



    private static void selectionSort( int[] arr )
    {
    for (int stopInd = arr.length - 1; stopInd >= 0; stopInd--) {...
  18. Replies
    11
    Views
    647

    Re: accessing class method problem

    Ok thanks, I'm going to try finding that error and see what happens when I change it to variable
  19. Replies
    11
    Views
    647

    Re: accessing class method problem

    Player.getComputerMove(game, nextTurn);
    } else {
    Player.getHumanMove(game, nextTurn);




    and when I change the Player to Game game instead of Player game, like this

    public static void...
  20. Replies
    11
    Views
    647

    Re: accessing class method problem

    I'm still not sure what static means, I just let Eclipse change it to make it work.


    This is my Board object

    public class Board {

    public static int[][] board;
    public static char[]...
  21. Replies
    11
    Views
    647

    accessing class method problem

    i'm trying to finish up the last project in our course and i cant get this part to work. it won't let me compile it and doesn't tell me the reason , other than application errors when i try to find...
  22. Replies
    11
    Views
    2,754

    Re: TicTacToe 2D Array help

    Fixed it :). Took about a week haha. but finally. I redone my validation method so that it searches through the entire array, then it finds the map of x's and O's and returns the value that it...
  23. Replies
    11
    Views
    2,754

    Re: TicTacToe 2D Array help

    Oh! The previous post was about comparing Reference to a String and I accidently used UserMove=="A1" instead of UserMove.equals("A1").

    and Okay, I tried using another method
    public static...
  24. Replies
    11
    Views
    2,754

    Re: TicTacToe 2D Array help

    My apologies, I edited in the original post but I'll say it here as well:

    The new problem is that the 'X' by the user will always override the 'O's by the computer. For example, if I place X at...
  25. Replies
    11
    Views
    2,754

    Re: TicTacToe 2D Array help

    Now I got a new problem :( can't seem to get my logic around it.
Results 1 to 25 of 29
Page 1 of 2 1 2