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...
Type: Posts; User: jason3460
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...
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...
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...
Thanks!! I was calling MyControlPanel twice.. -__-
MyShape.java
package calculations;
public class MyShape
{
public double getArea(double length)
{
return 0;
but my actionlistener has these lines of code :
myShape = new Circle();
theControlPanel.setShape(myShape);
System.out.println("The shape is: "+myShape);
...
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:
...
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...
i have this method in my MyControlPanel class:
public void setShape(MyShape suppliedShape)
{
theShape = suppliedShape;
}
which is meant to get the shape from the...
line 79 is this:
area = theShape.getArea(sliderValue);
I don't know how to do that, hence why i came here for help.
First of all, here is my code:
MyControlPanel.java
package calculations;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.ChangeEvent;