Search:

Type: Posts; User: jason3460

Search: Search took 0.13 seconds.

  1. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    I tried making a new class, though I've been having a lot of trouble,

    I made a new thread here, your help would be much appreciated, If you want i will post all my code, or any code you would...
  2. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    Alright thanks a lot, I'll most likely be back for help -__-

    --- Update ---

    One question, would I make a new class for the painting, or would i implement it within the MyFrame or MyControlPanel...
  3. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    Well thank you so much! Can't believe I didn't realize I had called it twice.

    Now I have to get it so that the shape is drawn on the screen, and changes size depending on the value selected by the...
  4. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    Thanks!! I was calling MyControlPanel twice.. -__-
  5. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    MyShape.java


    package calculations;

    public class MyShape
    {
    public double getArea(double length)
    {
    return 0;
  6. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    but my actionlistener has these lines of code :



    myShape = new Circle();
    theControlPanel.setShape(myShape);
    System.out.println("The shape is: "+myShape);
    ...
  7. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    I tried clicking each of the shapes, and then moving the slider, i get the null error.

    I tried not clicking the menu and moving the slider, and the same thing happens.


    I tried using:
    ...
  8. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    It is called in my JSlider ChangeListener, it is being used so that whenever say the square is selected from the jMenu (MyFrame class), it sends the selected shape to the MyControlPanel class so that...
  9. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    i have this method in my MyControlPanel class:


    public void setShape(MyShape suppliedShape)
    {
    theShape = suppliedShape;
    }


    which is meant to get the shape from the...
  10. Replies
    20
    Views
    2,630

    [SOLVED] Re: NullPointerException with JSlider

    line 79 is this:


    area = theShape.getArea(sliderValue);


    I don't know how to do that, hence why i came here for help.
  11. Replies
    20
    Views
    2,630

    [SOLVED] NullPointerException with JSlider

    First of all, here is my code:

    MyControlPanel.java


    package calculations;

    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.ChangeEvent;
Results 1 to 11 of 11