File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to set GridLayout for a JPanel that is inside JFrame having BorderLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set GridLayout for a JPanel that is inside JFrame having BorderLayout" Watch "How to set GridLayout for a JPanel that is inside JFrame having BorderLayout" New topic
Author

How to set GridLayout for a JPanel that is inside JFrame having BorderLayout

Gaurav Gambhir
Ranch Hand

Joined: Mar 04, 2006
Posts: 254
For the following code, I am getting the run time error, Please help



Runtime error is coming for the following lines,


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
you have this
private JLabel ...,...,lbladdress,lblage;

then this
lbladdress=new JLabel("Address");
lbladdress=new JLabel("Age");

look odd?
Gaurav Gambhir
Ranch Hand

Joined: Mar 04, 2006
Posts: 254
Even after making JLabel public doesn't solve my problem as when I run the program I am getting Exception in thread "main" java.lang.NullPointerException
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
read *every* word in my reply (hint: look for duplicates)
Gaurav Gambhir
Ranch Hand

Joined: Mar 04, 2006
Posts: 254
That was really my very silly mistake Thanks alot Michael
 
 
subject: How to set GridLayout for a JPanel that is inside JFrame having BorderLayout