Search:

Type: Posts; User: alaindhaene

Search: Search took 0.54 seconds.

  1. Re: Help splitting into two different classes.

    it's a good idea to seperate a model where you put the busisness logic (in your example : how you count the annualcompensation),
    the I/O of your program (where you ask the data) and a place where...
  2. Replies
    6
    Views
    1,325

    Re: JComboBox and array problems

    When you use a JComboBox it's good practice the use a ComboBoxModel to organise the data. Then you can use a constructor of JComboBox model where you can give the model as parameter. So you work on...
  3. Re: Problem with calling objects from same-class methods in main

    I think it's better to use a generic type then you have to create an ArrayList or HashMap of this generic type to add and retrieve the specific object (Fossil, Fish,...).
    To create this objects you...
  4. Re: Problem with calling objects from same-class methods in main

    I think it's better to create a generic type then you have no duplicatie of code. You can make a ArrayList or HashMap of this generic type and in runtime you can add and retrieve the specific object...
  5. Replies
    16
    Views
    823

    [SOLVED] Re: cannot find symbol

    In the class main:
    ch=ob.nextInt();
    ob is a calculator object and don't recognize the methode nextInt() who belongs to a Scanner object.

    while(n<5);
    the variabele n is not declared in the...
  6. Re: How to find indexes of ALL occurrences of object in ArrayList

    A Iterator is just an manner to iterate over a collection. When you look to the API it has no methods to say when a element is in the collection.
  7. Re: Problem with calling objects from same-class methods in main

    A is see i thought Amber was a Object.
    I think you have to use a abstract class so you have only to deal with one data type. With polymorifsm you need only one add/get methode where you can add...
  8. Replies
    2
    Views
    866

    Re: Assign layout_width programmatically

    First off all it's not a good idea setting layout programmatically.

    Button button = new Button(this);
    bt.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
  9. Re: Problem with calling objects from same-class methods in main

    In your main program make a datastructure of amber objects (e.g ArrayList) en provide this with amber objects (with your createFossils methode) then with a iterator object you can use your...
Results 1 to 9 of 9