Results 1 to 6 of 6
  1. #1
    Lekim11 is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default JTabbedPane returns the error Null. Help

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class addTabfirst extends JFrame
    {
    private JTextField empNoTF, empLnameTF, empFnameTF, empDeptTF, empSalTF;
    addTabfirst()
    {

    setTitle("Tabbed Pane");
    setSize(400, 400);

    JTabbedPane tab = new JTabbedPane();


    getContentPane().add(tab);
    JPanel addTab = new JPanel();
    addTab.setLayout( new GridLayout( 6, 2 ) );
    JPanel viewTab = new JPanel();
    viewTab.setLayout(new GridLayout(5,3));
    JPanel delTab = new JPanel();
    delTab.setLayout(new GridLayout(6,2));
    JPanel exitTab = new JPanel();
    exitTab.setLayout(new GridLayout(5,3));
    JPanel mainTab = new JPanel();
    mainTab.setLayout(new GridLayout(1,1));

    JLabel spaces[] = new JLabel[25];
    for (int a = 0 ; a < 25 ; a++)
    spaces[a] = new JLabel ("");

    JLabel empNoL = new JLabel();
    JLabel empLnameL = new JLabel();
    JLabel empFnameL = new JLabel();
    JLabel empDeptL = new JLabel();
    JLabel empSalL = new JLabel();
    empNoL.setText("Enter Employee Number: ");
    empLnameL.setText("Enter Employee Last Name: ");
    empFnameL.setText("Enter Employee First Name: ");
    empDeptL.setText("Enter Employee Department: ");
    empSalL.setText("Enter Employee Salary: ");
    JButton add = new JButton("ADD");
    JTextField empNoTF = new JTextField(15);
    JTextField empLnameTF = new JTextField(15);
    JTextField empFnameTF = new JTextField(15);
    JTextField empDeptTF = new JTextField(10);
    JTextField empSalTF = new JTextField(10);
    addTab.add(empNoL);
    addTab.add(empNoTF);
    addTab.add(empLnameL);
    addTab.add(empLnameTF);
    addTab.add(empFnameL);
    addTab.add(empFnameTF);
    addTab.add(empDeptL);
    addTab.add(empDeptTF);
    addTab.add(empSalL);
    addTab.add(empSalTF);
    addTab.add(spaces[0]);
    addTab.add(add);

    JLabel viewLabel = new JLabel("VIEW OPTIONS", SwingConstants.CENTER);
    JButton viewNumB = new JButton("View By Employee Number");
    JButton viewDeptB = new JButton("View By Department");
    JButton viewAllB = new JButton("View All");
    viewNumButtonHandler viewNumHandler = new viewNumButtonHandler();
    add.addActionListener(viewNumHandler);
    viewDeptButtonHandler viewDeptHandler = new viewDeptButtonHandler();
    add.addActionListener(viewDeptHandler);
    viewAllButtonHandler viewAllHandler = new viewAllButtonHandler();
    add.addActionListener(viewAllHandler);
    viewTab.add(spaces[1]);
    viewTab.add(viewLabel);
    viewTab.add(spaces[2]);
    viewTab.add(spaces[3]);
    viewTab.add(viewNumB);
    viewTab.add(spaces[4]);
    viewTab.add(spaces[5]);
    viewTab.add(viewDeptB);
    viewTab.add(spaces[6]);
    viewTab.add(spaces[7]);
    viewTab.add(viewAllB);
    viewTab.add(spaces[8]);
    viewTab.add(spaces[9]);
    viewTab.add(spaces[10]);
    viewTab.add(spaces[11]);

    JLabel delLabel = new JLabel("DELETE", SwingConstants.CENTER);
    JLabel delInfoLabel = new JLabel("EMPLOYEE BY EMPLOYEE NUMBER");
    JLabel delEmpNo = new JLabel("Enter Employee Number: ");
    JTextField delEmpNoTF = new JTextField(15);
    JButton delEmpNoB = new JButton("Delete");
    delEmpButtonHandler delEmpHandler = new delEmpButtonHandler();
    add.addActionListener(delEmpHandler);
    delTab.add(spaces[12]);
    delTab.add(spaces[13]);
    delTab.add(delEmpNo);
    delTab.add(delEmpNoTF);
    delTab.add(spaces[14]);
    delTab.add(spaces[15]);
    delTab.add(spaces[16]);
    delTab.add(delEmpNoB);
    delTab.add(spaces[17]);
    delTab.add(spaces[18]);
    delTab.add(spaces[19]);
    delTab.add(spaces[20]);

    JLabel exitL = new JLabel("Are You Sure You Want to Close the Program?");
    JButton exitB = new JButton("Exit");
    exitButtonHandler exitHandler = new exitButtonHandler();
    add.addActionListener(exitHandler);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[16]);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[15]);
    exitTab.add(exitL);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[16]);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[15]);
    exitTab.add(exitB);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[15]);
    exitTab.add(spaces[15]);

    tab.addTab("Main", mainTab);
    tab.addTab("Add", addTab);
    tab.addTab("View", viewTab);
    tab.addTab("Delete", delTab);
    tab.addTab("Exit", exitTab);



    addButtonHandler addHandler = new addButtonHandler();
    add.addActionListener(addHandler);
    setVisible(true);
    }

    private class addButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent e)
    {
    int num;
    String fname, lname, dept;
    double salary;
    boolean found = true;
    try
    {
    PrintWriter pw = new PrintWriter (new FileWriter ("C:/Users/Lekim/Desktop/sfGUIproj/Employee.txt",true));
    BufferedReader br = new BufferedReader (new FileReader ("C:/Users/Lekim/Desktop/sfGUIproj/Employee.txt"));
    num = Integer.parseInt(empNoTF.getText());
    fname = empFnameTF.getText();
    lname = empLnameTF.getText();
    dept = empDeptTF.getText();
    salary = Double.parseDouble(empSalTF.getText());
    pw.print(num);
    pw.print(lname);
    pw.print(fname);
    pw.print(dept);
    pw.print(salary);
    pw.close();
    }
    catch (Exception err)
    {
    JOptionPane.showMessageDialog( null, "Error: " + err.getMessage(), "Error", JOptionPane.ERROR_MESSAGE );
    }
    }
    }

    private class viewNumButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent act)
    {
    //call table display
    }
    }

    private class viewDeptButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent act)
    {
    //call table display
    }
    }

    private class viewAllButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent act)
    {
    //call table display
    }
    }

    private class delEmpButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent act)
    {
    //call del method
    }
    }

    private class exitButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent act)
    {
    System.exit(0);
    }
    }

    public static void main()
    {
    addTabfirst first = new addTabfirst();
    }
    }

  2. #2
    Lekim11 is offline Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Default Need Help regarding JTabbedPane. Returns the Error Null

    I need help with this code. When I click the add button in the Add tab, it returns the error null. I hope someone can help. Here's my code:
    Java Code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class addTabfirst extends JFrame
    {
        private JTextField empNoTF, empLnameTF, empFnameTF, empDeptTF, empSalTF;
        addTabfirst()
            {
                
                setTitle("Tabbed Pane"); 
                setSize(400, 400); 
            
                JTabbedPane tab = new JTabbedPane();
                
            
                getContentPane().add(tab);
                JPanel addTab = new JPanel();
                addTab.setLayout( new GridLayout( 6, 2 ) );
                JPanel viewTab = new JPanel();
                viewTab.setLayout(new GridLayout(5,3));
                JPanel delTab = new JPanel();
                delTab.setLayout(new GridLayout(6,2));
                JPanel exitTab = new JPanel();
                exitTab.setLayout(new GridLayout(5,3));
                JPanel mainTab = new JPanel();
                mainTab.setLayout(new GridLayout(1,1));
           
                JLabel spaces[] = new JLabel[25];
                    for (int a = 0 ; a < 25 ; a++)
                        spaces[a] = new JLabel ("");
           
                JLabel empNoL = new JLabel();
                JLabel empLnameL = new JLabel();
                JLabel empFnameL = new JLabel();
                JLabel empDeptL = new JLabel();
                JLabel empSalL = new JLabel();
                    empNoL.setText("Enter Employee Number: ");
                    empLnameL.setText("Enter Employee Last Name: ");
                    empFnameL.setText("Enter Employee First Name: ");
                    empDeptL.setText("Enter Employee Department: ");
                    empSalL.setText("Enter Employee Salary: ");
                JButton add = new JButton("ADD");
                JTextField empNoTF = new JTextField(15);
                JTextField empLnameTF = new JTextField(15);
                JTextField empFnameTF = new JTextField(15);
                JTextField empDeptTF = new JTextField(10);
                JTextField empSalTF = new JTextField(10);
                    addTab.add(empNoL);
                    addTab.add(empNoTF);
                    addTab.add(empLnameL);
                    addTab.add(empLnameTF);
                    addTab.add(empFnameL);
                    addTab.add(empFnameTF);
                    addTab.add(empDeptL);
                    addTab.add(empDeptTF);
                    addTab.add(empSalL);
                    addTab.add(empSalTF);
                    addTab.add(spaces[0]);
                    addTab.add(add);
           
                JLabel viewLabel = new JLabel("VIEW OPTIONS", SwingConstants.CENTER);
                JButton viewNumB = new JButton("View By Employee Number");
                JButton viewDeptB = new JButton("View By Department");
                JButton viewAllB = new JButton("View All");
                viewNumButtonHandler viewNumHandler = new viewNumButtonHandler();
                add.addActionListener(viewNumHandler);
                viewDeptButtonHandler viewDeptHandler = new viewDeptButtonHandler();
                add.addActionListener(viewDeptHandler);
                viewAllButtonHandler viewAllHandler = new viewAllButtonHandler();
                add.addActionListener(viewAllHandler);
                    viewTab.add(spaces[1]);
                    viewTab.add(viewLabel);
                    viewTab.add(spaces[2]);
                    viewTab.add(spaces[3]);
                    viewTab.add(viewNumB);
                    viewTab.add(spaces[4]);
                    viewTab.add(spaces[5]);
                    viewTab.add(viewDeptB);
                    viewTab.add(spaces[6]);
                    viewTab.add(spaces[7]);
                    viewTab.add(viewAllB);
                    viewTab.add(spaces[8]);
                    viewTab.add(spaces[9]);
                    viewTab.add(spaces[10]);
                    viewTab.add(spaces[11]);
           
                JLabel delLabel = new JLabel("DELETE", SwingConstants.CENTER);
                JLabel delInfoLabel = new JLabel("EMPLOYEE BY EMPLOYEE NUMBER");
                JLabel delEmpNo = new JLabel("Enter Employee Number: ");
                JTextField delEmpNoTF = new JTextField(15);
                JButton delEmpNoB = new JButton("Delete");
                delEmpButtonHandler delEmpHandler = new delEmpButtonHandler();
                add.addActionListener(delEmpHandler);
                    delTab.add(spaces[12]);
                    delTab.add(spaces[13]);
                    delTab.add(delEmpNo);
                    delTab.add(delEmpNoTF);
                    delTab.add(spaces[14]);
                    delTab.add(spaces[15]);
                    delTab.add(spaces[16]);
                    delTab.add(delEmpNoB);
                    delTab.add(spaces[17]);
                    delTab.add(spaces[18]);
                    delTab.add(spaces[19]);
                    delTab.add(spaces[20]);
           
                JLabel exitL = new JLabel("Are You Sure You Want to Close the Program?");
                JButton exitB = new JButton("Exit");
                exitButtonHandler exitHandler = new exitButtonHandler();
                add.addActionListener(exitHandler);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[16]);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[15]);
                    exitTab.add(exitL);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[16]);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[15]);
                    exitTab.add(exitB);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[15]);
                    exitTab.add(spaces[15]);
           
                tab.addTab("Main", mainTab);
                tab.addTab("Add", addTab);
                tab.addTab("View", viewTab);
                tab.addTab("Delete", delTab);
                tab.addTab("Exit", exitTab);
                
           
                
                addButtonHandler addHandler = new addButtonHandler();
                add.addActionListener(addHandler);
                setVisible(true);
            }
            
        private class addButtonHandler implements ActionListener
            {
                public void actionPerformed(ActionEvent e)
                    {
                        int num;
                        String fname, lname, dept;
                        double salary;
                        boolean found = true;
                        try
                            {
                                PrintWriter pw = new PrintWriter (new FileWriter ("C:/Users/Lekim/Desktop/sfGUIproj/Employee.txt",true));
                                BufferedReader br = new BufferedReader (new FileReader ("C:/Users/Lekim/Desktop/sfGUIproj/Employee.txt"));
                                num = Integer.parseInt(empNoTF.getText());
                                fname = empFnameTF.getText();
                                lname = empLnameTF.getText();
                                dept = empDeptTF.getText();
                                salary = Double.parseDouble(empSalTF.getText());
                                    pw.print(num);
                                    pw.print(lname);
                                    pw.print(fname);
                                    pw.print(dept);
                                    pw.print(salary);
                                pw.close();
                            }
                        catch (Exception err)
                            {
                                JOptionPane.showMessageDialog( null, "Error: " + err.getMessage(), "Error", JOptionPane.ERROR_MESSAGE );
                            }
                    }
            }
            
        private class viewNumButtonHandler implements ActionListener
            {
                public void actionPerformed(ActionEvent act)
                    {
                        //call table display
                    }
            }
            
        private class viewDeptButtonHandler implements ActionListener
            {
                public void actionPerformed(ActionEvent act)
                    {
                        //call table display
                    }
            }
            
        private class viewAllButtonHandler implements ActionListener
            {
                public void actionPerformed(ActionEvent act)
                    {
                        //call table display
                    }
            }
            
        private class delEmpButtonHandler implements ActionListener
            {
                public void actionPerformed(ActionEvent act)
                    {
                        //call del method
                    }
            }
            
        private class exitButtonHandler implements ActionListener
            {
                public void actionPerformed(ActionEvent act)
                    {
                        System.exit(0);
                    }
            }
            
        public static void main()
            {
                addTabfirst first = new addTabfirst();
            }
    }
    here's the stack trace


    java.lang.NullPointerException
    at Ops.<init>(Ops.java:6)
    at addTabfirst.main(addTabfirst.java:239)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at addTabfirst$addButtonHandler.actionPerformed(addTa bfirst.java:152)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.jav a:6263)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267)
    at java.awt.Component.processEvent(Component.java:602 8)
    at java.awt.Container.processEvent(Container.java:204 1)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4630)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2099)
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478 )
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at addTabfirst$addButtonHandler.actionPerformed(addTa bfirst.java:152)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.jav a:6263)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267)
    at java.awt.Component.processEvent(Component.java:602 8)
    at java.awt.Container.processEvent(Container.java:204 1)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4630)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2099)
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478 )
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at addTabfirst$addButtonHandler.actionPerformed(addTa bfirst.java:152)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.jav a:6263)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267)
    at java.awt.Component.processEvent(Component.java:602 8)
    at java.awt.Container.processEvent(Container.java:204 1)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4630)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2099)
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478 )
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
    java.lang.NullPointerException
    at addTabfirst$addButtonHandler.actionPerformed(addTa bfirst.java:153)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.jav a:6263)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267)
    at java.awt.Component.processEvent(Component.java:602 8)
    at java.awt.Container.processEvent(Container.java:204 1)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4630)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2099)
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478 )
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
    Last edited by Lekim11; 02-28-2012 at 03:04 PM.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: JTabbedPane returns the error Null. Help

    Please understand that we're all volunteers here, and that you're coming here to ask for free help which is all well and good, but it certainly isn't asking too much for you to put a little effort into writing your question rather than just dumping in your code here for others to fix. For instance, how about taking a bit of time to explain your problem, to note which line throws the exception, to show the exception itself, etc.

    Later we'll talk about using [code] [/code] tags, but the above information is the minimal you should give us.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: Need Help regarding JTabbedPane. Returns the Error Null

    Give us the full stack trace and highlight the line of code it occurs on.
    Something on that line is null.

    Also put your code in [code] tags [/code].
    That's unreadable as it is.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Need Help regarding JTabbedPane. Returns the Error Null

    1. Don't double post the same question.
    2. There's nothing 'Advanced' about being unable to sort out a NullPointerException.

    I'm moving this to New to Java and merging it with the other thread.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: JTabbedPane returns the error Null. Help

    You haven't said which line is line 152.
    Anyway, something on that line is null.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. ArrayList returns null
    By aborgeld in forum New To Java
    Replies: 6
    Last Post: 04-01-2011, 02:32 PM
  2. XML and SAX - class returns 'null'
    By Laffel in forum Advanced Java
    Replies: 2
    Last Post: 03-07-2011, 10:14 PM
  3. Splashscreen returns null
    By Charlie161 in forum AWT / Swing
    Replies: 2
    Last Post: 03-04-2011, 02:25 PM
  4. getImplementationVersion() returns null
    By newbiejava in forum New To Java
    Replies: 22
    Last Post: 09-12-2010, 10:31 AM
  5. helpset findHelpSet returns null
    By kmm1977 in forum AWT / Swing
    Replies: 23
    Last Post: 06-22-2010, 04:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •