never mind got it working
Type: Posts; User: cslx99
never mind got it working
so i took out the "getX();" line from the shape constructor:
public Shape(int x, int y){
this.x=x;
this.y=y;
}
public int getX(){
return...
quite honestly i have no idea why the "x=getX();" line is there, it was just my last effort in trying to get this to work. from my understanding, setX(); is supposed to set the new value for x. when...
so i got rid of the void. not sure why i had it there in the first place cuz i dont have it it any of my other constructors within my project. but i still cant seem to get the program to verify that...
so i have a book for java and a professor that say that the following are constructors:
public Shape(){
}
&
public void Shape(int x, int y){
}
how bout this:
public class Project6 extends JFrame{
private static Shape [] thearray = new Shape[100]; // 100 Shapes, circle's, tri's and rects
static MyPanel panel;
public...
can you please clarify?
I have to do the following steps:
1) Project6 class will have to extend the JFrame class
2) Project6 constructor will have to set up the GUI window.
3) A new abstract method: public void...
i am coding a project that has "Shape" as the parent with various shapes (ie rectangle, triangle, etc.) as sub-classes using inheritance. i am supposed "Modify the constructor and set methods of the...
I'm not sure what you mean by GUI builder but I hard coded everything. The screen in the picture is what popped up after I ran the code.
Sorry, I'm fairly new with Java. I created a new project in NetBeans by selecting New Project --> Java Desktop Application. This is what NetBeans produced for me:...