Search:

Type: Posts; User: Minken

Search: Search took 0.17 seconds.

  1. Replies
    8
    Views
    865

    [SOLVED] Re: Problem with swing-buttons

    I've solved the problem, thank you very much for the respons! :)
  2. Replies
    8
    Views
    865

    [SOLVED] Problem with swing-buttons

    Hi! I'm having some problems with a program i'm writing, the problem i'm facing is that i've created a few buttons using swing. But when I press the buttons nothing happens except for one button. For...
  3. Replies
    12
    Views
    7,154

    Re: Collection.sort problem

    @copeg - Thanks! that worked like a charm! =)
  4. Replies
    12
    Views
    7,154

    Re: Collection.sort problem

    Ah thanks helloworld922! That solved my problem! =)

    Now another question, if I wish to search for a title in the arraylist, is there a simple way to do this?
  5. Replies
    12
    Views
    7,154

    Re: Collection.sort problem

    Rewrote the comparable code to:
    public int compareTo(Book objekt) {
    if (objekt.getTitle().compareTo(this.getTitle()) < 0) {
    return 0;
    } else if...
  6. Replies
    12
    Views
    7,154

    Re: Collection.sort problem

    Ah yes this is confusing =/

    But since I do use the Comparable class with:
    public class Book implements Comparable<Book>

    I can't see the problem by using
    List<Book> temp = cob.remoteSort();...
  7. Replies
    12
    Views
    7,154

    Re: Collection.sort problem

    It is correct, however I see that the error is that i only pass the List to be sorted and not what method to be used with comparable. So it should look something like this:

    Pseudo-code:
    ...
  8. Replies
    12
    Views
    7,154

    Collection.sort problem

    Hi I'm having problems with java and the collections.sort method. I can't figure out how to sort an arraylist using the compareTo and Comparable interface. I've created the compareTo method and so...
Results 1 to 8 of 8