Results 1 to 11 of 11
Like Tree1Likes
  • 1 Post By Fubarable

Thread: Nimbus LaF doesn't recognize javax.swing.JTable?

  1. #1
    rudeboy is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Post 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

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

    Default 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 10:56 PM.

  3. #3
    rudeboy is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default 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.

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

    Default 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.

  5. #5
    rudeboy is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default Re: Nimbus LaF doesn't recognize javax.swing.JTable?

    Nimbus LaF doesn't recognize javax.swing.JTable?-rudeboy.png

    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.

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

    Default 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?

  7. #7
    rudeboy is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default 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!
    Attached Files Attached Files

  8. #8
    rudeboy is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default 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.

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

    Default 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.

  10. #10
    rudeboy is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default 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!
    Attached Files Attached Files

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

    Default 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;
                  }
               }
    DarrylBurke likes this.

Similar Threads

  1. package javax.swing does not exist
    By timosoft in forum AWT / Swing
    Replies: 5
    Last Post: 02-15-2011, 02:17 AM
  2. javax.swing.RowSorter.SortKey
    By new2java2009 in forum New To Java
    Replies: 1
    Last Post: 04-11-2010, 04:26 AM
  3. using javax.swing.JOptionPane in array
    By icedragon770 in forum AWT / Swing
    Replies: 12
    Last Post: 11-10-2008, 09:27 AM
  4. use of javax.swing.text.html
    By newbieal in forum New To Java
    Replies: 3
    Last Post: 10-09-2008, 07:45 PM
  5. map javax.swing.text.Element to javax.swing.text.View
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 08:02 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
  •