Nimbus LaF doesn't recognize javax.swing.JTable?
Hi friends!
I have had a trouble when I tried using JTable component on Nimbus LaF.
When I use Nimbus LaF and I run an application, the javax.swing.JTable class doesn't appear as Java "type" (class). I assign an object as JTable but it cannot get JTable in declaration sentence even. The object exists but it has not type :s:
I am using the latest version of Nimbus.
For example:
javax.swing.JTable table = new javax.swing.JTable();
or
javax.swing.JTable table = new javax.swing.JTable(aModel);
These sentences throws a NullPointerException.
Any suggestion is welcome friends.
Thanks to all and sorry for my English :(doh):
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
This has nothing to do with L&F and your problem is elsewhere. Show your code, show your actual error, show the actual line that throws the NPE (NullPointerException) because it absolutely cannot be the lines you are posting above unless perhaps the model is null.
By the way, your English is fine.
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
Thank you for reply Fubarable.
I am testing the Nimbus with two version. The first version is the "com.sun.java.swing.plaf.nimbus.NimbusLookAndF eel" which is the default one included in jdk 6. This works fine only running the application from the Netbeans IDE, but not from the .jar file of the application. And I couldn't find the Nimbus jar file for this version to add this in /lib/ directory application.
The second version is "org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel ". I have downloaded its .jar recently, and it works fine in the jar file application but this throws the JTable error when I trying access to a JDialog with a table.
Newly sorry for my English.
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
I'm not sure about the others, but I'm still unable to help you without seeing your code, preferably a small compilable program that can run for me and that demonstrates your problem.
1 Attachment(s)
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
Attachment 2106
In this image you can see my code. I debuggin my App and I see that the jTable1 variable hasn't any type. :^):
I can't understand that.
It only happens when I use the "org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel ".
PD: Do you know how can I get the "com.sun.java.swing.plaf.nimbus.NimbusLookAndF eel" packed in a jar file to adding in my /lib/ directory application?
Maybe that works.
Regards.
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
OK, I'm sorry, but you've got me stumped. I've used Nimbus in the past with GUI's that include JTables and have never had a problem with it, so I don't really know what the problem is with your code right now, sorry. Could you jar your code (including the source code -- NetBeans help files will tell you how), change the jar extension to zip, and upload it here?
1 Attachment(s)
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
Yes, here I've added the source code attachment.
I hope that this can be helpful for you.
Thank you!
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
Sorry, you must go to the file: /conservatorioview/dialogs/alumnos/DeleteOrModifyAlumnoDialog.java
In this file I've testing the application when the problem happened.
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
Hm, can't run your code as it may be missing several packages such as conservatoriomodel, conservatoriobusiness, conservatorioutilities.classes, conservatorioutilities.exceptions, and some hibernate stuff. :(
Could you try to simplify the problem? Perhaps you can create a very small GUI that creates a simple JTable and uses Nimbus L&F, and then upload the actual code (not the Jar file), here.
1 Attachment(s)
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
Oh sorry Fubarable, I thought that you only wanted to see the source code, not run the app.
Here I attached a simple GUI that trying to showing a JTable (I've tested it and it does not worked):(-:
Just run this example application, the main class is 'Main' and it is already setting.
THANK YOU!
Re: Nimbus LaF doesn't recognize javax.swing.JTable?
I'm not going to pretend that I know the first thing about Java Swing Look & Feel, but what if you get Nimbus L&F not like this:
Code:
UIManager.setLookAndFeel("org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel");
but instead like this:
Code:
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}