So I'm building a simple TextEditor with the help of Jpanels But I keep gettin the NullPointerException when I try to assign my JFileChooser on to a variable. I've got 2 classes. A viewer which contains all the Jpanels and a Controller which handles the logic when pressing buttons. I've got a Load button when pressed is supposed to show a file chooser were I can select a text file and append that to my TextArea.  Viewer:  private JFileChooser fc = new JFileChooser();  //....  if(e.getSource() == btnOpen){             controller.loadText();         }  public JFileChooser getFc(){     return fc; }   Controller:  public void loadText(){     JFileChooser fc = view.getFc();        //Throws NullPointerException     JTextArea taMain = view.getTaMain();     int returnVal = fc.showOpenDialog(fc);          if (returnVal == JFileChooser.APPROVE_OPTION) {             File file = fc.getSelectedFile();             taMain.append("Opening: " + file.getName() + "." );         } else {             taMain.append("Open command cancelled by user.");         } }   I do undertstand the exception, but how come this occurs? The TextArea doesn't have to contain anything.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Let $x,y,z>0$ and $x+y+z=1$, then find the least value of ${{x}\over {2-x}}+{{y}\over {2-y}}+{{z}\over {2-z}}$ Let $x,y,z&gt;0$ and $x+y+z=1$, then find the least value of  $${{x}\over {2-x}}+{{y}\over {2-y}}+{{z}\over {2-z}}$$  I tried various ways of rearranging and using AM > GM inequality. But I couldn't get it. I am not good at inequalities. Please help me.  I wrote $x$ as $1-(y+z)$ and I took $x+y$ as $a$ and the others as $b$ and $c$. And I am trying. Mechanism to prevent edits without approval? I would say a quarter to half my questions end up getting edited the vast majority of which end up dramatically changing the context of my question. I'm not against good advice (I've acted on about 2% of all the criticisms I have ever had about my work since they were actually thoughtful) though I think since I joined overflow sites years after I've had a good grip on most of the material I work with people are seeing low reputation and presuming that equates to low levels of comprehension.  Regardless of the reasoning behind people making edits is there an option I can use that would require my approval in order to commit an edit to my questions?   I have no interest in spamming questions in order to artificially boost my reputation. I am getting tired of having to add bullet points telling people to ask for clarifications instead of editing my posts. Having to correct my posts so often reduces my desire to ask the question if I have to review the question again (even with the revision pages available). As this is a discussion there is no reason to edit this post, I will be happy to revise my own if you leave comments as I actively follow questions I participate in though the office of redundancy redundancy requires that I state I know what I am asking.   For example, say I post about Kubuntu (which by default uses KDE) and someone edits it changing the OS to Ubuntu (which uses Gnome by default). Then, answers become Gnome-oriented for a KDE question and the entire context has been changed--negating the point of asking the question in the first place. https:// search results appearing on Google for purely http:// site If the earth would stop spinning, what would happen? How to change this matrix with respect to standard basis? Given the basis $\beta = \{ (1, 1, 0),\ (1, 0, -1),\ (2, 1, 0)\}$ and the matrix:  $$ A =         \begin{bmatrix}         1 &amp; 1 &amp; 0 \\         1 &amp; 1 &amp; 0 \\         0 &amp; 0 &amp; 1 \\         \end{bmatrix} $$  with respect to  $\beta$.  How to change this matrix with respect to standard basis? What does the human body use oxygen for besides the final electron acceptor in the electron transport chain? My biology teachers never explained why animals need to breathe oxygen, just that we organisms die if we don't get oxygen for too long. Maybe one of them happened to mention that its used to make ATP. Now in my AP Biology class we finally learned the specifics of how oxygen is used in the  due to its high electronegativity. But I assume this probably isn't the only reason we need oxygen.   What other purposes does the oxygen we take in through respiration serve? Does oxygen deprivation result in death just due to the halting of ATP production, or is there some other reason as well? What percentage of the oxygen we take in through respiration is expelled later through the breath as carbon dioxide? When you add an image strip to the Video Sequence Editor, it stretches/shrinks your image to fit the full output frame.  How can I add an image at its original resolution?  For example, if I add a 60x60 pixel image, it should appear very small in the final 1080p render. What are the colored/highlighted edges in edit mode? There are red and pink edges on my mesh.  What do these colored edges mean? How can I use them? I want to change the Message-ID header or better yet, discard it. I know everyone is going to ask "Why would you want to do that?" because I know it sounds weird to even write it.  Well I am developing a system that saves an incoming e-mail in EML format, changes it and sends it to the user, at some point the user can request to have the original EML sent to him/her. The issue is that when I re-send the EML it has the same Message-ID header which causes exchange servers to drop the re-send.  Of course I am hoping there is some option through postfix to do this, otherwise I will need to parse and change the EML but I rather not do that.  I tried to do this with "header_checks" and it works BUT I need to be able to do this conditionally, meaning only on a specific occasion, which I can identify by looking at the other headers, I want to remove the Message-ID. Is there an easy way to get to www.stackexchange.com from any of the SE sites? One thing I've noticed about the relatively new sitewide layout is that I can't find a quick way to get back to www.stackexchange.com without finding StackExchange in the sites list. As a result, I am typing stackexchange in my toolbar a whole lot more often now. In particular, I tend to enjoy browsing the hot questions list and my own personal feed quite often so visit these pages on a daily basis. Is there an easy link to them that I'm missing?  (On the android app, there is a feed in the menu that I really appreciate, something like that on the desktop would be ideal!) The Problem For a small mass a distance $R_i$ away from the center of the Earth, how long would it take for the object to fall to the surface of the Earth, assuming that the only force acting upon the object is the Earth's gravitational force?  Relevant Information The following discussion seems to have solved exactly the same problem:   However, upon working out the mathematics, I'm not exactly sure how to evaluate the constant of integration.   A Partial Solution $$ F=\frac {-GMm}{s^2} $$ $$ a=\frac {-GM}{s^2} $$ $$ \frac {dv}{dt} = \frac {-GM}{s^2} $$ Multiplying by $v$ and then integrating by $dt$ on both sides, we have $$\frac {1}{2} v^2=\frac {GM}{s} +c_1$$ where $c_1$ is a constant of integration. Substituting initial conditions of $v=0, s=R$, we have $$\frac {1}{2} v^2=GM(\frac {1}{s}-\frac{1}{R})$$  At this point of time, when I use Wolfram Alpha, I get  $$c_2+\sqrt{\frac{2}{R}}t=\frac{\sqrt{s}(s-R)+R\sqrt{R-s}\times{\tan^{-1}(\sqrt{\frac{s}{R-s}})}}{\sqrt{GM(R-s)}}$$  where $c_2$ is a constant of integration. Substituting initial conditions of s=R, t=0, we find that the term $$\tan^{-1}(\sqrt{\frac{s}{R-s}})$$ is undefined. At this point, I'm stuck. Any ideas on where I've made the mistake here?  (For those interested, this question was inspired by the Greek myth which states that a bronze hammer dropped from heaven would take 9 days to hit the Earth and would reach on the tenth). Shell command to sum integers, one per line? I am looking for a command that will accept (as input) multiple lines of text, each line containing a single integer, and output the sum of these integers.  As a bit of background, I have a log file which includes timing measurements. Through grepping for the relevant lines and a bit of sed reformatting I can list all of the timings in that file.  I would like to work out the total. I can pipe this intermediate output to any command in order to do the final sum.  I have always used expr in the past, but unless it runs in RPN mode I do not think it is going to cope with this (and even then it would be tricky).  How can I get the summation of integers? How are the AES S-Boxes calculated? Is there a way to disable access to certain Settings components? Remove the flag notification in the top bar when I have done my job with it I have the moderator privileges on .  Even though it's quite rare that flags appear over there, it is still quite annoying that once I have done my job with a flag and therefore cannot do anything else with it, the flag in the top bar remains there. Why do I have to keep seeing that flag when in fact, I can't do anything about it?  Images, with free-hand circles:  A flag exists in the notification bar:    I have already done my part of the flag handling:    And yet the flag remains in the notification bar. $3\times3$ linear system organization Complex zeros of the polynomials $\sum_{k=0}^{n} z^k/k!$, inside balls Pass shell variable as a /pattern/ to awk The official Checkpoint out command line tool from CheckPoint, for setting up a SSL Network Extender VPN is not longer working from the Linux command line. It is also no longer actively supported by CheckPoint.  However, there is a promising  project, that tries to replicate the Java applet for authentication, that talks with the snx command line utility, called snxconnect.   I was trying to put snxconnect text utility to work in Debian Buster, doing:  sudo pip install snxvpn   and  export PYTHONHTTPSVERIFY=0 snxconnect -H checkpoint.hostname -U USER    However, it was mostly dying either with an HTTP error of:   HTTP/1.1 301 Moved Permanently:   or:  Got HTTP response: HTTP/1.1 302 Found   or:  Unexpected response, try again.   What to do about it?  PS. The EndPoint Security VPN official client is working well both in a Mac High Sierra and Windows 10 Pro. Non-https links to other StackExchange sites in User profile when using https