Forums Register Login

compiled but not running

+Pie Number of slices to send: Send
I have just written this code for calculating the perimeter and area of Rectangle, i was able to compile it but still couldn't run it, could anyone please help me have a look at it.
+Pie Number of slices to send: Send
What happens when you run it? What should it do that it is not doing? Are there runtime errors? A stacktrace perhaps?
+Pie Number of slices to send: Send
these go together
public class periArea extends JFrame {
Container pane = getContentPane();
pane.add(row1);
pane.add(row2);
pane.add(row3);


and these go together
JFrame frame;
frame.setTitle("Area and Perimeter");
frame.setSize(400,400);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setVisible(true);

the two are not the same JFrame - you should be able to work out the fix.

when fixed, your next question will be "only row3 shows" - JFrame's default
LayoutManager is BorderLayout - read the apidocs for BorderLayout to see how
multiple components should be added.
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 824 times.
Similar Threads
help I am having trouble getting the field to fill in
Calculator GUI app
help... I need a field to fill in
Please rescue me out
jButtons are driving me crazy
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:50:16.