Results 1 to 11 of 11
- 12-03-2011, 09:42 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 11
- Rep Power
- 0
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
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
-
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.Last edited by Fubarable; 12-03-2011 at 09:56 PM.
- 12-03-2011, 10:06 PM #3
Member
- Join Date
- Nov 2010
- Posts
- 11
- Rep Power
- 0
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.
- 12-03-2011, 10:38 PM #5
Member
- Join Date
- Nov 2010
- Posts
- 11
- Rep Power
- 0
Re: Nimbus LaF doesn't recognize javax.swing.JTable?

In this image you can see my code. I debuggin my App and I see that the jTable1 variable hasn't any type..gif)
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?
- 12-03-2011, 11:08 PM #7
Member
- Join Date
- Nov 2010
- Posts
- 11
- Rep Power
- 0
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!
- 12-03-2011, 11:11 PM #8
Member
- Join Date
- Nov 2010
- Posts
- 11
- Rep Power
- 0
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.
- 12-04-2011, 03:25 AM #10
Member
- Join Date
- Nov 2010
- Posts
- 11
- Rep Power
- 0
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:
Java Code:UIManager.setLookAndFeel("org.jdesktop.swingx.plaf.nimbus.NimbusLookAndFeel");
but instead like this:
Java Code:for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } }
Similar Threads
-
package javax.swing does not exist
By timosoft in forum AWT / SwingReplies: 5Last Post: 02-15-2011, 01:17 AM -
javax.swing.RowSorter.SortKey
By new2java2009 in forum New To JavaReplies: 1Last Post: 04-11-2010, 03:26 AM -
using javax.swing.JOptionPane in array
By icedragon770 in forum AWT / SwingReplies: 12Last Post: 11-10-2008, 08:27 AM -
use of javax.swing.text.html
By newbieal in forum New To JavaReplies: 3Last Post: 10-09-2008, 06:45 PM -
map javax.swing.text.Element to javax.swing.text.View
By elizabeth in forum New To JavaReplies: 1Last Post: 07-30-2007, 07:02 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks