Search:

Type: Posts; User: joshft91

Page 1 of 2 1 2

Search: Search took 0.24 seconds.

  1. Replies
    2
    Views
    1,179

    Looking at a string ...

    Hey guys - quick question.

    I'm writing a little program just for the fun of it, and to start off I'm having the user enter a string - the string will be inputted in the same format but there...
  2. Replies
    7
    Views
    3,405

    Re: Go through string one char at a time

    Thanks for the reply, newbie - ended up helping me a bit. Decided it was easier to put the string into an array of chars and to go from there.
    /solved
  3. Replies
    7
    Views
    3,405

    Re: Go through string one char at a time

    Alright - I decided not to use substrings and decided to use the charAt method.
    I'm getting somewhere on it ... but I've run in to sort of a problem. I need to check to see if a string contains...
  4. Replies
    7
    Views
    3,405

    Re: Go through string one char at a time

    Would it be possible to use substrings? And somehow go through it ...
    What I need it to do is if it finds a certain character, to put it into a stack. I have everything else added for stacks and...
  5. Replies
    7
    Views
    3,405

    Go through string one char at a time

    Hey guys - so I need to write a method that will take a String as a parameter, and then I'll need it to go through that string one character at a time.

    What would be the best way to do this?
    ...
  6. Replies
    2
    Views
    1,883

    Re: Label not showing up.

    Alright, most of the code was pre-written like that. I'm supposed to just add a label. I wasn't aware that the bounds were required to be set - thanks.
  7. Replies
    2
    Views
    1,883

    Label not showing up.

    Alright guys... not sure what's goin on here, but obviously something is happening that I"m unaware of. You can ignore the ActionEvent method at the bottom... What I want to do is have the word...
  8. Replies
    10
    Views
    2,029

    Re: Incrementing button by 1

    It appears that this works...

    public void actionPerformed(ActionEvent event) {
    if (event.getSource().equals(button1)) {
    button1Count++;
    ...
  9. Replies
    10
    Views
    2,029

    Re: Incrementing button by 1

    Alright... Well I tried something like this - it compiles fine, but it increments the 2nd button only. :S


    public void actionPerformed(ActionEvent event) {
    if (event.equals(button1)){
    ...
  10. Replies
    10
    Views
    2,029

    Re: Incrementing button by 1

    Edit: Got it working - public void actionPerformed(ActionEvent event) {
    buttonCount++;
    button.setText(Integer.toString(buttonCount));

    }


    The second part to this problem...
  11. Replies
    10
    Views
    2,029

    Re: Incrementing button by 1

    I wasn't wasting my time... All I was saying was that I don't have a lot of other places to go for help.

    I know I'm going to be incrementing it in the actionPerformed method. The text is set here...
  12. Replies
    10
    Views
    2,029

    Incrementing button by 1

    Hey guys... so here's the "problem" now. When you compile and run this code as of now, it will bring up a screen with a button on it - when you click teh button it will do nothing.
    We're supposed...
  13. Replies
    1
    Views
    1,887

    Identifying invalid calls

    Hey guys, quick question here - I'm supposed to identify which calls to the constructor are invalid - here's the code. Note this is not compilable, it's just the example that the book gives.

    My...
  14. Replies
    7
    Views
    2,118

    Re: MergeSort won't work

    Ah-ha! I called it this way and it appears to be sorting just fine...


    mergeSort_srt(randomArray2,0,randomArray2.length-1);
  15. Replies
    7
    Views
    2,118

    Re: MergeSort won't work

    Hm.... I'm not super familiar with arrays yet, and I've tried different ways of calling the method but with no success. My thought process was that the lo, indicated by randomArray[0] through...
  16. Replies
    7
    Views
    2,118

    Re: MergeSort won't work

    Thanks for the reply.
    We're supposed to create two arrays and sort array2 so we ahve the first one as an original.
    I stripped the code down as far as I could and got this... it still doesn't...
  17. Replies
    7
    Views
    2,118

    MergeSort won't work

    Hey guys ...

    Alright, I have my sort implemented and everything compiles fine. Up in my main I have an array of 100 random integers... then I call the mergeSort method with

    ...
  18. Thread: Timing a sort

    by joshft91
    Replies
    1
    Views
    2,351

    Timing a sort

    Alright,

    So I have my class set up with five different sort methods (merge, insertion, etc)...

    My main method looks like this.


    public static void main(String[] args) {

    int[]...
  19. Thread: Loading array

    by joshft91
    Replies
    3
    Views
    1,894

    Re: Loading array

    Right now, when I press the run button in Eclipse, it will start at number 1 and ask the user to enter an integer. If I press enter without entering anything, the program will quit. Since the...
  20. Thread: Loading array

    by joshft91
    Replies
    3
    Views
    1,894

    Loading array

    Hey guys -

    Alright, so for this assignment, we're "simulating" entering high temperature values into an array. The array is of size 32, and each index in the array corresponds to the day (hence...
  21. Thread: Calendar date

    by joshft91
    Replies
    11
    Views
    2,709

    Re: Calendar date

    Little bump here. I posted this thread over on a different forums...

    Creating a test class - Java Forums

    Got any insight?
  22. Thread: Calendar date

    by joshft91
    Replies
    11
    Views
    2,709

    Re: Calendar date

    Alright, I read that but I'm still unsure how to incorporate a method into that.

    public void nextWeek() {

    for (int i = 0; i <7; i++) {
    tomorrow();
    }
    }
  23. Thread: Calendar date

    by joshft91
    Replies
    11
    Views
    2,709

    Re: Calendar date

    Alright, I got that fixed. Everything up in the constructor works correctly now.

    However, the problem I'm having now it the "nextWeek()" method. My "tomorrow()" method works completely fine - I...
  24. Thread: Calendar date

    by joshft91
    Replies
    11
    Views
    2,709

    Re: Calendar date

    Did you read my intro? Let me know when you do.
    I think I'll be moving to a different forum for help ... thanks for the ... uh ... help in your second post? Oh wait.
  25. Thread: Calendar date

    by joshft91
    Replies
    11
    Views
    2,709

    Re: Calendar date

    Alright, thanks for the reply. Here's a question I have regarding the setup of the constructor.

    public Date (String month, int day, int year) {
    if...
Results 1 to 25 of 27
Page 1 of 2 1 2