GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #11  
Old 17-Jun-2009, 17:38
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Exception in thread "main" java.lang.NullPointerException


Refer back to post #9, I already gave you a hint, but if you still get stuck, post another reply.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
Last edited by TurboPT : 17-Jun-2009 at 18:22.
  #12  
Old 18-Jun-2009, 10:48
idrismca idrismca is offline
New Member
 
Join Date: Jun 2009
Posts: 5
idrismca is on a distinguished road

Re: Exception in thread "main" java.lang.NullPointerException


thanx for yr help turbo.... i did get yr hint but the prob is if i initialize like this

JAVA Code:
    private JPanel mainPanel= new JPanel();
    private JTextField _username= new JTextField();
    private JPasswordField _password= new JPasswordField();
    private JButton _loginButton= new JButton();
.................................


the executable jar does run from the command prompt but only a minimized blank frame comes up with nothing on it... and an error on the console
Code:
Exception in thread "main" java.lang.NullPointerException at com.ardenasset.ui.taxlot.forms.TaxLotToolUI.main(Unknown Source)


Also I when i try running it from intelliJ the KeyListener n action listeners do not respond because I guess i initialized "new".....

Where am i wrong? i cant figure out.... is it that because i m using intelliJ and in the "TaxLotTool.form" GUI i have used GridBagLayout(IntelliJ) for the layout manager in some panels including the main panel?

I have even included the forms_rt.jar of intelliJ in the jar's classpath.
  #13  
Old 18-Jun-2009, 13:32
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Exception in thread "main" java.lang.NullPointerException


1. I don't see (unless I missed it) where the controls are added to the UI? That would explain the 'blank frame'.

2. For the exception, it appears that 'mainPanel' is not initialized, so that could still 'bomb' main, at this statement:
JAVA Code:
         frame.setContentPane( gui.mainPanel );  // mainPanel not initialized?

In the constructor, I didn't suggest that you place a try around every listener (doesn't hurt anything), I was referring to the first statement in the constructor for addShutdownHook() because the Java API mentions three different exceptions that could possibly be thrown by that call.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread Stopping Exception Gix .NET Forum 12 28-Nov-2006 05:30
Thread itch C++ Forum 7 10-May-2006 16:10
please help in solving: Exception in thread "main" java.lang.nullpointerexception vkiran_v Java Forum 8 09-May-2006 08:06
C++ Copy Constructor & Exception issues greymalkin C++ Forum 3 05-Oct-2005 22:36
Sending message to GUI thread that ISNT the main thread mpviii MS Visual C++ / MFC Forum 1 20-Apr-2005 13:49

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:03.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.