troubleshooting Question

NullPointException error don't see it

Avatar of Drop_of_Rain
Drop_of_Rain asked on
22 Comments2 Solutions241 ViewsLast Modified:
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;

public class MyClass4 extends JPanel {  //starts class
        JPanel jPanel;
        ArrayList myArrayList = new ArrayList();

    // Constructor
    public MyClass4() { //starts constructor
        setLayout(new GridLayout(0,3)); // Setting MY layout...
    for (int row=0; row<20; row++) {
    for(int col=0; col<3; col++) {
    int n=(20*col+row+1);
    if (n>50) break looprow;
    JCheckBox check = new JCheckBox("" + n);
    add(check); // Adding it to ME

        jPanel.addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent e) {
                public void mouseClicked(MouseEvent e) {
                    public void mouseExited(MouseEvent e) {
    }//ends constructor
}// ends class
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 22 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 22 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros