Search:

Type: Posts; User: meni

Page 1 of 2 1 2

Search: Search took 0.16 seconds.

  1. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    Then I don't get it.

    'vehicle' is the variable of the class Vehicle, right?
    Obviously I am wrong, but when the vehicle is called, wouldn't it pull the constructor of the class Vehicle?
  2. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    I cut and pasted from my first post, sorry. Adding those methods were the only things I did on my copy.

    This is the same problem I've been having since yesterday. I am sorry; I am just not...
  3. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    I keep getting a NullPointerException at this line, which is in the pAddVehicle class


    vehicle.addItem(ma, mo,co, numD, numC, p);
  4. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    import javax.swing.*;

    public class PRJ03 extends JFrame
    {
    public static void main (String [] args)
    {
    Vehicle vehicle;
    pAddVehicle pnlAdd;
    pShowVehicle pnlShow;
  5. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    Then I am confused. I thought if there was not a value assigned, it would refer to the constructor?
  6. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    Ok, so I am back. The break worked somewhat, I got my other project done fast. This one is still stumping me.

    So with that statement in main creating an instance of the Vehicle class and my...
  7. [SOLVED] Re: When I add a 2nd panel the result is all white

    Thank you again! I got the problem solved and it looks like the diagram he wanted.
  8. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    I'll come back later. I am taking a break For food and to clear my head, like has been written.
  9. [SOLVED] Re: When I add a 2nd panel the result is all white

    Yes, why is that? I am needing to put a pie chart on the second panel, or right side of the frame.
  10. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    Ok so in pAddVehicle class



    private Vehicle vehicle;

    Is instantiating the Vehicle class to use, right?

    but in my Vehicle class, this
  11. [SOLVED] Re: When I add a 2nd panel the result is all white

    I get this in my console. So if I am reading it right. The uppper left corner of that panel is at x=574 and y=0?

    If that's the case, then I need to get past the x value on my fillArc method?
  12. [SOLVED] Re: When I add a 2nd panel the result is all white

    pnlChart is the variable for it. It has been declared and added to the frame in the main program.



    PRJ04 frmApp = new PRJ04();
    PanelChart pnlChart = new PanelChart();
    ...
  13. [SOLVED] Re: When I add a 2nd panel the result is all white

    I actually got the white problem fixed. It's not throwing the exception anymore. Now it is just not showing up the second panel on the frame. I've edited the program in my original post to show the...
  14. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    I'm sorry, I don't see why it didn't.
  15. [SOLVED] When I add a 2nd panel the result is all white

    import javax.swing.*;
    import java.awt.*;

    public class PRJ04 extends JFrame
    {
    public static void main (String [] args)
    {
    PRJ04 frmApp = new PRJ04();
    PanelChart...
  16. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    It is also null. I've referenced it and such, just like you were saying with the other problem. It is listed.

    Sorry, just getting frustrated with this one. I've even tried stepping on to another...
  17. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    pnlAdd.setOrderPanel(pnlShow);


    I put that into my main program, if thinking right. And now get a NullPointerException at


    vehicle.addItem(ma, mo,co, numD, numC, p);


    which I already had...
  18. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    We never called it in our class example and it worked. That is what is throwing me off then. What constructor then?
  19. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    public void setOrderPanel(pShowVehicle p)
    {
    pnlShow = p;
    }


    I thought that is what this did? The only notes I have, is the program we did in class that day. So I am looking off...
  20. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    That variable is just declaration of the pShowVehicle panel. You can print that?

    That was new to me. I tried it and pnlShow has a null value. So i need to make a constructor on the pShowVehicle...
  21. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    System.out.println(pnlShow.doSomething());


    Ok, I put this line in right before that line and it can't resolve the println void. I know I am missing something common, but I can't think what. This...
  22. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    When I ran it, it never showed up on that panel. Hmm, the method was what I was going to use to spit out the contents of the Vector.

    When I attempt to add it back, I get the NullPointerException...
  23. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    After I fixed all of it, I thought about this. It didn't click still why. Since in my pnlShow class, doSomething was written as:


    public void doSomething()
    {
    ...
  24. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    After finding the line, it was this snippet of code:


    pnlShow.doSomething();


    Thank you so much for your help! Now to try and display the Vector
  25. Replies
    44
    Views
    4,944

    Re: Having a NullPointerException

    I'm sorry. Like I initially said, I've been up too long looking at different projects and code, my mind is melting. Ok, when I did that, I get this
Results 1 to 25 of 31
Page 1 of 2 1 2