Com.sun.java.swing.*; ??

I have notice these class references in a couple of sample programs.
Do these come with every installation of the jre. I have 1.4 install
and when i reference these library..I am told they don't exist..
What are they ??
Where do they come from ??
How do I get them running in my apps.
aj

Anything in the
sun.*
and
com.sun.*
should not be used directly by you (unless the API's say so), yes the L&F's live in this name space, as does the native bits of Java and the basic implementations of stuff you can only get at via factorys but you still should not use them (unless you are going via the factory, and then you should never rely on it being the same between JREs).

Similar Messages

  • Package com.sun.java.swing not found in import

    I'm trying to show graphic information but the swing package does not load up don't know what is going on Any help is welcome
    THIS IS THE LINE I GET WHEN I TRY TO IMPORT SWING
    Package com.sun.java.swing not found in import

    I'm trying to show graphic information but the swing
    package does not load up don't know what is going on
    Any help is welcome
    THIS IS THE LINE I GET WHEN I TRY TO IMPORT SWING
    Package com.sun.java.swing not found in importThat's an old package reference. Try javax.swing

  • Jdk1.3.1 'com.sun.java.swing does not exist'???

    Thats what the compiler tells me, though it finds javac with no problem in the
    jdk1.3.1 lib directory. Any clue to what I'm missing here? Thanks nt

    Swing used to be in the com.sun.java.swing package in the very earliest releases, but now it is in the javax.swing package.

  • Com.sun.java.swing package not found

    All my other programs compile fine if they're not using that package

    yea...wrong import....
    use
    import javax.swing.*;notice the X

  • Com.sun.java package

    Hi,
    What is the different between javax.swing and com.sun.java.swing package ? Are they the same ?
    Where can I download com.sun.java.swing package ?
    Regards,
    Lim Boon Sun

    The official Sun statement is that one should only use the classes listed in the APIs, i.e. javax.swing.*. Classes in packages such as com.sun.* contain version dependent implementations and are subject to change without notice. So, if you use them in your programs, it is very likely that your programs will not run under future (and previous) versions of the JRE.
    So, just like the other fellow said, STICK TO THE javax.swing.* packages !

  • DOMNotSupportedException in com.sun.java.browser.dom.* classes

    I'd like to enable an applet to modify the DOM in a browser window directly (ie. by using org.w3c.dom.* stuff). I'm using the latest 1.5.
    I'm using a small class that I've pasted below to attempt to facilitate this. It evidently works in MSIE, where I receive the "Got document" message indicating a non-null value for 'page', but in Mozilla or Netscape, I get the following exception thrown:
    netscape.javascript.JSException
         at netscape.javascript.JSObject.getWindow(Unknown Source)
         at sun.plugin.dom.DOMServiceProvider.getDocument(Unknown Source)
         at sun.plugin.dom.DOMAccessor.getDocument(Unknown Source)
         at econ.ClientLink.run(ClientLink.java:35)
         at sun.plugin.dom.DOMService.invokeLater(Unknown Source)
         at econ.ClientLink.start(ClientLink.java:25)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    com.sun.java.browser.dom.DOMUnsupportedException
         at sun.plugin.dom.DOMServiceProvider.getDocument(Unknown Source)
         at sun.plugin.dom.DOMAccessor.getDocument(Unknown Source)
         at econ.ClientLink.run(ClientLink.java:35)
         at sun.plugin.dom.DOMService.invokeLater(Unknown Source)
         at econ.ClientLink.start(ClientLink.java:25)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Got document: null
    Is this just simply only supported for MSIE? This seems highly unlikely.
    I suspect it might have something to do with permissions in Mozilla, as these lines also appear in the log:
    liveconnect: the url of the applet is http://word and the permission is = false
    liveconnect: JavaScript: calling Java system code
    liveconnect: JavaScript: default security policy = http://word
    I haven't yet found anyone who could explain them. I'd like to try playing with permissions, buy I don't know how to do so. Any suggestions?
    --- code follows ---
    import javax.swing.*;
    import java.applet.*;
    import org.w3c.dom.*;
    import com.sun.java.browser.dom.*;
    public class ClientLink extends JApplet implements DOMAction {
    DOMService service;
    Document page;
    public void start() {
    try {
    service = DOMService.getService(this);
    System.out.println("Got service.");
    service.invokeLater(this);
    catch (Exception e) {
    e.printStackTrace();
    public Object run(DOMAccessor doma) {
    System.out.println("Entry successful.");
    try {
    page = doma.getDocument(this);
    System.out.println("Got document: "+page);
    catch (Exception e) {
    e.printStackTrace();
    System.out.println("Error: "+e.toString());
    return null;
    }

    A couple of things I've found with DOMService and/or LiveConnect and the more recent java and browser releases :
    1) You probably need to edit your java.policy file to grant permissions since the security in Java is now managed independently from the browser
    2) You need to remember to have mayscript="true" in your applet tag
    3) JSObject's dont work unless you've called JSObject.getWindow(...) first.
    4) Many legitimate java exceptions will appear misleadingly as security exceptions

  • Report cannot be rendered (com/sun/java/util/collections/Iterator)

    Hello all
    I'm new both to Weblogic Server and BI Publisher.
    A few days ago I thought that I managed to install BI Publisher on top of Weblogic. It turns out to be untrue because I am not able to view any report, being it a sample or a newly created one.
    Platform: Windows 2003 32-bit
    Weblogic version: 10.3.3.0
    BI Publisher version: 10.1.3.4.1 (doesn't work both w/ and w/o the latest patchset 9791839)
    And now to the problem. Whenever I try to view a report, I get an error message stating "The report cannot be rendered because of an error, please contact the administrator". Being both the user and the administrator, I am forced to press the "Error Detail" link, upon which the only thing that pops below is "com/sun/java/util/collections/Iterator" (in red).
    The same non-verbose error message appears also when running in debug mode. Weblogic logs are empty from warnings, errors, etc.
    As for the Weblogic Server, it claims that the xmlpserver application has been deployed and started successfully.
    It seems to me that the BI Publisher application is trying to use java class that doesn't exist (com.sun.java.util.collections.Iterator). Of course I have no clue how to prove that because I do not have the source code for this app.
    Oracle support is hardly able to understand the problem, so I thought maybe one of you could give me some answer.
    Any Ideas?
    Jonathan

    By the way, I deployed the app under Oracle Report's cluster. Don't know whether it matters.

  • Class not found com/sun/java/util/collections/list

    hi
              i am trying to execute the following:
              java weblogic.jspc -d c:\weblogic\classes -keepgenerated
              printAllParameters
              and get the follwoing message:
              class not found com/sun/java/util/collections/list
              any suggestions?
              thanx
              

    Try it like this:
              java weblogic.jspc -d c:\weblogic\classes;c:\weblogic\lib\weblogicaux.jar ...
              Melrose Public Library <[email protected]> wrote:
              > hi
              > i am trying to execute the following:
              > java weblogic.jspc -d c:\weblogic\classes -keepgenerated
              > printAllParameters
              > and get the follwoing message:
              > class not found com/sun/java/util/collections/list
              > any suggestions?
              > thanx
              Dimitri
              

  • ResourceEntityResolver.java referencing com.sun.java.util.collection

    Im trying to compile the WL5.1 ResourceEntityResolver.java class but it is
    referencing com.sun.java.util.collection package. Where can I find this
    package?

    This can be an issue when using Tomcat and upgrading version of Mojarra.
    Tomcat will store a file with the extension of .ser in the work directory. This file contains the names of the ServletContextListener instances
    that need to be invoked when the application is next started. The problem is that if they use the values in that file and the listeners don't
    exist, they don't rescan the application to rebuild the .ser, they just fail.
    The way to fix this is to search for .ser files in your web container's work directory and the ones for the web application in question.

  • Error "cannot access com.sun.java..."

    edit i mistyped in the topic name, i mean to say "com.sun.j3d..."
    I've set myself up using JCreator, installed j3d, j2sdk, and jdk. Tried a few test programs to make sure everything was working (a basic hello world and my chess game i created my junior year in highschool). It was all running fine.
    So i started reading into j3d tutorials, and came across the HelloUniverse sample program. I slapped the code in and compiled it, only to be met with:
    "cannot access com.sun.j3d.utils.applet.MainFrame".
    I commented out the import line that included this, compiled, and it gave me another message complaining about the same thing, only this time ending in:
    "...geometry.ColorCube"
    Obviously, its just running down the line with all of the j3d imports, so i ran through and reinstalled all my j3d files; still didnt work. I can't figure out what's wrong with it. Please help.
    Message was edited by:
    philjoh

    May be, it is not getting the class it is pointing to, in your classpath. Have u put jaxrpc-ri.jar in your classpath, since this jar contains ur class?
    Regards,
    - Tinu

  • [SOLVED] XFCE - Java Swing button theme?

    I'm running XFCE, and I notice that all Swing-based Java applications use the ugly Swing button theme. When I used GNOME 3, some of them would adapt to the GNOME button theme (and would look like they belonged on the system).
    Is this issue with XFCE, my current GTK theme (dorian), or Java, and how can I change this?
    Last edited by 2mac (2014-01-01 22:17:07)

    Thank you for the information.
    I followed the wiki by adding
    export _JAVA_OPTIONS="-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
    to my ~/.bashrc file.
    To test, I launched the Minecraft launcher (one of the applications which does support style changes between desktops), and got back this information:
    Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
    Error parsing gtk-icon-sizes string: ''
    And it had no effect. Any ideas?
    Last edited by 2mac (2013-12-31 16:35:39)

  • Com.sun.* Not Found only in NetBeans - Javac finds them fine!

    I am not sure what is up with this, but NetBeans will not let me specify anything from the com.* packages. It shows the packages in the auto-type boxes as I type in the name (com.sun.blahblahblah) but highlights the statement with a red underline and states 'Package not found".
    Just to let it be known, I have a look-and-feel demo java file downloaded from the net that compiled perfect and runs as expected, and it makes much use of the com.sun.* packages. And I can run NetBeans with the --laf command line option and it will run using any of the LAF's in the com.* packages itself, but still not see them in the IDE for coding use ><
    Any ideas?
    Thanks in advance.

    I just popped in what you wrote, and another thing just for giggles:
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.sun.crypto.provider.*;and they threw no errors. Why is it that my laf is throwing errors when they are plainly there?
    Example -
           public void actionPerformed(ActionEvent event) {
             try {
               UIManager.setLookAndFeel(getText());
               SwingUtilities.updateComponentTreeUI(
                 ChangingLaF.this);
               // call myFrame.pack()
               // to resize frame for laf
             } catch (IllegalAccessException e) {
               // insert code to handle this exception
             } catch (UnsupportedLookAndFeelException e) {
               // insert code to handle this exception
             } catch (InstantiationException e) {
               // insert code to handle this exception
             } catch (ClassNotFoundException e) {
               // insert code to handle this exception
             }This is the code I got off the net, this + a bit more to the .java file of course, compiles perfect with javac. The programmer used the package path com.sun.blahblah as the radiobutton text, that is what the UIManager.setLookAndFeel(getText()); getText() nonsense is. But other than that I see no reason an erro should be thrown in netbeans over UIManager.setLookAndFeel(com.sun.java.swing.plaf.motif.MotifLookAndFeel);
    I did try it with quotes though as a previous post recomended and got this message:
    init:
    deps-jar:
    Compiling 1 source file to E:\Java Apps\Calendar\build\classes
    E:\Java Apps\Calendar\src\Main\MainFrame.java:283: unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    1 error
    BUILD FAILED (total time: 0 seconds)
    <

  • A tiny font is used in many places across Java Swing applications (help!)

    In many places in Java but mostly in text boxes I'm seeing a very small font that is quite hard to read.
    I am seeing this all over the place in Java programs and it is getting on my nerves.
    I'm not sure what is causing this.
    I also encountered this issue when running Java on Windows XP.
    I really need help on how to solve this,
    Or maybe it is actually a bug with Java itself and Windows?
    An image of the problem in SwingSet2:
    [SwingSet 2 Tiny Font Example|http://img687.imageshack.us/img687/1373/swingset2tinyfont.png]
    System spec:
    Windows 7 Professional 32-bit (Aero is on)
    Java 6 Update 20
    English system locale and language
    No special dpi settings (default)
    Screen Resolution: 1280x1024
    Avast Antivirus 5.0
    An intel graphics card
    Edited by: Temp111 on May 9, 2010 7:38 AM

    camickr wrote:
    That is not a problem. Somewhere in that code the programmer uses setFont(....) to make it a smaller font. The default font of a text component does not behave like that.
    For more help create a [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://sscce.org/], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.No, it's defiantly a problem. Probably in the default fonts that Swing uses in some places.
    I detected one place where I can easily trigger this issue, a JTextArea And the Windows Look and Feel, So here is a SSCCE for you:
    [Picture Of Tiny Font SSCCE With Tiny Font issue|http://img88.imageshack.us/img88/7876/tinyfont.png]
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    public class TinyFont {
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
              } catch (InstantiationException e) {
                   e.printStackTrace();
              } catch (IllegalAccessException e) {
                   e.printStackTrace();
              } catch (UnsupportedLookAndFeelException e) {
                   e.printStackTrace();
              JFrame frame = new JFrame("Tiny Font");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JTextArea textArea = new JTextArea("Tiny Font Test");
              frame.add(textArea);
              frame.setSize(150, 100);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }But I also encountered this issue in other places that use Swing.
    Try SwingSet2 Source Code Tab for example: [SwingSet2|http://java.sun.com/products/jfc/jws/SwingSet2.jnlp]

  • Java Swing 1.1 Beta 2 problem

    I want to download Java Swing 1.1 Beta 2 , but i am not able to find any link for this download. Please help me.

    Thanks,its working now. Actually i was trying example from the below link...
    http://java.sun.com/products/jfc/tsc/articles/treetable1/
    which suggested to download Swing 1.1 Beta 2.
    I am using J2sdk 1.4 version.
    For compilation i had to change some of imports
    for example
    //import com.sun.java.swing.tree.*;
    //import com.sun.java.swing.table.*;
    to
    import javax.swing.table.*;
    import javax.swing.tree.*;

  • Difference between having "com.sun" prefix

    i'm new to java and i was just wondering what is the difference or effect of having the prefix "com.sun" at any of the import package files? like "com.sun.javax.swing.*;" for example...

    dinawanao wrote:
    what does "com.sun" mean? what is it?It's just part of a package name. You can name packages whatever you want. Sun's suggestion, and the generally accepted convention, is to begin your package names with your domain name in reverse order. So if I'm working jverd.com, and I'm creating a statistics package, I'd call it com.jverd.statistics. Similarly, a package name that starts with com.sun just means that package came from sun.com. Classes in the core API that start with com.sun are not intended for public use, and could change or go away with any release.
    The main exception to the naming convention is that package that are part of the core Java API and that are intended for general use start with java or javax, where just plain java means it's "really, really core," and javax means it's an "extension" that was added on later. Some stuff has moved from javax to java I think, and there's more (like Swing) that is now probably "core" enough that it could move, but I don't think they want to break compatibility. So for all intents and purposes, java and javax more or less mean the same thing--part of the JSE API.
    Again, the name itself means nothing at all to Java. One package name is the same as any other. With one exception.
    All classes in the java.lang package are automatically imported. This means that you don't have to use an import statement to refer to them by their simple class name (as opposed to the fully qualified name).
    So, to your original question, I would be surprised if there is in fact com.sun.javax.swing. However, if there is, the following are true: 1) That package name means nothing special to Java, and 2) You should not be referring to it in your code.

Maybe you are looking for

  • Windows 7 is junk

    i'm sorry, but i'm sure i'm going to offend a bunch of windows users here. but i've spent more than 80 hours trying to get windows 7 to work correctly on a macbook and have just come to the conclusion that it's a convoluted piece of junk meant to loo

  • How can i view the variables of the session memory

    Hi experts    How can i view the variables of the session memory.Such as I want display the variables of memory which id is 'BULRN' in ABAP debug. In program i can use import from memory id visit the momery of session,but i don't know the name of var

  • What is a pocket data?

    i dont know what this? when i try to open radio it says pocket dat is not available or connected? how can i connect it? where can i get this? Solved! Go to Solution.

  • Applying a debit memo

    Hi Gurus i know that to reverse a credit memo,you need to apply the debit memo to the creidt memo. can someone please assist on the process of applying the credit memo to the invoice and subcequently applying the debit memo to the invoice. thank you

  • 10g forms URL Portal

    Please help............................ We are going to 10g using the following URL through portal http://apphost1.univ-wea.com:7777/forms/frmservlet?form=jat_test&seperateframe=no The issue is when you click on uRL twice and call forms it locks up e