This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes passing value and setting it to jlabel text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic

passing value and setting it to jlabel text

Rodney Perello

Joined: Sep 18, 2012
Posts: 1
This site is really helping a lot of people! I have a simple program that I can't understand why I am getting the NullPointerException each time I try to pass a value from one form to another and setting it up as a text in a label. If I pass the value and do the pritln, I can actually see the result but if I place it in the jlabel as text, that's the time I get the error. Please Help! Thanks! Here is the code to pass the value to the other form.

Bill Gorder

Joined: Mar 07, 2010
Posts: 1646

Looks like you may have intended to post this in our Swing (not Spring ) forum. I will move it there for you. Welcome to the Ranch!

[How To Ask Questions][Read before you PM me]
Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1076

I think this is a duplicate of this thread. We can continue the discussions there. Locking down this thread.

I agree. Here's the link:
subject: passing value and setting it to jlabel text
Similar Threads
GridBagLayout Problem
Vertical JLable
Problem with dynamically setting the classpath at runtime
passing value and setting it to jlabel text
making a class visible