Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Table Changes


  • Please log in to reply
4 replies to this topic

#1 sausage

sausage

  • Members
  • 389 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Colorado
  • Local time:02:41 PM

Posted 08 February 2009 - 02:12 PM

I can't figure out how to edit the model of a Table without user input, for some reason I have some malware that won't let me go to the sun tutorials, I click on it in google and it takes me to some bullcrap shopping website

Anyways, I am just using the generated code in NetBeans

MapView.setModel(new javax.swing.table.DefaultTableModel(
//Cell Text
//Title Text
//other properties
));

It compiles right but whenever I run it, it gives a stupid exception

Exception in thread "main" java.lang.NullPointerException
at MainView.main(MainView.java:169)
Java Result: 1


Not sure exactly what that means so I thought I might ask here.

Full code located here: Download MainView.java

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:41 PM

Posted 08 February 2009 - 02:37 PM

A null pointer exception means that one of your variables is not properly initialized, and it occurs at line 169 of the code.

#3 sausage

sausage
  • Topic Starter

  • Members
  • 389 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Colorado
  • Local time:02:41 PM

Posted 08 February 2009 - 03:23 PM

Line 169 is the
MapView.setModel(new javax.swing.table.DefaultTableModel(
//Cell Text
//Title Text
//other properties
));


#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:41 PM

Posted 08 February 2009 - 03:27 PM

Then the instance variable MapView has not been instantiated. In other words, there is no instance of MapView in memory.

#5 sausage

sausage
  • Topic Starter

  • Members
  • 389 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Colorado
  • Local time:02:41 PM

Posted 08 February 2009 - 03:55 PM

Oh, gotcha, thanks, I got it working :-) is there any way to decrease the width of the columns, I'm trying to rebuild the map of my RPG in the table but the symbols are so spread out




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users