I have this code and for some reason I keep getting an error where it says "exporting non-public type through public api ".. I'm not sure why this keeps happening but it does so for getCircleInfo / drawCircle. Thanks for your help.
- Me.
[code=java]
package shapemaker;
import java.awt.*;
import javax.swing.*;
public class ShapeMaker {
private JFrame win;
private Container contentPane;
public ShapeMaker ( ) {
win = new JFrame("Shape Maker");
win.setSize(400 , 300);
win.setDefaultC loseOperation(J Frame.EXIT_ON_C LOSE);
win.setVisible( true);
contentPane = win.getContentP ane();
contentPane.set Background(Colo r.WHITE);
}
public static void main(String[] args) {
ShapeMaker shapeMaker = new ShapeMaker();
shapeMaker.star t();
}
public void start ( ) {
Circle circle = new Circle ( );
getCircleInfo(c ircle);
drawCircle(circ le);
}
public void getCircleInfo ( Circle circle ) {
double radius;
int x, y;
radius = Double.parseDou ble ( JOptionPane.sho wInputDialog (win, "Enter Radius") );
circle.setRadiu s(radius);
circle.setFillC olor(Color.oran ge);
circle.setPenCo lor(Color.black );
x = Integer.parseIn t( JOptionPane.sho wInputDialog ( win, "Enter X Cord:" ) );
circle.setXCord (x);
y = Integer.parseIn t( JOptionPane.sho wInputDialog ( win, "Enter Y Cord:" ) );
circle.setYCord (y);
}
public void drawCircle ( Circle circle ) {
Graphics g = contentPane.get Graphics();
circle.draw(g);
}
}[/code]
- Me.
[code=java]
package shapemaker;
import java.awt.*;
import javax.swing.*;
public class ShapeMaker {
private JFrame win;
private Container contentPane;
public ShapeMaker ( ) {
win = new JFrame("Shape Maker");
win.setSize(400 , 300);
win.setDefaultC loseOperation(J Frame.EXIT_ON_C LOSE);
win.setVisible( true);
contentPane = win.getContentP ane();
contentPane.set Background(Colo r.WHITE);
}
public static void main(String[] args) {
ShapeMaker shapeMaker = new ShapeMaker();
shapeMaker.star t();
}
public void start ( ) {
Circle circle = new Circle ( );
getCircleInfo(c ircle);
drawCircle(circ le);
}
public void getCircleInfo ( Circle circle ) {
double radius;
int x, y;
radius = Double.parseDou ble ( JOptionPane.sho wInputDialog (win, "Enter Radius") );
circle.setRadiu s(radius);
circle.setFillC olor(Color.oran ge);
circle.setPenCo lor(Color.black );
x = Integer.parseIn t( JOptionPane.sho wInputDialog ( win, "Enter X Cord:" ) );
circle.setXCord (x);
y = Integer.parseIn t( JOptionPane.sho wInputDialog ( win, "Enter Y Cord:" ) );
circle.setYCord (y);
}
public void drawCircle ( Circle circle ) {
Graphics g = contentPane.get Graphics();
circle.draw(g);
}
}[/code]
Comment