Search:

Type: Posts; User: PhHein

Page 1 of 20 1 2 3 4

Search: Search took 0.32 seconds.

  1. Replies
    1
    Views
    63

    Re: Program keeps exiting

    Never compare Strings with ==. Use String.equals().
  2. Thread: Jlist display

    by PhHein
    Replies
    5
    Views
    90

    Re: Jlist display

    Hi again,
    your ListModel contains all Person instances. Add a ListSelectionListener to know which Person is selected. See the Oracle tutorial for examples:...
  3. Replies
    1
    Views
    76

    Re: Java Complex Data Types

    You just need a custom Shipment class with the listed attributes. Store all Shipment instances in a List.
  4. Thread: Jlist display

    by PhHein
    Replies
    5
    Views
    90

    Re: Jlist display

    Either you override toString() in Person, or you implement a custom ListCellRenderer
  5. Replies
    2
    Views
    67

    Re: Why am I getting this error

    You're creating a new award:

    award = new AthleticsAwardingBody();
    text.setText(award.getMessage());
    label.setIcon(award.getPrize(1).getIcon());
    What does award.getPrize(1) return? Does it have...
  6. Replies
    1
    Views
    60

    Re: I've got an equation wrong

    Please posrt your code
  7. Replies
    1
    Views
    59

    Re: Overriding the Collections.sort() Method

    You can pass a custom Comparator: http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#sort(List, Comparator)
  8. Re: How do I get my JList to refresh when refresh button pressed

    You need to notify the model that the underlying data have changed: http://docs.oracle.com/javase/7/docs/api/javax/swing/AbstractListModel.html#fireIntervalAdded(java.lang.Object, int, int)
  9. Replies
    30
    Views
    262

    Re: ResultsModel cannot resolve to a type

    What's ResultsModel supposed to be? Did you import it?
  10. Thread: ATM machine

    by PhHein
    Replies
    1
    Views
    69

    Re: ATM machine

    Sure, post your code and ask questions.
  11. Thread: Student Library

    by PhHein
    Replies
    1
    Views
    105

    Re: Student Library

    Yes, I can. What's your question?
  12. Re: How do I copy a multidimensional String array?

    Have a go yourself and ask when you get stuck. That's the only decent way of learning :)
  13. Re: How do I copy a multidimensional String array?

    You have to create new Strings with the same values as the original. String inherits Object's clone method. In your case it's pretty simple as you only deal with Strings:

    String[][] orig = {{"o1",...
  14. Replies
    5
    Views
    104

    Re: basketball players

    Hi and welcome, please use code formatting as described here: Announcements - What's Wrong With My Code?
    What problem do you have? Compiler errors, runtime exeptions, exploded radio?
  15. Replies
    7
    Views
    147

    Re: I have an issue with my code

    String smokingstatus
  16. Thread: Learning Java

    by PhHein
    Replies
    3
    Views
    190

    Re: Learning Java

    Oracle has some more: The Really Big Index
  17. Replies
    8
    Views
    135

    Re: Roman to ordinary number conversion

    Hey, please post your code.
  18. Thread: Regards

    by PhHein
    Replies
    1
    Views
    103

    Re: Regards

    Hi and welcome. Please take the time to read this: Announcements - What's Wrong With My Code?
  19. Thread: hi I'm April..

    by PhHein
    Replies
    1
    Views
    77

    Re: hi I'm April..

    Hi and welcome. Please take the time to read this: Announcements - What's Wrong With My Code?
  20. Thread: String

    by PhHein
    Replies
    10
    Views
    103

    Re: String

    :pbbbbbt: I was sick posting the same for the third time. I know that article.
  21. Thread: String

    by PhHein
    Replies
    10
    Views
    103

    Re: String

    if(last_name.length() >= 5){
    last_name = last_name.substring(0,5);
    }
    System.out.println("my username is: "+ first_name.charAt(0) + last_name + rnd);
  22. Thread: String

    by PhHein
    Replies
    10
    Views
    103

    Re: String

    Reread my last reply. Where do you check the length of last_name?
  23. Thread: String

    by PhHein
    Replies
    10
    Views
    103

    Re: String

    Test whether the last name is shorter than 7 characters, if so leave it like it is, if not use only the first 6 characters.
  24. Replies
    3
    Views
    80

    [SOLVED] Re: Not sure why this is happening.

    You're welcome.
  25. Replies
    3
    Views
    80

    [SOLVED] Re: Not sure why this is happening.

    Whenever you use in.nextInt() you enter a number followed by ENTER. nextInt() reads the number from the buffer and the ENTER is still there and is read by the following nextLine().
    So whenever you...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4