I am trying to populate a jTable from a .dat file in Java.  However, it is not going well.  I have tried every solution I have found on the internet and I am still getting a NullPointerException.  I need to code to iterate through the file, convert each line to an array (or some other type of collection), display the array in 1 row of the jTable and then move on to the next line in the file and repeat the steps.  Here is the code I have so far:  private void displayEmployees() {     String line = null;     File employeeFile = null;     BufferedReader br = null;     String[] record;      try     {         employeeFile = new File("Employees.dat");         br = new BufferedReader(new FileReader(employeeFile));         record = new String[]{};         while (!(line = br.readLine()).equals(""))         {             record = line.split(", ");             employeeTable.addRow(record);         }     }     catch (Exception ex)     {         JOptionPane.showMessageDialog(null, "Unable to display employee details "                  + ex.toString(), "Information Retrieval Failed", JOptionPane.ERROR_MESSAGE);     }     finally     {         try         {             br.close();         }         catch (Exception ex)         {             JOptionPane.showMessageDialog(null, "Unable to close the connection to"                     + " the file", "Operation Failed", JOptionPane.ERROR_MESSAGE);         }     } }   Although I know what a NullPointerException is, I can't figure out what is causing it within my specific code.  After looking through all the related questions I could find on stackoverflow and elsewhere on the internet, I still can't find a solution that works.  Can anyone help me with this please?  Any help would be greatly appreciated.
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?
In all the discussions about how the heavy elements in the universe are forged in the guts of stars and especially during a star's death, I usually hear that once the star begins fusing lighter atoms to produce iron (Fe) that's the end of the star's life and the whole system collapses onto itself; and based on how massive the star was initially, it has different outcome - like a white dwarf, a neutron star or a black hole. I have rarely heard a detailed explanation of how the elements heavier than iron are produced. I would appreciate a convincing explanation of this process. Why we don't use gamma rays, x-rays or ultraviolet to transmit data? I have a file with ANSI colors.  test.txt: \e[0;31mExample\e[0m  I would like to display the content of this file in a terminal, like cat does, but I would like to display the colors as well. When should end punctuation go inside quotes? I have been/am being taught that end punctuation should always go inside quotes. For example, you are supposed to write:     Marvin thought it was "awful."   The problem is I do not see how does this make sense. Intuitively, I always wrote:     Marvin thought it was "awful".   as that makes more logical sense — you want a quote to be an exact replication of what somebody else said, so why should you add punctuation inside?  I always thought it made more sense to not touch the quote and add anything after or before if it must be added.  So, why should I put end punctuation inside quotes? I have a matrix and need to highlight some elements in the matrix. I have found how to highlight a single element (I want to put the cell in the square):  $$ A = \begin{bmatrix} \fbox{0} &amp; \fbox{0} &amp; 0 \\  \fbox{0} &amp; \fbox{0} &amp; 0 \\ 1 &amp; 1 &amp; 1 \\  \end{bmatrix}$$   But how can I outline elements of the submatrix like in the picture below? I need just a frame where some elements are located. Galois group of irreducible cubic equation "Within" and "in" when referring to time I know that both can mean "inside" but what I don't have clear is whether both mean the same when talking about time. For example:   The party is in two days = The party is within two days ??   According to this link  within means a limit that can be exceeded, so I'm wondering too if say "the party is within two days max" is correct or redundant. Remote login with graphical display manager (GDM, LightDM) Is it possible to remotely (via ssh) make a login to GDM? I'll explain a situation in which I'd need this: I'm on my laptop and connect to my desktop via ssh. I realize there are some updates available. I install them all, but I need to reboot the computer. The problem is that once the desktop has rebooted, there will be no GDM session available, since it's necessary to log in. Can I somehow perform the GDM login remotely from my laptop?  Edit: I can't find FreeNX for Maverick, and I haven't been able to configure x11vnc + vncviewer to work. Isn't there an easy way? Given a sample of n units out of a population of N, population median can be estimated by the sample median.  How can we get the variance of this estimator? Export My Stack Overflow Data Is there a first party (or third party?) way to export just my data out of Stack Overflow?  I realize there's a massive Creative Commons data dump.  I'm interested in knowing if there's a quick and easy way for me to get my posts dumped out in some plain text file format for easy  personal archiving. Panasonic Lumix G 25mm f/1.7 ASPH vs Olympus M. Zuiko 25mm f/1.8 I try to import .obj files from this project:  - the files contain Polygon Mesh Data.  When I import the obj file into blender, the outliner shows a new mesh added, but nothing is visible in the 3D viewport:      Any help will be appreciated. I put 4 different layers into my ArcMap document, but only one of them will show up on the map! I should be seeing the other 3 layers as well. When I do a Zoom to layer, I can see one layer, but I cannot figure out how to make the other 3 show up at once on top of each other.  Before I opened ArcMap, I used ArcCatalog where I right-clicked 3/4 of the shapefiles and  clicked Properties &rarr; Coordinate system &rarr; Import and then clicked on my Trees layer, which has the coordinate system I want the other 3 to have. But when I opened ArcMap the 4 layers did not overlap, nor could I move them above or below each other. Reverse / invert a dictionary mapping Given a dictionary like so:  my_map = {'a': 1, 'b': 2}   How can one invert this map to get:  inv_map = {1: 'a', 2: 'b'} I'm trying to do a volumetric light on Cycles, and I've followed tutorials, but nothing has worked yet. How can I make a proper volumetric light in Blender, like the following one?    But to leave the light in the middle, like, almost a star, is this possible? I'm at the point to use an image plane besides the light which would be better... I need to use it moving the camera.  I'm actually trying to do this because I want to simulate the brightness of the Sun.  I tried the effect, but it still gave me an error: Why redirect output to 2>&1 and 1>&2? I have come across several commands that use 2&gt;&amp;1 and 1&gt;&amp;2, but I quite can't get my head around the purpose of using it and when I should be using it.  What I understand  I know that 1 represents standard out and 2 represents standard error. I understand that 2&gt;&amp;1 combines the output of 2 to 1 and vice versa.  What I don't get   When should I be using it? What purpose does it serve? How do you convert a C++ string to an int? Possible Duplicate:          How do you convert a C++ string to an int?  Assume you are expecting the string to have actual numbers in it ("1", "345", "38944", for example).  Also, let's assume you don't have boost, and you really want to do it the C++ way, not the crufty old C way. How do I avoid conversation with strangers while traveling? How to exclude a column from SELECT query? DRAM Frequency showing 800 instead of 1600 I am running a Core i7 CPU originally at 3Ghz overclocked to 4Ghz using a multiplier of x20 and a Bus Speed of 200 Mhz  My memory is 1600 Mhz OCZ.  I installed CPU-Z to see what is going on - but it shows me (under the "Memory" Tab):  DRAM Frequency 800 Mhz  Channel Triple - NB Frequency 3800.2 Mhz  So what is the actual frequency its running on then? I am slightly confused.