2 ToolTips in an applet ?

I have an applet that draws a graph, I would like to be able to have 2 tooltips that show on 2 different plotted lines. Am I thinking wrongly by trying to implement this with ToolTips? Should I be thinking in a different way of implementing this ?? any answers or help would be highly appreciated..
Peace
Ralph

I wrote this in a frame, but should work the same in an applet. Don't know why the tooltip doesn't seem to work if I don't set it initially.
You are going to have to put in some kind of 'closest to which line' logic
import javax.swing.*;
import java.awt.event.*;
public class Test {
  public static void main(String[] args) {
    JFrame frame = new JFrame();
    final JPanel content = (JPanel)frame.getContentPane();
    content.setToolTipText("hello");  //  Why???
    content.addMouseMotionListener(new MouseMotionAdapter() {
      public void mouseMoved(MouseEvent me) {
     String text = null;
     if (me.getY()<100) text = "Top";
     else if (me.getY()>200) text = "Bottom";
     content.setToolTipText(text);
    frame.pack();
    frame.setSize(200,300);
    frame.show();
}

Similar Messages

  • Need help with applet related problems

    First of all hello to everyone. I'm new to this forum. I usually can solve my problems google-ing around, but this time I just ran out of ideas.
    I'm trying to develop a jni applet that can run native code for performance. I used netbeans so far and the applet works great when run from within the ide. At some point a managed to make the applet run inside firefox and iexplore, however somehow i screwed something up and now i can't make it run anymore. I don't really know what i did but i think it may be related to these lines in the console since everything up until awt works fine in the applet:
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: jawt.dll
    network: Looking up native library in: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\jawt.dll
    basic: Native library jawt.dll not found
    Ofc i may be wrong.
    This also my be a local problem because a friend of mine tried the applet himself and said it's working.
    All the jars are selfsigned.
    below i posted the console output in case you want to take a look. Also I am interested about the "try again.." messages that seem to pop over and over again.
    Java Plug-in 1.6.0_27
    Using JRE version 1.6.0_27-b07 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Gladiator
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value null
    security: property package.definition new value com.sun.javaws
    security: property package.definition value com.sun.javaws
    security: property package.definition new value com.sun.javaws,com.sun.deploy
    security: property package.definition value com.sun.javaws,com.sun.deploy
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp, version: null]
    network: ResponseCode for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp : 200
    network: Encoding for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp : null
    network: Sever response: (length: 564, lastModified: Wed Sep 07 16:30:17 EEST 2011, downloadVersion: null, mimeType: application/x-java-jnlp-file)
    network: Downloading resource: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
         Content-Length: 564
         Content-Encoding: null
    network: Wrote URL file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp to File C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\57\7465fe39-7a36cd96-temp
    network: Cache: Enable a new CacheEntry: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    temp: new XMLParser with source:
    temp: <?xml version="1.0" encoding="UTF-8"?>
    <jnlp href="launch.jnlp">
    <information>
    <title>test app</title>
    <vendor>Raven</vendor>
    </information>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" />
    <jar href="SpaceGame.jar" main="true" />
    </resources>
    <resources os="Windows">
    <nativelib href="lib/swt.jar"/>
    </resources>
    <applet-desc
    name="test app"
    main-class="javatest.JTest"
    width="800"
    height="600">
    </applet-desc>
    <security>
    <all-permissions/>
    </security>
    </jnlp>
    temp:
    returning ROOT as follows:
    <jnlp href="launch.jnlp">
    <information>
    <title>test app</title>
    <vendor>Raven</vendor>
    </information>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="SpaceGame.jar" main="true"/>
    </resources>
    <resources os="Windows">
    <nativelib href="lib/swt.jar"/>
    </resources>
    <applet-desc name="test app" main-class="javatest.JTest" width="800" height="600"/>
    <security>
    <all-permissions/>
    </security>
    </jnlp>
    temp: returning LaunchDesc from XMLFormat.parse():
    <jnlp spec="1.0+" codebase="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/" href="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp">
    <information>
    <title>test app</title>
    <vendor>Raven</vendor>
    <homepage href="null"/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <update check="timeout" policy="always"/>
    <resources>
    <java href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>
    <jar href="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar" download="eager" main="true"/>
    <nativelib href="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar" download="eager" main="false"/>
    </resources>
    <applet-desc name="test app" main-class="javatest.JTest" documentbase="file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.html" width="800" height="600"/>
    </jnlp>
    network: CleanupThread used 16572 us
    basic: Plugin2ClassLoader.addURL2 called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    basic: Plugin2ClassLoader.addURL2 called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    network: No Custom Progress jar
    network: LaunchDownload: concurrent downloads from LD: 4
    network: Total size to download: -1
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar, version: null]
    network: Cache entry not found [url: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar, version: null]
    network: ResponseCode for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar : 200
    network: ResponseCode for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar : 200
    network: Encoding for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar : null
    network: Encoding for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar : null
    network: Sever response: (length: 12948, lastModified: Tue Sep 06 22:46:50 EEST 2011, downloadVersion: null, mimeType: application/x-java-archive)
    network: Sever response: (length: 2007707, lastModified: Tue Sep 06 22:47:10 EEST 2011, downloadVersion: null, mimeType: application/x-java-archive)
    network: CleanupThread used 1 us
    network: Downloading resource: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
         Content-Length: 12,948
         Content-Encoding: null
    network: Downloading resource: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
         Content-Length: 2,007,707
         Content-Encoding: null
    network: Wrote URL file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar to File C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\5\26fb4185-10c9079c-temp
    network: Validating file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar , version null...
    security: Blacklist revocation check is enabled
    security: Trusted libraries list check is enabled
    network: Cache: Enable a new CacheEntry: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    network: CleanupThread used 1 us
    network: Downloaded file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar: file:/C:/Users/Gladiator/AppData/LocalLow/Sun/Java/Deployment/cache/6.0/5/26fb4185-10c9079c
    network: Download Progress: jarsDone: 1
    network: Wrote URL file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar to File C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-temp
    network: Validating file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar , version null...
    network: Cache: Enable a new CacheEntry: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    network: CleanupThread used 2 us
    network: Downloaded file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar: file:/C:/Users/Gladiator/AppData/LocalLow/Sun/Java/Deployment/cache/6.0/10/1082924a-7851bf5e
    network: Download Progress: jarsDone: 2
    network: Created version ID: 1.6+
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6.0.27
    network: Created version ID: 1.6
    basic: LaunchDesc location: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    network: Created version ID: 1.0+
    network: Created version ID: 6.0.18
    security: Validating signatures for file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    security: TustedSet null
    security: Empty trusted set for [file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp]
    security: Round 1 (0 out of 2):file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    security: Entry [file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar] is not prevalidated. Revert to full validation of this JAR.
    security: Round 2 (0 out of 2):file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    security: Validating cached jar url=file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar ffile=C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\5\26fb4185-10c9079c com.sun.deploy.cache.CachedJarFile@698403
    security: Round 2 (1 out of 2):file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    security: Validating cached jar url=file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar ffile=C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e com.sun.deploy.cache.CachedJarFile@e80842
    security: Have 1 common certificates after processing file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    security: Istrusted: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp false
    security: Accessing keys and certificate in Mozilla user profile: null
    security: Loading Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loaded Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    security: User has granted the priviledges to the code for this session only
    security: Adding certificate in Deployment session certificate store
    security: Added certificate in Deployment session certificate store
    security: Saving certificates in Deployment session certificate store
    security: Saved certificates in Deployment session certificate store
    security: Mark trusted: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    basic: LD - All JAR files signed: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/launch.jnlp
    basic: passing security checks; secureArgs:true, allSigned:false
    basic: continuing launch in this VM
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: JNLP2ClassLoader.findClass: javatest.JTest: try again ..
    basic: JNLP2ClassLoader.getPermissions() ..
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    security: JAVAWS AppPolicy Permission requested for: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/SpaceGame.jar
    basic: JNLP2ClassLoader.getPermissions() X
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.events.PaintListener: try again ..
    basic: JNLP2ClassLoader.getPermissions() ..
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    security: JAVAWS AppPolicy Permission requested for: file:/C:/Users/Gladiator/Documents/NetBeansProjects/spacegame~svn/SpaceGame/dist/lib/swt.jar
    basic: JNLP2ClassLoader.getPermissions() X
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.SWTEventListener: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Drawable: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Layout: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.layout.FillLayout: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Composite: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Scrollable: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Control: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Widget: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Shell: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Decorations: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Canvas: try again ..
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA hasnt been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: No need to checking trusted extension for this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    basic: Applet loaded.
    basic: Applet resized and added to parent container
    basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 81605 us, pluginInit dt 2397573 us, TotalTime: 2479178 us
    basic: JNLP2ClassLoader.findClass: javatest.JTest$1: try again ..
    basic: Applet initialized
    C:\Users\Gladiator\AppData\Roaming
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Display: try again ..
    basic: Removed progress listener: null
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Device: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TEXTMETRICW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TEXTMETRIC: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TEXTMETRICA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LOGFONTW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LOGFONT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LOGFONTA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NONCLIENTMETRICSW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NONCLIENTMETRICS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NONCLIENTMETRICSA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Event: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.C: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Platform: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOEXW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOEX: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.OSVERSIONINFOEXA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Lock: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Library: try again ..
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: swt-win32-3735.dll
    network: Looking up native library in: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-win32-3735.dll
    basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-win32-3735.dll
    basic: Applet made visible
    basic: Starting applet
    basic: completed perf rollup
    basic: Applet started
    basic: Told clients applet is started
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: swt-win32-3735.dll
    basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-win32-3735.dll
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.TCHAR: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.ACTCTX: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.DLLVERSIONINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.STARTUPINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Display$1: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Font: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Resource: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.Callback: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.WNDCLASS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.TaskBar: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Listener: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.PAINTSTRUCT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.GCData: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.GC: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.PROPERTYKEY: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.HIGHCONTRAST: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.MSG: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Synchronizer: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.SWT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.SWTError: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.SWTException: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Cursor: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMHDR: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMLVDISPINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.awt.SWT_AWT: try again ..
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: jawt.dll
    network: Looking up native library in: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\jawt.dll
    basic: Native library jawt.dll not found
    basic: JNLP2ClassLoader.findLibrary: Looking up native library: swt-awt-win32-3735.dll
    basic: JNLP2ClassLoader.findLibrary: native library found: C:\Users\Gladiator\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\10\1082924a-7851bf5e-n\swt-awt-win32-3735.dll
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.MenuItem: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Item: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.Menu: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMTTDISPINFOA: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMTTDISPINFO: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.NMTTDISPINFOW: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.ToolTip: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.awt.SWT_AWT$11: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.awt.SWT_AWT$13: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.EventTable: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.WINDOWPOS: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.LRESULT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.win32.RECT: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Point: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.internal.SerializableCompatibility: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.graphics.Rectangle: try again ..
    basic: JNLP2ClassLoader.findClass: javatest.JTest$3: try again ..
    basic: JNLP2ClassLoader.findClass: org.eclipse.swt.widgets.TypedListener: try again ..
    -----

    I am sorry for bold, i came here to ask for help. I used bold to differentiate output from my questions since i couldn't find tags.
    I already validated jnlp using JaNeLA and got only optimization suggestions.
    As I said in first post, this works for a friend of mine, so it's possible a local issue with my java or something ...
    Also i reinstalled jre/jdk 7.0, then uninstalled and installed latest jre/jdk 6.
    Hope I didn't leave a bad impression, i just want help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Applet, JFrame: Display icons in toolbar

    Hello,
    I've a class called Designer which extends Applet. In the init method two JFrames are opened: DesignerFrame and DrawPanel. In the DesignerFrame I have a toolbar with icons. When I run the Applet in Eclipse (on my local computer) he shows the icons. When I put the application on my webserver, and I open it with my browser on my local computer, he doesn't show the icons. The icons are in a folder called pwdImages.
    Does anyone know how to solve this problem?
    Thanks a lot!!!
    Koen.

    Hello,
    Thanks for the answers. Here's some code of the DesignerFrame class:
    // Handles color menu items
         class ColorAction extends AbstractAction {
              public ColorAction(String name, Color color) {
                   super(name);
                   this.color = color;
                   String iconFileName = "pwdImages/" + name + ".gif";
                   if (new File(iconFileName).exists())
                        putValue(SMALL_ICON, new ImageIcon(iconFileName));
              public ColorAction(String name, Color color, String tooltip) {
                   this(name, color);
                   if (tooltip != null) // If there is a tooltip
                        putValue(SHORT_DESCRIPTION, tooltip); // ...squirrel it away
              public void actionPerformed(ActionEvent e) {
                   elementColor = color;
                   statusBar.setColorPane(color);
              private Color color;
    addMenuItem(
                   colorMenu,
                   redAction = new ColorAction("Red", Color.RED, "Draw in red"));
    // Element color actions
         private ColorAction redAction, yellowAction, greenAction, blueAction;
    ...

  • Save  applet  as  images

    I create graphical report using jfree chart . it gives output in applet now i want to save applet as jpg image .
    is it possible ?
    i tried but i got image contain only black color.
    here is my code.
    package com.webaccess.wasurvey.action;
    import com.lowagie.text.Image;
    import java.awt.image.BufferedImage;
    import java.awt.image.ImageObserver;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartPanel;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.axis.CategoryAxis;
    import org.jfree.chart.axis.CategoryLabelPosition;
    import org.jfree.chart.axis.CategoryLabelPositions;
    import org.jfree.chart.axis.CategoryLabelWidthType;
    import org.jfree.chart.plot.CategoryPlot;
    import org.jfree.chart.plot.PlotOrientation;
    import org.jfree.data.category.CategoryDataset;
    import org.jfree.data.category.DefaultCategoryDataset;
    import org.jfree.text.TextBlockAnchor;
    import org.jfree.ui.ApplicationFrame;
    import org.jfree.ui.RectangleAnchor;
    import org.jfree.ui.RefineryUtilities;
    import org.jfree.ui.TextAnchor;
    import org.jfree.util.Log;
    import org.jfree.util.PrintStreamLogTarget;
    * A simple demonstration application showing how to create a horizontal 3D bar chart using data
    * from a {@link CategoryDataset}.
    public class BarChart3DDemo2 extends ApplicationFrame {
    // * JFREECHART DEVELOPER GUIDE *
    // * The JFreeChart Developer Guide, written by David Gilbert, is available *
    // * to purchase from Object Refinery Limited: *
    // * Sales are used to provide funding for the JFreeChart project - please *
    // * support us so that we can continue developing free software. *
    * Creates a new demo.
    * @param title the frame title.
    public BarChart3DDemo2(final String title) {
    super(title);
    // create the chart...
    final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(23.0, "Series 1", "London");
    dataset.addValue(11.0, "Series 1", "New York");
    dataset.addValue(12.0, "Series 1", "Istanbul");
    dataset.addValue(13.0, "Series 1", "Cairo");
    dataset.addValue(13.0, "Series 2", "London");
    dataset.addValue(19.0, "Series 2", "New York");
    dataset.addValue(19.0, "Series 2", "Istanbul");
    dataset.addValue(19.0, "Series 2", "Cairo");
    dataset.addValue(7.0, "Series 3", "London");
    dataset.addValue(9.0, "Series 3", "New York");
    dataset.addValue(9.0, "Series 3", "Istanbul");
    dataset.addValue(9.0, "Series 3", "Cairo");
    final JFreeChart chart = createChart(dataset);
    // add the chart to a panel...
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(chartPanel);
    * Creates a chart.
    * @param dataset the dataset.
    * @return The chart.
    private JFreeChart createChart(final CategoryDataset dataset) {
    final JFreeChart chart = ChartFactory.createBarChart3D(
    "3D Bar Chart Demo 2", // chart title
    "Category", // domain axis label
    "Value", // range axis label
    dataset, // data
    PlotOrientation.HORIZONTAL, // orientation
    true, // include legend
    true, // tooltips
    false // urls
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setForegroundAlpha(1.0f);
    // left align the category labels...
    final CategoryAxis axis = plot.getDomainAxis();
    final CategoryLabelPositions p = axis.getCategoryLabelPositions();
    final CategoryLabelPosition left = new CategoryLabelPosition(
    RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
    TextAnchor.CENTER_LEFT, 0.0,
    CategoryLabelWidthType.RANGE, 0.30f
    axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
    return chart;
    public void saveimage()
    Image backbuffer;
    ImageObserver observer=null;
    BufferedImage bufferedImage = new BufferedImage (1000,100,BufferedImage.TYPE_INT_BGR );
    // BufferedImage bufferedImage = new BufferedImage ( 1000,100,BufferedImage.TYPE_INT_RGB );
    //      bufferedImage.createGraphics().drawImage( backbuffer, 0, 0,this);
    bufferedImage.createGraphics().drawImage(bufferedImage, 10, 60,observer);
                   try {
                   ImageIO.write( bufferedImage, "jpg", new File ( "image.jpg" ) );
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
    * Starting point for the demonstration application.
    * @param args ignored.
    public static void main(final String[] args) {
    Log.getInstance().addTarget(new PrintStreamLogTarget());
    final BarChart3DDemo2 demo = new BarChart3DDemo2("3D Bar Chart Demo 2");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.saveimage();
    demo.setVisible(true);
    }

    Hi Pradip, its very simple to save the applet as PNG or JPEG. Firstly u dont have to create a function
    saveimage() as u did. delete it. Instead, in the createchart function after the code --------
    final JFreeChart chart = ChartFactory.createBarChart3D(
    "3D Bar Chart Demo 2", // chart title
    "Category", // domain axis label
    "Value", // range axis label
    dataset, // data
    PlotOrientation.HORIZONTAL, // orientation
    true, // include legend
    true, // tooltips
    false // urls
    //append the following code to it
    try {
         ChartUtilities.saveChartAsJPEG(
    new java.io.File("C:/hi.JPEG"), chart, 800, 300);
         } catch (java.io.IOException exc) {
         System.err.println("Error writing image to file");
    //then continue with the rest...BINGO!!! its done...

  • Signed applets and dialogs

    hi all,
    question to clarify my understanding of signed applets.
    got a bog-standard applet. nothing clever or special.
    got myself a bog-standard cert from thawte.
    signed the applet and put it on a webserver.
    displays the correct security notice on first load. continue and "Always trust this company" etc...
    all runs fine.
    in the applet init, i've put in
    java.awt.AWTPermission perm = new java.awt.AWTPermission("showWindowWithoutWarningBanner");
    try {
      AccessController.checkPermission(perm);
      System.out.println("access allowed?");
    } catch (AccessControlException ex) {
      ex.printStackTrace();
    }open the main frame, and all is good. no banner or access denied exception.
    show a popup menu, or tooltip. no banner.
    display a dialog. oops, a banner "Java Applet Window" and the bottom section of the dialog is covered with the warning msg.
    so i'm confused.
    does this mean that this permission does not apply to dialogs? (if so, what?)
    even with a cert, this msg cannot be removed? (please tell me no)
    wrap and recode all dialog openings with AccessController.doPrivileged? (i dont wanna do this)
    or i missed something with the setup.
    i've been searching the forums for some info, but seem to be going in circles. editing the policy file on all client comps is not a valid option, unless there is sometrick i dont know about .
    tia
    -a

    hi,
    i got the answer from the link
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1215-security.html

  • Applet Problems

    Hi all....
    I wonder if anyone could give me any tips about call the following program from an applet?
    Basically i am going to send a dataset to this program from an applet and i want it to display the graph that is created... I realise i will have to take main() away but i cant seem to call it from my applet (wont compile)
    Many thanks
    package org.jfree.chart.demo;
    import java.awt.BasicStroke;
    import java.awt.Color;
    import java.awt.Dimension;
    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartPanel;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.StandardLegend;
    import org.jfree.chart.axis.NumberAxis;
    import org.jfree.chart.plot.CategoryPlot;
    import org.jfree.chart.plot.PlotOrientation;
    import org.jfree.chart.renderer.LineAndShapeRenderer;
    import org.jfree.data.CategoryDataset;
    import org.jfree.data.DefaultCategoryDataset;
    import org.jfree.ui.ApplicationFrame;
    import org.jfree.ui.RefineryUtilities;
    * A simple demonstration application showing how to create a line chart using data from a
    * {@link CategoryDataset}.
    public class LineChartDemo1 extends ApplicationFrame {
         * Creates a new demo.
         * @param title  the frame title.
        public LineChartDemo1(final String title) {
            super(title);
            final CategoryDataset dataset = createDataset();
            final JFreeChart chart = createChart(dataset);
            final ChartPanel chartPanel = new ChartPanel(chart);
            chartPanel.setPreferredSize(new Dimension(500, 270));
            setContentPane(chartPanel);
         * Creates a sample dataset.
         * @return The dataset.
        private CategoryDataset createDataset() {
            // row keys...
            final String series1 = "First";
            final String series2 = "Second";
            final String series3 = "Third";
            // column keys...
            final String type1 = "Type 1";
            final String type2 = "Type 2";
            final String type3 = "Type 3";
            final String type4 = "Type 4";
            final String type5 = "Type 5";
            final String type6 = "Type 6";
            final String type7 = "Type 7";
            final String type8 = "Type 8";
            // create the dataset...
            final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
            dataset.addValue(1.0, series1, type1);
            dataset.addValue(4.0, series1, type2);
            dataset.addValue(3.0, series1, type3);
            dataset.addValue(5.0, series1, type4);
            dataset.addValue(5.0, series1, type5);
            dataset.addValue(7.0, series1, type6);
            dataset.addValue(7.0, series1, type7);
            dataset.addValue(8.0, series1, type8);
            dataset.addValue(5.0, series2, type1);
            dataset.addValue(7.0, series2, type2);
            dataset.addValue(6.0, series2, type3);
            dataset.addValue(8.0, series2, type4);
            dataset.addValue(4.0, series2, type5);
            dataset.addValue(4.0, series2, type6);
            dataset.addValue(2.0, series2, type7);
            dataset.addValue(1.0, series2, type8);
            dataset.addValue(4.0, series3, type1);
            dataset.addValue(3.0, series3, type2);
            dataset.addValue(2.0, series3, type3);
            dataset.addValue(3.0, series3, type4);
            dataset.addValue(6.0, series3, type5);
            dataset.addValue(3.0, series3, type6);
            dataset.addValue(4.0, series3, type7);
            dataset.addValue(3.0, series3, type8);
            return dataset;
         * Creates a sample chart.
         * @param dataset  a dataset.
         * @return The chart.
        private JFreeChart createChart(final CategoryDataset dataset) {
            // create the chart...
            final JFreeChart chart = ChartFactory.createLineChart(
                "Line Chart Demo 1",       // chart title
                "Type",                    // domain axis label
                "Value",                   // range axis label
                dataset,                   // data
                PlotOrientation.VERTICAL,  // orientation
                true,                      // include legend
                true,                      // tooltips
                false                      // urls
            // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
            final StandardLegend legend = (StandardLegend) chart.getLegend();
            legend.setDisplaySeriesShapes(true);
            legend.setShapeScaleX(1.5);
            legend.setShapeScaleY(1.5);
            legend.setDisplaySeriesLines(true);
            chart.setBackgroundPaint(Color.white);
            final CategoryPlot plot = (CategoryPlot) chart.getPlot();
            plot.setBackgroundPaint(Color.lightGray);
            plot.setRangeGridlinePaint(Color.white);
            // customise the range axis...
            final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
            rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
            rangeAxis.setAutoRangeIncludesZero(true);
            // customise the renderer...
            final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
            renderer.setDrawShapes(true);
            renderer.setSeriesStroke(
                0, new BasicStroke(
                    2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
                    1.0f, new float[] {10.0f, 6.0f}, 0.0f
            renderer.setSeriesStroke(
                1, new BasicStroke(
                    2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
                    1.0f, new float[] {6.0f, 6.0f}, 0.0f
            renderer.setSeriesStroke(
                2, new BasicStroke(
                    2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
                    1.0f, new float[] {2.0f, 6.0f}, 0.0f
            // OPTIONAL CUSTOMISATION COMPLETED.
            return chart;
         * Starting point for the demonstration application.
         * @param args  ignored.
        public static void main(final String[] args) {
            final LineChartDemo1 demo = new LineChartDemo1("Line Chart Demo");
            demo.pack();
            RefineryUtilities.centerFrameOnScreen(demo);
            demo.setVisible(true);
    }

    yes sorry that was the old error message!!!!
    --------------------Configuration: JDK version <Default>--------------------
    E:\reactionT\Main.java:185: cannot access LineChartDemo1
    bad class file: E:\reactionT\LineChartDemo1.class
    class file contains wrong class: org.jfree.chart.demo.LineChartDemo1
    Please remove or make sure it appears in the correct subdirectory of the classpath.
                   LineChartDemo1.main(null);
    this is what i get now

  • Tooltip for mousedragged

    I did a program in applet..I want to set tooltip for the drawing..i.e.,when the oval is dragged its new co-ordinates should be displayed by using the tooltip..How can i do this..
    .import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.geom.Ellipse2D;
    import java.awt.geom.Line2D;
    import java.awt.geom.Point2D;
    import java.text.DateFormat;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.BorderLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.BorderFactory;
    import javax.swing.border.Border;
    public class mouseevent extends JApplet
          private static final int BALL_DIAMETER = 40; // Diameter of ball
        //--- instance variables
        /** Ball coords.  Changed by mouse listeners.  Used by paintComponent. */
        private int _ballX     = 450;   // x coord - set from drag
        private int _ballY     = 50;   // y coord - set from drag
        /** Position in ball of mouse press to make dragging look better. */
        private int _dragFromX = 0;    // pressed this far inside ball's
        private int _dragFromY = 0;    // bounding box.
        /** true means mouse was pressed in ball and still in panel.*/
        private boolean _canDrag  = false;
        JLabel label;
        String s= "aswedfrtyhgqwsadrftlopqasnhfgrchildnode1";   
        int width = s.length();   
        int border = 2;    int margin = 10;   
        int rectx = margin+border,recty =margin+border+63;   
        int rectwidth = 8, rectheight = 6;   
        int imgborder = 10;   
        int imgline1 = 300;  
        int labellocx = rectx+imgborder+13;  
        int labellocy = recty+imgborder-1;   
        int circlex = rectx+rectwidth;
        int circley = recty+rectheight;  
        int x =rectx+rectwidth+10;  
        int y = recty+rectheight+10;
        int x1 = x+17; 
        int y1 = y+20;  
        int titlebarx= 300;
        int titlebary = 40;  
        boolean title = true;
        String date[] = {"0","4","8","12","16","20","24"}; 
        String day[] = {"Mon","Tue","Wed","Thu","Fri","Sat"};
        int width1 = 180;
    //    int f2= x+168;
        int n =180;
    //    int dayx = 385;
        long From ;
        long To ;
        ArrayList dateList;
         int rect1x= 300;
        int rect1y = 100;
        int rect1width= 50;
        int rect1heigth = 50;
        boolean candrag = false;
        public void init()     
            Container cont = getContentPane();   
            cont.setLayout(new BorderLayout());
            // to see the scrollpane, the scrollpane has to be smaller        
            // then the component held within its viewport             
            setPreferredSize(new Dimension(300, 300));             
            JScrollPane scroll = new JScrollPane();              
            getContentPane().add(scroll, BorderLayout.CENTER);        
            scroll.getViewport().add(new Imagepanel());       
    private class Imagepanel extends JPanel implements MouseListener,MouseMotionListener
            JScrollPane scroll = new JScrollPane();      
            Rectangle rect = new Rectangle(rectx,recty,rectwidth,rectheight);
            Rectangle rect1  = new Rectangle(rect1x,rect1y,rect1width,rect1heigth);
            Ellipse2D.Double circle = new Ellipse2D.Double(_ballX,_ballY,BALL_DIAMETER,BALL_DIAMETER);   
            Ellipse2D.Double circle1 = new Ellipse2D.Double(x+10,y+10,4,4);    
            boolean selected = false;  
            boolean selected1 = false;     
            int w ;     
        Imagepanel()       
            // setting the component to be largenr than the scrollpane           
            // just so we'll see scrollbars.
            setPreferredSize(new Dimension(32710,32710));      
            scroll = new JScrollPane();     
            add(scroll);                 
            addMouseListener(this);       
            addMouseMotionListener(this);
            setBorder(BorderFactory.createLineBorder(Color.BLACK, border));          
        protected void paintComponent(Graphics g)         
            int n = 168;
            int x = 300;
            int x1=300;
            int x2=x;
            int daydx=(width1/2);
            int dayx =(daydx+x);
            int f2= x+n;
            From = new java.util.GregorianCalendar(2007,01,01).getTime().getTime();
            To = new java.util.GregorianCalendar(2007,06,30).getTime().getTime();
            double Difference = To-From;
            long days = Math.round((Difference/(1000*60*60*24)));
            int noday = (int)days;
            Date fromDate = new java.util.GregorianCalendar(2007,01,01).getTime();
            Date toDate = new java.util.GregorianCalendar(2007,06,30).getTime();
            super.paintComponent(g);            
            Graphics2D g2 = (Graphics2D) g;             
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);       
            Font font = new Font("Ariel",Font.PLAIN,11); 
            Font font1 = new Font("Ariel",Font.PLAIN,9);
            g2.fillOval(_ballX, _ballY, BALL_DIAMETER-20, BALL_DIAMETER-20);
            g2.setBackground(Color.GRAY);
            //drawing the tilte bar     
            g2.setBackground(Color.WHITE);  
            g2.drawLine(imgline1,0,imgline1,getHeight()); 
            g2.setPaint(new Color(0,128,192));
            g2.fillRect(imgborder,imgborder,290,45);
            //g2.drawLine(margin,margin,titlebarx,titlebary);              
            //drawing the root node and labeling      
            g2.draw(rect);
            g2.setPaint(Color.WHITE);
            g2.drawLine(margin,margin,titlebarx,titlebary); 
            g2.drawString("RESOURCE",40,40);       
            g2.drawString("TIME",200,25);
            g2.setPaint(Color.green);
            g2.drawString("sadasd",344,22);
            g2.draw(circle);
            rect.setLocation(rectx,recty);      
            rect.setSize(rectwidth,rectheight);
            g2.setPaint(Color.BLACK);
            g2.drawString(" aswedfrtyhgqwsadrftlopqasnhfgrchildnode1",rectx+rectwidth+05,recty+rectheight);               
            for (int i = 0;i<noday;i++)
            Calendar  c = Calendar.getInstance(); // current date
                c.add(Calendar.DATE, i); // add one day
                SimpleDateFormat sdf = new  SimpleDateFormat("MM/dd/yy"); // use the pattern: day_of_month
                String str = sdf.format(c.getTime()); // fromat the date to string
                System.out.println(str); // print it at the console
                for (int j=0;j<6;j++)
                    g2.setFont(font1);
                    g2.drawLine(x1,40,x1,35);
                    g2.drawString(date[j],x1,35);
    //              g2.drawString(day[j],dayx,20);
                    g2.drawString("24",f2,35);
                    f2+=width1;
                    x1+=30;
    //              dayx=+170;
                g2.drawRect(x,10,width1,30);
                x+=width1;
                g2.drawString(str,dayx,20);
                dayx+=180;
            for(int k=0;k<n;k++)
                for(int l=0;l<6;l++)
                Calendar c = Calendar.getInstance(); // current datem
                c.add(Calendar.DAY_OF_WEEK, k); // add one day
                SimpleDateFormat sdf = new SimpleDateFormat("EEE"); // use the pattern: day_of_month
                String str = sdf.format(c.getTime()); // fromat the date to string
                System.out.println(str); // print it at the console
                g2.drawString(str,dayx,5);
    //          g2.drawString(day[l],dayx,20);
                dayx+=180;
            //dividing the drawing panel      
            //drawing for the click event       
            if(selected)       
                Color color = Color.orange; 
                g2.fill(circle);
                g2.draw(circle);          
                //              g2.drawRoundRect(x+30,y+15,200,12,5,5);        
                g2.drawString("aswedfrtyhgqwsadrftlopqasnhfgrchildnode1",x+15,y+5);     
                g2.drawRect(300,y,100,15);      
            if(selected1)      
                g2.setFont(new Font("Arial",Font.PLAIN,12)); 
                g2.fill(circle1);
                g2.draw(circle1);           
                g2.drawString(" aswedfrtyhgqwsadrftlopqmasnhfgrchildnode1",x1+15,y1+5);  
        public void update(Graphics g)    
            paint(g);   
        public void mouseClicked(MouseEvent e)          
            //imagePaneMouseClicked(e);              
        private void imagePaneMouseClicked(MouseEvent e)        
            Point p = e.getPoint();         
            if (rect.contains(p))                  
                if (!selected)              
                    selected = true;        
                    repaint();               
            if(circle.contains(p))     
                if(!selected1)           
                    selected1 = true;    
                    repaint();           
            if(rect.contains(p)) 
                if(e.getClickCount() == 2)    
                    selected = false;  
                    repaint();      
        public void mousePressed(MouseEvent e)        
             int x = e.getX();   // Save the x coord of the click
            int y = e.getY();   // Save the y coord of the click
            if (x >= _ballX && x <= (_ballX + BALL_DIAMETER)
                    && y >= _ballY && y <= (_ballY + BALL_DIAMETER)) {
                _canDrag = true;
                _dragFromX = x - _ballX;  // how far from left
                _dragFromY = y - _ballY;  // how far from top
            } else {
                _canDrag = false;
        public void mouseReleased(MouseEvent e) {        }               
        public void mouseEntered(MouseEvent e) {        }          
        public void mouseExited(MouseEvent e) { 
            candrag = false;
            public void mouseDragged(MouseEvent e) {
              if (_canDrag)
              {   // True only if button was pressed inside ball.
                //--- Ball pos from mouse and original click displacement
                _ballX = e.getX() - _dragFromX;
                _ballY = e.getY() - _dragFromY;
                //--- Don't move the ball off the screen sides
                _ballX = Math.max(_ballX, 0);
                _ballX = Math.min(_ballX, getWidth() - BALL_DIAMETER);
                //--- Don't move the ball off top or bottom
                _ballY = Math.max(_ballY, 0);
                _ballY = Math.min(_ballY, getHeight() - BALL_DIAMETER);
                this.repaint(); // Repaint because position changed.
                this.add(label);
                label.setText(""+_ballX+_ballY);
                label.setLocation(_ballX,_ballY);
            public void mouseMoved(MouseEvent e) {
    }

    The label is not getting displayed...the program throws some exception...
    Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
    at java.awt.Container.addImpl(Container.java:1015)
    at java.awt.Container.add(Container.java:351)
    at javaapplication5.mouseevent$Imagepanel.mouseDragged(mouseevent.java:346)
    at java.awt.Component.processMouseMotionEvent(Component.java:5536)
    at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
    at java.awt.Component.processEvent(Component.java:5257)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3909)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

  • Power-manager applet: wrong alerts

    I have Gnome and I use power-manager-applet in the taskbar to check the life of the battery.
    I noticed this strange problem... When I use the laptop with batteris and I connect the power cable, the applet displays a popup alerting me that the power cable has been disconnected! But the icon shows the right image with the plug over the battery. And if I put the mouse on it, a tooltip says that the battery is charging...
    If I disconnect the cable, the applet doesn't display no alters and an OSD popup with a stylized gear appears in the middle-botton of the monitor....
    Does anybody has experienced something similar?

    I've tried xfce4-power-manager but this program has a bug too.
    Its icon appears in the sys-tray only after about 20 seconds after Gnome's loaded...
    I've tried to load it from ~/.bashrc but it manifest the same problem: it appears only after a while... Could it do this because I use it under Gnome instead of XFCE?
    P.S.:
    I've noticed that it is also slower than gnome-power-manager in refreshing its state: if I disconnect the power cable, it pops up the notification after 5-10 seconds...
    Last edited by leo72 (2009-06-30 20:26:22)

  • Displaying TOOL TIP message over an applet

    Hi,
    How to display a tooltip(hint) like message when the mouse moves over an applet. Here is the rough source code, Please do the needful.
    import java.applet.*;
    import java.awt.*;
    public class Dis extends Applet implements MouseListner
         public void init()
              setLayout(null);
              ButtonAb b = new ButtonAb("click me"); //this is another class that is being called here, this class extends Component, I have written all ActionListeners and MouseListeners in this class only
              b.add();
         //public void addMouseListener(MouseEvent me)
    When the mouse moves over the Button("click me"), a hint box or tooltip like message should be displayed. It is easy doing with VB or Swing, but I wanted to it with AWT. Please give me some source code also.
    Thanks in advance
    Uma

    There are several ways to implement tooltip in awt. I prefere a general ToolTip class that can be added to any Component, and that is easy to use:
    something like this:Button but;
    but = new Button("Push");
    add(but);
    new ToolTip(but, "Push this button if you want to push this button");The code above should add a ToolTip to the java.awt.Button, so that everytime the mouse hoovers over the button, the message gets displayed.
    The idea is to make a ToolTip that can be added to any java.awt.Component using one line of code only. How do one achive that? Ok, here is a pseudo implementation of the ToolTip class:class ToolTip extends java.awt.Canvas implements Runnable, MouseListener, MouseMotionListener
       private String m_strText;
       private Component m_Component;
       private Thread m_Thread;
       private int m_iX;
       private int m_iY;
       public ToolTip(Component comp, String strText);
          m_strText = strText;
          m_Component = comp;
          comp.addMouseMotionListener(this);
          comp.addMouseListener(this);
       public void run()
          try{
             Thread.sleep(500);
             // Here its time to display the tooltip:
             // We need to add it.
             Component comp = this;
             while((!comp instanceof Applet) &&
                     (!comp instanceof Frame))
                comp = comp.getParent();
             ((Container)comp).add(this);
             int x,y,w,h;
             x = m_iX+m_Component.getLocationOnScreen().x-comp.getLocationOnScreen.x;
             y = m_iY+m_Component.getLocationOnScreen().y - comp.getLocationOnScreen.y;
             h=30;
             w=getFontMetrics().stringWidth(m_strText);
             setBounds(x,y,w,h);
          cathc(InterruptedException e)
       public void mouseEntered(MouseEvent e)
          start(e.getX(), e.getY());
       private void start(int iX, int iY);
          m_iX = iX;
          m_iY = iY;
          m_Thread = new Thread(this);
          m_Thread.start();
       public void mouseExited(MouseEvent e)
          stop();
       public void mouseMoved(MouseEvent e)
          stop();
          start(e.getX(), e.getY());
       private void stop()
          if(m_Thread != null)
             m_Thread.interrupt();
          Container parent = getParent();
          if(parent != null)
             parent.remove(this);
       public void paint(Graphics g)
          g.drawString(m_strText, 0, 20);
          g.drawRect(0,0,getSize().width, getSize().height);
    }The baseclass could be changed to java.awt.Window.
    using Window gives the ToolTip the posibillity to extend beyond the borders of the Applet (or the Frame), but in IE it gives you the "warning applet window" displayed on the botton of every ToolTip.
    Ragnvald Barth
    Software engineer

  • ToolTip Displaying on Wrong Monitor

    Hello,
    I'm using two monitors. When I move my applet from one monitor to the other , the tooltips still appear on the monitor the applet originated on. The toolTip is on the edge of the screen, like it's trying REALLY hard to get over to where the cursor is. Hopefully someone has had experience with this?!

    This happens only when viewing the applet through a browser, not when I run it as an applet through Eclipse.

  • How to show ToolTip on FocusGained event

    Situation is like following:
    A JTextField has some ToolTip associated with it, I want to show that ToolTip on FocusGained event of that JTextField.

    Here it is (note that resource is simply a class file that contains color and font settings -- nohting mysterious):
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public class ToolTip extends Canvas {
       protected String tip;
       protected Component owner;
       private Container mainContainer;
       private LayoutManager mainLayout;
       private boolean shown;
       private int VERTICAL_OFFSET,HORIZONTAL_OFFSET,X,Y;
       private final int HORIZONTAL_ENLARGE=10;
       private FontMetrics fm;
       public ToolTip(String tip, Component owner, Container mc, int bp, resource res) {
          this.tip=tip;
          this.owner=owner;
          this.mainContainer=mc;
          setBackground(res.ToolTipBGColor);
          setForeground(res.ToolTipFGColor);
          setFont(res.ToolTipFont);
          fm=getFontMetrics(getFont());
          X=owner.getLocationOnScreen().x;
          Y=owner.getLocationOnScreen().y;
          int w=owner.getSize().width;
          int h=owner.getSize().height;
          if (bp==0) {                         // top
             HORIZONTAL_OFFSET=3;
             VERTICAL_OFFSET=h;
          } else if (bp==1) {                  // left
             HORIZONTAL_OFFSET=w;
             VERTICAL_OFFSET=0;
          } else if (bp==2) {                  // right
             HORIZONTAL_OFFSET=-fm.stringWidth(tip)-HORIZONTAL_ENLARGE;
             VERTICAL_OFFSET=0;
          } else {                             // bottom
             HORIZONTAL_OFFSET=3;
             VERTICAL_OFFSET=-fm.getHeight();
          owner.addMouseListener(new MAdapter());
       public void paint(Graphics g) {
          g.drawRect(0,0,getSize().width,getSize().height);
          g.drawString(tip,3,getSize().height-3);
       private void addToolTip() {
          mainContainer.setLayout(null);
          setSize(fm.stringWidth(tip)+HORIZONTAL_ENLARGE, fm.getHeight());
          setLocation(X-mainContainer.getLocationOnScreen().x+HORIZONTAL_OFFSET,
             Y-mainContainer.getLocationOnScreen().y+VERTICAL_OFFSET);
          if (mainContainer.getSize().width<(getLocation().x+getSize().width)) {
             setLocation(mainContainer.getSize().width-getSize().width, getLocation().y);
          mainContainer.add(this,0);
          mainContainer.validate();
          shown=true;
       private void removeToolTip() {
          if (shown) {
             mainContainer.remove(0);
             mainContainer.setLayout(mainLayout);
             mainContainer.validate();
          shown = false;
       class MAdapter extends MouseAdapter {
          public void mousePressed(MouseEvent me) {
             if (me.getModifiers()==4) {
                mainLayout=mainContainer.getLayout();
                addToolTip();
                me.consume();
          public void mouseReleased(MouseEvent me) {
             if (shown) removeToolTip();
    }If you have problem modifying the code, noah.w is an expert in the GUI stuff, maybe he can help you.
    Hope this helps!
    ;o)
    V.V.

  • Swing Applet - Internet Explorer - Focus issue - tool tips

    Hi ,
    We are using Swing applet in IE Browser , except this swing component rest of the components in the browser are HTML/DHTML components.
    and we are having issue focus issue with this swing components ,
    once immediately after launching the swing applet , the UI components are having some focus issue , if I bring the mouse on top of the swing UI components , we couldn't able to see the tooltips(flyover text) of those Swing UI components.
    However if we click some where on the Swing applet frame , we are able to see these tooltips(flyover text) .
    It looks like a kind of compatibility issue between swing and IE browser .
    I am trying to find a solution for this issue , so that once after launching the applet , tooltips will work without need to click on the applet bar.
    Can somebody share some thoughts on this issue??
    Thanks,
    Bonthu.

    As a wild guess you are mixing Swing and awt components which is a big no-no and among other things can cause repainting, refreshing issues.
    If you want more help then that you need to post some code that shows us what you are doing.

  • Mnemonic in the tooltip: 1.5 vs 1.6?

    swing appends Button mnemonic to the tooltip
    our code uses and everything is great under 1.5, but if we start the same app under 1.6 the mnemonic is not appended to the tooltip anymore :(
    i do not want to dirty-hack this so i wonder how to i tell swing i still want the mnemonic in the toolbar?

    1.5 puts the string by itself [Alt-X]
    1.6 does not put the string
    if i understand you right you are suggesting to check the JVM version at runtime and add the string if runned under 1.6? this is kinda hacky, i would
    love to understand what is going on and what causes the difference in the UI of my applet under 1.5 and 1.6

  • Display text and image over Video Image in applet

    Hi
    I am working in JMF for a video applet.
    I have a doubt ,how we can display text and image over Video Image.
    Is anybody know how we can draw text over Video Image,pls sent a small code how can do it in applet?.
    I can do it in a frame,but it not work in a applet !
    CHT

    it is very much possible in a htmlb:button.
    its same as how you have done it in xhtmlb:toolbarButton
    working code
            <%
      data image type   ref to cl_htmlb_image.
      data: image_string type string.
      create object image.
      image->id = 'IEX'.
      image->src = cl_bsp_mimes=>sap_icon( 'ICON_EXECUTE_OBJECT' ).
      image->tooltip = 'Find the Link'.
      clear image_string.
      image_string = image->IF_BSP_BEE~RENDER_TO_STRING( page_context ).
              %>
              <htmlb:button id     = "EX"
                            text   = "<%= image_string %> Execute"
                            encode = "FALSE"
                            onClick = "EXECUTE"/>
    Regards
    Raja

  • JMF + JWS + Applet

    I'm working in a project with JMF and JWS (maybe Applets).
    My application needs to capture a image from a webcam.
    I know I have to sign my jar files, but my application isn't working at all, cause I can't start my webcam from my application. Always getting a nullPointerException.
    In the Eclipse IDE, the same application works very fine.
    My questions are:
    1. May I have to sign the jmf.jar?
    2. Where may I have to copy them?
    Apreciate any help.

    >
    1. It was already in my plans use JFrame and JWS. Applets is my B plan.>I would demote the plan 'B' to a plan 'C'. Applets are a PITA, and rarely a solution to ..anything.
    >
    2. My jnlp file have all-permissions in security tag.>It was in the wrong place, see below.
    >
    3. I don't get the NoClassDefFoundError. Instead, I got NullPointerException, 'cause my application don't find any webcam. Only in Eclipse IDE Enviroment.>Uh-huh. Not entirely sure of the exact meaning/cause of the NPE yet, but it might be a caching problem.
    <http://forum.java.sun.com/thread.jspa?threadID=5209499>
    Here is a thread where I describe how to change the cahce location, and the advantages of doing so (for testing).
    >
    4. My question is: What do I have to do with jmf.jar and his friends? Signed them too ( I've signed them but it didn't work )? >I am not entirely convinced that the code signing failed. There are still too many variables to determine if the code was ever considered 'trusted'.
    >
    ..Copy them where?>Add the JNLP codebase to the href for a jar, and the jar should be placed/available 'there'. If you can fetch it using the browser using that final URL, it should be fine.
    E.G. the codebase of this JNLP is http://localhost:8080/Capture/, and the href for the first jar is aCapture.jar. So the final URL would be
    http://localhost:8080/Capture/ + aCapture.jar
    ->
    http://localhost:8080/Capture/aCapture.jar
    If the href had been 'lib/aCapture.jar', the final URL would be..
    http://localhost:8080/Capture/lib/aCapture.jar
    Simple, huh?
    >
    5. Something about "vfw:Microsoft WDM Image Capture (Win32):0"?>I do not understand that question.
    >
    6. What is Dukes?>You seem to have figured that out. ;-)
    >
    Next my jnlp file:>- The <security> element was 'out of order', it has been 'put in its place' in the JNLP file below. BTW - are you prompted to 'accept the code from..' (or words to that effect)?
    That would indicate that the plug-in understands this is code that needs all-permissions.
    - The JNLP element's 'spec' attribute refers not to a J2SE version, but to the JNLP specification version. Most apps. will have '1.0', but apps. that use features built into JWS in J2SE 5, might specify '1.5'. (There were no changes to JWS in versions 1.2/1.3/1.4).
    - Are you certain that the jars aCapture.jar, mediaplayer.jar & jmf.jar are the only things on the classpath of the app. when it runs in the IDE? I was almost expecting to see some references to 'nativelib's. Here is an example(2) of another JNLP that includes nativelibs (note that I did not check into it deeply, but some of the things in it appear either wrong, or at the least redundant - only the references to nativelibs are of interest).
    1) The valid JNLP file
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for Capture Demo Application -->
    <jnlp
    spec="1.0"
    codebase="http://localhost:8080/Capture/" href="exemplo.jnlp">
    <information>
      <title>Capture Demo Application</title>
      <vendor>DESofts</vendor>
      <homepage href="docs/help.html"/>
      <description>Capture Demo Application</description>
      <description kind="short">
        A demo of the capabilities of the Swing Graphical User Interface.
      </description>
      <icon href="images/icone.jpg"/>
      <icon kind="splash" href="images/icone.jpg"/>
      <offline-allowed/>
      <shortcut online="false">
        <desktop/>
        <menu submenu="My Corporation Apps"/>
      </shortcut>
    </information>
    <security>
      <all-permissions/>
    </security>
    <resources>
      <j2se version="1.4+"/>
      <jar href="aCapture.jar"/>
      <jar href="mediaplayer.jar"/>
      <jar href="jmf.jar"/>
    </resources>
    <application-desc main-class="Capture"/>
    </jnlp> 2) The example JNLP that mentions natives, from
    <http://www.dutchie.net/jmf/example/webstart/launchNative_MP3.jnlp>
    (with minor formatting variations that hopefully do not change its meaning.)
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp codebase="http://www.dutchie.net/jmf/example/webstart" href="launchNative_MP3.jnlp">
    <information>
      <title>JMF Demo</title>
      <vendor>Dutchie Pty Ltd</vendor>
      <homepage href="http://www.dutchie.net"/>
      <description>The JMF Demo.</description>
      <description kind="short">Demo showing features of JMF</description>
        <description kind="one-line">JMF Demo</description>
        <description kind="tooltip">Click here to launch the JMF Demo</description> 
        <icon href="dutchieIcon.gif"/>
        <icon kind="splash" href="splash.gif"/>
        <offline-allowed/>
    </information>
    <security>
      <all-permissions/>
    </security>
    <resources>
        <j2se version="1.4+"/> 
        <jar href="JMediaDemo.jar" main="true" download="eager"/>  
        <jar href="mp3plugin.jar" download="eager"/>     
    </resources>
    <resources os="Windows" arch="x86">
      <nativelib href="jmf_native_windows.jar"/>
      <jar href="sun_jmf_generic.jar" download="eager"/>
    </resources>
    <resources os="SunOS" arch="sparc">
      <nativelib href="jmf_native_solaris.jar"/>
      <jar href="sun_jmf_generic.jar" download="eager"/>   
    </resources>
    <resources os="Linux">
      <nativelib href="jmf_native_linux.jar"/>
      <jar href="sun_jmf_generic.jar" download="eager"/>   
    </resources>
    <application-desc main-class="org.jmfapi.JMediaDemo"> 
      <argument>jmf</argument>
      <argument>native</argument>
      <argument>sun_mp3_plugin</argument>
      <argument>oggvorbis</argument> 
      <argument>webstart</argument> 
    </application-desc>
    </jnlp>

Maybe you are looking for