File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes compiled but not running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "compiled but not running" Watch "compiled but not running" New topic

compiled but not running

jide agboola

Joined: Nov 11, 2006
Posts: 9
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.

When you are going through Hell, you keep going<br /> <br /> Winston Churchill.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

What happens when you run it? What should it do that it is not doing? Are there runtime errors? A stacktrace perhaps?

GenRocket - Experts at Building Test Data
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
these go together
public class periArea extends JFrame {
Container pane = getContentPane();

and these go together
JFrame frame;
frame.setTitle("Area and Perimeter");

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.
I agree. Here's the link:
subject: compiled but not running
It's not a secret anymore!