Search:

Type: Posts; User: GoodbyeWorld

Page 1 of 14 1 2 3 4

Search: Search took 0.46 seconds.

  1. Replies
    5
    Views
    93

    Re: Need help with a loop

    I'll do the code, with two adjustments (round2 was a helper method or appears to be, so I made it private. I also added an array to store the values.). BTW, its Code


    import java.util.*;
    ...
  2. Replies
    5
    Views
    93

    Re: Need help with a loop

    It runs. What seems to be the problem? Are you hoping to format your final answer a certain way?

    P.S., I would make round2 method private.

    Your HWWeight variable isn't doing anything in the...
  3. Replies
    14
    Views
    137

    Re: Simple project help

    Could the OP use an array instead? That also could hold three objects at once.
  4. Replies
    14
    Views
    137

    Re: Simple project help

    You can use the equalsIgnoreCase() method that takes a String. That way, it won't matter if the case is different as long as it matches other than case.
  5. Replies
    2
    Views
    99

    Re: Cannot find symbol error

    As for printGrade(), I think it might need to be passed a String or something. You can get the String from what is returned by gradeCalculator(mark).
  6. Re: Programming about finding the triangle

    I'm not sure how it got equilateral, but it does seem to me that it would not go into either of the three cases to assign middle as 5 would be biggest and 2 would be smallest, with a and c being 5...
  7. Replies
    1
    Views
    106

    Re: Applet not initialised error

    The applet tag is deprecated in html5. Use the object or embed tag instead. You can find how to do this on Google.


    I found an applet online that works.



    import java.applet.*;
    //...
  8. Replies
    2
    Views
    86

    Re: Time problem

    It looks like you are calling it with an int, not a Time.

    What does your constructor do if min is positive or is if is negative but greater than -60?
  9. Re: JOptionPane Message boxes not opening..?

    This was also not working and needed to go in a for loop.

    if (Final[i] >= 85) {
    newGrade[i] = 'A';
    a++;
    } else if (Final[i] >= 70) {
    newGrade[i] =...
  10. Re: JOptionPane Message boxes not opening..?

    Looking at it now.

    I got an an ArrayIndexOutOfBoundsException with

    Final[i] = assg1[i] + assg2[i] + exam[i];

    It seems that the value of i is 2 and that is out of range as there is no...
  11. Thread: Need Help

    by GoodbyeWorld
    Replies
    10
    Views
    151

    Re: Java Arrays

    I'm not going to write it for you.

    What do you mean, reverse in place?

    Assuming you mean what I think you mean, I would do a for loop that covers from 0 to half of the length of the array.
    ...
  12. Replies
    3
    Views
    86

    Re: Need help getting errors

    n=keyboard.nextLine;

    There is no Scanner variable named nextLine. Also, the Scanner method method nextLine() returns a String, not an int.

    A square root isn't a number/2. (Well, it is for 4...
  13. Re: Rock Paper Scissors GUI Help CPU Choice

    As I said, the way I was doing it was overly complicated.

    A better way would be this:



    import java.awt.Color;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import...
  14. Re: Trouble with randomly generated arrays

    The nextLine() call would only be valid to get rid of garbage date if you had a next() or nextLine() that you used to store something right after getting a number type as it would pick up the enter...
  15. Re: Rock Paper Scissors GUI Help CPU Choice

    Actually, I found an easier way to do it in this case that makes it not needed to have them class variables after all. You simply would type cast it to a JButton and so forth as I had above.
    ...
  16. Replies
    2
    Views
    73

    Re: how do I continue on

    Where is your distinct array initialized?
  17. Re: Im copying from a book and its not working plz help

    It might be the two semicolons. Also, repaint() is void and I think it is looking for an ActionListener.
  18. Re: Implament an Array as an AI Choice

    So this thread is done then.

    Are you having trouble with the ButtonListener? It doesn't appear to be doing anything much.

    First off, make your buttons class variables rather than local to your...
  19. Re: How do I make turn an image into a tiled image

    tile[j] is an array. arr[i] is also an array. You can combine the two but you cannot add them. That's why it's giving you that error.
  20. Re: to develop the complete arithmetic class

    An import statement.
  21. Re: Assistance with writing/reading to and from vector in JAVA

    Where do you ever initialize transCount?

    As for adding a Transaction, if it gets too big, I would create a new array of Transactions that is twice the size of the current one. I would then copy...
  22. Thread: help

    by GoodbyeWorld
    Replies
    8
    Views
    134

    Re: help

    You are getting the + inside of the quotes.

    Also, what is the problem? Are you having trouble with your other classes? Is there something wrong with the sales class?
  23. Replies
    9
    Views
    118

    Re: JLabel Grid Layout?

    import java.awt.GridLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JInternalFrame;
    import javax.swing.JLabel;

    public class Example extends JFrame
    {
    ...
  24. Replies
    9
    Views
    118

    Re: JLabel Grid Layout?

    What does this have to do with JavaFX? What is OT?

    Also, you said component, not JComponent.
  25. Replies
    9
    Views
    118

    Re: JLabel Grid Layout?

    No, actually that is NOT exactly true. Container is actually a subclass of Component. Component doesn't have an add(Component) method. It only lets you add a PopupMenu.

    On the other hand,...
Results 1 to 25 of 338
Page 1 of 14 1 2 3 4