Search:

Type: Posts; User: help_desk

Page 1 of 4 1 2 3 4

Search: Search took 0.18 seconds.

  1. Re: while loop loops foreve even with the right inputs.

    Hi, Greg,

    I solved it now. I just had to think about it differently because I didn't understand his approach. Thanks anyways for the response.
  2. Re: while loop loops foreve even with the right inputs.

    Well, here is his code:


    I didn't quite make much sense out of it. I did ask if he could elaborate more on it. I understood his idea that you can't use the !option.equalsIgnore("Y") when it is N...
  3. Re: while loop loops foreve even with the right inputs.

    Yes sir. That is what I am looking for.
  4. Re: while loop loops foreve even with the right inputs.

    Sorry Greg IF I didn't make sense. Here is what I want to make sense of: I want the user to either choose Y or N for the loop to quite. Should the user enter any other character aside these two, the...
  5. Re: while loop loops foreve even with the right inputs.

    Hi PhHein,

    I see the logic in it but how could I write it such that only when the user enter's Y or N will the loop stop because based on whether the user enter's Y or N, the programme goes into...
  6. while loop loops foreve even with the right inputs.

    Could anyone point me to why when the user enters Y or N, this loop still continues looping instead of quitting?

    Thanks


    System.out.println("Enter Y to indicate Up OR...
  7. Replies
    7
    Views
    1,179

    Re: Different units in calculation

    The value_input is a user entered value in degrees. So, the user enters a value in degree e.g 23 and then enters the LS in knots e.g 5knots and the calculation is done using the formular:
    AS =...
  8. Replies
    7
    Views
    1,179

    Re: Different units in calculation

    In other words, such conversion is baseless? That is what I want to know.
    Suppose you are given the following :
    AS = Air-speed (in mph) LS = Landd-speed (in knots) value_input = speedWalk...
  9. Replies
    7
    Views
    1,179

    Different units in calculation

    Hello guys,

    I have a maths application I am working on in java. This is more related to maths but there could be some here who have worked with calculations like this in their java project.
    One...
  10. Replies
    5
    Views
    1,213

    [SOLVED] Re: Rendering the cells of JComboBox in Java

    Hi Kevin, I have added an MCVE. I am hoping anyone could help me with this. Thanks
  11. Replies
    1
    Views
    1,031

    Split a String in java using delimeters

    Hello guys,

    I have a String as follows: "the|boy|is|good"

    now, I want to split this string using the "|" delimeter.

    I tried this :

    String line = "the|boy|is|good";
    line.split("|");
  12. Replies
    5
    Views
    1,213

    [SOLVED] Re: Rendering the cells of JComboBox in Java

    Hi Kevin,

    Yeah, I have tried things. First, i just set the JComboBox with the ListCellRender. so, jComboBox.setRenderer(ListCellRenderer); but how to create the model is the problem. There has to...
  13. Replies
    5
    Views
    1,213

    [SOLVED] Rendering the cells of JComboBox in Java

    Hi guys,

    Say I have a student class with fields names and Gender. Now, I have a students' array. such that I can create multiple students' classes: student a, student b, student c e.t.c and store...
  14. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Thanks alot @Cornix. Supposing the JList lists the names of the student and I wanted to click on a name so an event is fired that would do something else..any pointer or idea on how to fire such...
  15. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    @Conix, please could I just ask you a question? Instead of JList, could I use a JComboBox with the DefaultListCellRender?
  16. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    @Cornix, thanks alot. you have been patient and gentle to my questions. I appreciate.
  17. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    import java.awt.Color;
    import java.awt.Component;

    import javax.swing.DefaultListCellRenderer;
    import javax.swing.JLabel;
    import javax.swing.JList;

    import Student;

    public class...
  18. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Hi Conix,

    Please, I need some clarifications. I have done abit study but I need to understand somethings from your code as most examples are NOT so explanatory. Which of my classes given in the...
  19. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Hi Conix,

    Ok, I will try to study that as I don't know much about it and see if I can get it done . Should there be some stuffs I couldn't get, hope you will be willing to assist me? Thanks.
  20. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Hi Greg,

    It's ok. I accept your advice. Might even look into it later. Meanwhile, I am displaying the student on the JList but a student has a name and an ID. How would I modify my custom JList...
  21. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    I have added a top level container now. The JFrame. The component fires up but then, how would I rewrite my custom JList model so I can only display the names and not the IDs of the students?

    ---...
  22. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Hello Greg, I have run everything and all is fine now. So, now when you run the code and hit the "click me!" button, instead of it to go the lines below from the controller class and fire up the...
  23. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Sorry Greg, I have added the main and made some adjustment to the if() condition. Let me know if you are able to run the code now.

    Thanks
  24. Replies
    22
    Views
    2,004

    Re: Working with custom JList Component in Java

    Hello ,

    I don't know if the MVCE I have provided is OK. I think this should work and still be understandable. I have implemented the observer pattern as well as the MVC to make things clearer. So,...
  25. Replies
    22
    Views
    2,004

    Working with custom JList Component in Java

    I am trying to use the JList to display a list of students. Now, each student has a first name, last name and course taken. each courses taken by the student has its' own name, level and idNumber....
Results 1 to 25 of 77
Page 1 of 4 1 2 3 4