XMLEncoder runtime problem

I'm trying to use XMLEncode for the first time.
I have a simple class TextPanel which extends JTextPane. It overrides the paint() method and adds a setRotation() and getRotation() method. The few member variables all have get/set methods.
When I apply encoder.writeObject() to an instance of TextPanel I get this message:
java.lang.IllegalAccessException: Class sun.reflect.misc.Trampoline
can not access a member of class TextPanel with modifiers ""
Continuing ...
java.lang.Exception: XMLEncoder: discarding statement XMLEncoder.writeObject(TextPanel);
Continuing ...Can anyone give me any clues regarding what this message means? It seems to be telling me I don't have the necessary get/set methods, but I do.
Thanks for any help.
--gary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

That's what it seems to be saying, but all the methods are public, and all correctly named.
Just to see what would happen, I marked every single variable (there are only three of them) as "transient". It still tells me the same thing even though there are no variables left that need to be serialized.

Similar Messages

  • Have CS5 and after installing yosemite is asking to install Java SE6 Runtime, problem is Java has a ton of version 6 and none for Mac, why hasnt adobe provide the right version download?

    Adobe needs to get their act together, be specific as to what version of Java SE6 Runtime is needed to open CS5  (InDesing, Illustrator, etc.)and if possible offer a direct download, since Oracle has a ton of version of SE6 and none of them for Mac specific platform. This short sight on behalf of Adobe and carelessness on behalf of apple is the kind of garbage, this companies will never get!

    I'm pretty sure this post has the link in it...
    Dreamweaver and Java SE 6 Runtime problem on MAC Mountain Lion OSX
    If not, do a search of the DW forum for Java SE 6, there has been a lot of discussion about it and the download link for it is floating around here somewhere.

  • Mix of different runtime problems on a mac.

    Hi,
    I'm on a mac 10.3 and have no intentions of upgrading. When I try to start some demo's I get a lot of different errors, all as far as I can tell related to the JRE. I installed everything from the apple website:
    Java webstart 2.3.0 (modified the May 2007)
    Applet Launcher 1.4 (modified the May 2007)
    Here's 2 of them: I give the info I get from the console:
    1. An error occurred while launching/running the application.
    Title: jME (v0.11) Test [curve.TestBezierCurve]
    Vendor: jMonkeyEngine, LLC
    Category: Invalid Argument error
    The application has requested a version of the Java 2 platform (JRE) that is currently not locally installed. Java Web Start was unable to automatically download and install the requested version. The JRE version must be installed manually.
    launch file
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+"
    codebase="http://www.jmonkeyengine.com/webstart/"
    href="jmedemo.php/curve.TestBezierCurve">
    <information>
    <title>jME (v0.11) Test [curve.TestBezierCurve]</title>
    <vendor>jMonkeyEngine, LLC</vendor>
    <homepage href="http://www.jMonkeyEngine.com"/>
    <icon href="jme_logo.jpg"/>
    <description>jME (0.11) JNLP Test - curve.TestBezierCurve</description>
    <description kind="short">jME Technology Preview</description>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="jmetest.jar" main="true"/>
    <jar href="jmetest-data.jar"/>
    <extension name="jme" href="http://www.jmonkeyengine.com/webstart/jme.jnlp" />
    </resources>
    <property key="java.library.path" value="." />
    <application-desc main-class="jmetest.curve.TestBezierCurve"/>
    </jnlp>
    exception
    JNLPException[category: Invalid Argument error : Exception: null : LaunchDesc: null ]
         at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:259)
         at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
         at com.sun.javaws.Launcher.run(Launcher.java:167)
         at java.lang.Thread.run(Thread.java:552)
    console
    Java Web Start 1.4.2_12 Console, started Thu May 03 10:23:16 NZST 2007
    Java 2 Runtime Environment: Version 1.4.2_12 by Apple Computer, Inc.
    Example 2:
    An error occurred while launching/running the application.
    Title: Tower Of Hanoi
    Vendor: J�rgen Failenschmid
    Category: Launch File Error
    Unsupported JNLP version in launch file: 1.5+. Only version 1.0 is supported with this version. Please contact the application vendor to report this problem.
    launch file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Tower Of Hanoi Webstart Configuration -->
    <jnlp spec="1.5+"
    codebase="http://projects.anycpu.com/toh/"
    href="toh.jnlp">
    <information>
    <title>Tower Of Hanoi</title>
    <vendor>J�rgen Failenschmid</vendor>
    <homepage href="http://www.anycpu.com/Java3DExample.htm"/>
    <description>Tower Of Hanoi</description>
    <description kind="short">Animated implementation of the Tower Of Hanoi puzzle using Java 3D.</description>
    <description kind="tooltip">Tower Of Hanoi</description>
    <!-- Gif or Jpeg: 64x64 during download; 32x32 as icon. Automatically resized. -->
    <icon href="icon.gif"/>
    <!-- Splash screen during launch -->
    <icon kind="splash" href="splash.jpg"/>
    <offline-allowed/>
    <shortcut online="false">
    <desktop/>
    <menu submenu="Anycpu"/>
    </shortcut>
    </information>
    <!--
    Java 3D will not run with minimum security.
    Therefore, the application JARs have to be signed.
    -->
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="toh.jar" main="true"/>
    <jar href="jars/commons-logging.jar"/>
    <jar href="jars/log4j.jar"/>
    <extension href="http://download.java.net/media/java3d/webstart/release/java3d-latest.jnlp"/>
    </resources>
    <application-desc main-class="net.pacbell.jfai.toh.util.Launcher">
         <argument>net.pacbell.jfai.toh.TowerOfHanoi</argument>
         <argument>splash.jpg</argument>
    </application-desc>
    </jnlp>
    exception
    JNLPException[category: Launch File Error : Exception: null : LaunchDesc:
    <jnlp spec="1.5+" codebase="http://projects.anycpu.com/toh/" href="http://projects.anycpu.com/toh/toh.jnlp">
      <information>
        <title>Tower Of Hanoi</title>
        <vendor>J�rgen Failenschmid</vendor>
        <homepage href="http://www.anycpu.com/Java3DExample.htm"/>
        <description>Tower Of Hanoi</description>
        <description kind="short">Animated implementation of the Tower Of Hanoi puzzle using Java 3D.</description>
        <description kind="one-line">Tower Of Hanoi</description>
        <description kind="tooltip">Tower Of Hanoi</description>
        <icon href="http://projects.anycpu.com/toh/icon.gif" kind="default"/>
        <icon href="http://projects.anycpu.com/toh/splash.jpg" kind="splash"/>
        <offline-allowed/>
      </information>
      <security>
        <all-permissions/>
      </security>
      <resources>
        <j2se initial-heap-size="-1" max-heap-size="-1" version="1.5+"/>
        <jar href="http://projects.anycpu.com/toh/toh.jar" download="eager" main="true"/>
        <jar href="http://projects.anycpu.com/toh/jars/commons-logging.jar" download="eager" main="false"/>
        <jar href="http://projects.anycpu.com/toh/jars/log4j.jar" download="eager" main="false"/>
        <extension href="http://download.java.net/media/java3d/webstart/release/java3d-latest.jnlp"/>
      </resources>
      <application-desc main-class="net.pacbell.jfai.toh.util.Launcher">
        <argument>net.pacbell.jfai.toh.TowerOfHanoi</argument>
        <argument>splash.jpg</argument>
      </application-desc>
    </jnlp> ]
         at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:179)
         at com.sun.javaws.Launcher.run(Launcher.java:167)
         at java.lang.Thread.run(Thread.java:552)
    console
    Java Web Start 1.4.2_12 Console, started Thu May 03 10:17:25 NZST 2007
    Java 2 Runtime Environment: Version 1.4.2_12 by Apple Computer, Inc.
    Help greatly appreciated.

    You should contact Apple for this issue.

  • Dreamweaver and Java SE 6 Runtime problem on MAC Mountain Lion OSX

    I have a problem with dreamweaver. I really love dreamweaver for building web pages and have used it for years with a PC.  I recently switched from a PC to a MAC but I find that when I open the Dreamweaver app for the first time I get a prompt that says something like "You must download Java SE 6 runtime, would you like to install it now?"   I click yes, and the download fails.  I called Apple about it, they said the software resides on Oracle's Java web site, and its out of their control.  I go to the Oracle Java web site it says "Apple supplies their version of Java SE 6 runtime and there's no way to download it from the Java.com site.  All this means is that YOUR software does not work on my MAC because these two companies can't agree on who suppies this software.
    What I need to know is HOW DO I GET DREAMWEAVER TO WORK?  How do I get around this crazy *** catch 22 situation?  And why doesn't your software recognize Java SE 7 runtime?

    I'm in the same boat with you. I recently used Time Machine to backup my profile and then wiped my entire drive and installed Mountain Lion. After importing all of my data with the Migration Assitant, Dreamweaver will NOT open.
    SnakEyez02, Oracle's website does NOT have the dowload. The link you posted is to version 7. We've been down this road already. Martiantime is correct, neither Apple nor Oracle are providing Java SE 6, but Dreamweaver is crying to have it installed.
    So, Adobe, how do we get out of the hole that we did not dig?

  • Facing some runtime problem in new AIR 2.0Beta2 SDK and same application work in OLD AIR 2.0Beta1 SD

    Severity:
    Runtime Error
    Reproducibility:
    Every Time
    Discoverability:
    High
    Found in Version:
    SDK Flex 3 (Released)
    Affected OS(s):
    Windows              - XP
    Steps to Reproduce:
    « Hide
      Steps to reproduce:
    1. Run the Application 
    2. At the creation complete I am referring "StorageVolumeInfo" i.e. StorageVolumeInfo.storageVolumeInfo.addEventListener(StorageVolumeChangeEvent.STORAGE_VOL UME_MOUNT, onVolumeMount);
    3.
      Actual Results:
      I am getting runtime ERROR as below:
    VerifyError: Error #1014: Class flash.filesystem::StorageVolume could not be found.
    at _FreepandasV2WatcherSetupUtil$/init()
    at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\autobuild\3.4.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3213]
    at mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.4.0\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:3065]
      Expected Results:
       I am using ADOBE AIR 2.0Beta2 version SDK.
    The same application is run in Last SDK i.e AIR 2.0Beta1
      Workaround (if any):
      I am using ADOBE AIR 2.0Beta2 version.
    Can you please help me out...
    Thank you

    My settings with air 3.3:
    <renderMode>gpu</renderMode>
    <aspectRatio>portrait</aspectRatio>
              <autoOrients>false</autoOrients>
            <fullScreen>true</fullScreen>
            <visible>true</visible>
            <softKeyboardBehavior>none</softKeyboardBehavior>
        </initialWindow>
    It only displays a white screen with a small gray square (1/5 of the screen size - top left).
    A scrollbar is visible if you drag the screen and the sound is playing...
    I tried this settings:
    <aspectRatio>portrait</aspectRatio>
            <renderMode>gpu</renderMode>
              <autoOrients>true</autoOrients>
            <fullScreen>true</fullScreen>
            <visible>true</visible>
            <softKeyboardBehavior>none</softKeyboardBehavior>
        </initialWindow>
    It won't work...
    Edit:
    I also tested the new sdk http://www.adobe.com/products/air/sdk/ with gpu mode.
    iPhone works fine but the iPad version always crashes.
    The app opened up but if I try to load a level created with box2d the app always closes (crashs).
    I think that is a gpu ram issue?
    Is this a iPad issue or air?
    Edit 2:
    I changed the creationcomplete event to viewactivate. The transition now looks really worse but the levels are loading.
    I also deleted all the elements before changing the view (removeElement and removeChild).
    The third step I made was to use weak eventListener obj.addEventListener("event, function, false,0,true);
    I think that iOS systems have the problem of less gpu ram than android devices ...

  • XMLEncoder stackoverflow problem with custom classloader

    Hi, All
    I'm tring encoding my object using XMLEncoder, the objects are from the custom classloader like URLClassLoader which is importing several jar files at run-time.
    source code is like this:
    XMLEncoder e = new XMLEncoder(new BufferedOutputStream(os));
    e.writeObject( sourceObj);
    When I run it, I experienced this error:
    XMLEncoder has "ClassNotFoundException" or "InstantiationException" problem.
    so I found very similar posting for this problem and modified it so that the XMLEncoder can find my classes from custom classloader:
    ClassLoader cl = this.getClass().getClassLoader();
    URLClassLoader urlClassLoader = new URLClassLoader(urls, cl);
    Thread.currentThread().setContextClassLoader(urlClassLoader);
    XMLEncoder e = new XMLEncoder(new BufferedOutputStream(os));
    e.writeObject( sourceObj);
    The result was slightly changed. However, still disappointing:
    java.lang.StackOverflowError
         at java.lang.Class.getMethod0(Class.java:1734)
         at java.lang.Class.getMethod(Class.java:951)
         at java.beans.Statement.findPublicMethod(Statement.java:230)
         at java.beans.Statement.findMethod(Statement.java:270)
         at java.beans.Statement.getMethod(Statement.java:366)
         at java.beans.Statement.invoke(Statement.java:439)
         at java.beans.Expression.getValue(Expression.java:101)
         at java.beans.Encoder.getValue(Encoder.java:84)
         at java.beans.Encoder.get(Encoder.java:186)
         at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:97)
         at java.beans.Encoder.writeObject(Encoder.java:55)
         at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
         at java.beans.Encoder.writeExpression(Encoder.java:260)
         at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:351)
         at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
         at java.beans.Encoder.writeObject(Encoder.java:55)
         at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
         at java.beans.Encoder.writeExpression(Encoder.java:260)
         at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:351)
         at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
         at java.beans.Encoder.writeObject(Encoder.java:55)
         at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
         at java.beans.Encoder.writeExpression(Encoder.java:260)
         at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:351)
         at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
         at java.beans.Encoder.writeObject(Encoder.java:55)
    When I finally include the jar files into the classpath so that the default classloader can reference them, the encoder worked properly.
    Anyone can help me?

    StackOverFlow is quite a gotcha in XMLEncoder it is often because of the following code in java.beans.PersistenceDelegate:
    public void writeObject(Object oldInstance, Encoder out) {
    Object newInstance = out.get(oldInstance);
    if (!mutatesTo(oldInstance, newInstance)) {
    out.remove(oldInstance);
    out.writeExpression(instantiate(oldInstance, out));
    else {
    initialize(oldInstance.getClass(), oldInstance, newInstance, out);
    and the following code in java.beans.DefaultPersistenceDelegate:
    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
    // Assume the instance is either mutable or a singleton
    // if it has a nullary constructor.
    return (constructor.length == 0) || !definesEquals(oldInstance) ?
    super.mutatesTo(oldInstance, newInstance) :
    oldInstance.equals(newInstance);
    What this means is if you have a class (you want to persist) that has a constructor that takes arguments AND defines an equals method AND you have overridden initialize in DefaultPersistenceDelegate to do some extra work after it instantiates newInstance, then while the PersistenceDelegate is trying to generate you newInstance, oldInstance.equals(newInstance) will return false, and PersistenceDelegate will keep trying to instantiate a newInstance that does equal the oldInstance.
    So if you do use DefaultPersistenceDelegate then ensure that you override mutatesTo so that it is:
    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
    return (newInstance != null && oldInstance.getClass() == newInstance.getClass());
    Here is an example PersistenceDelegate that persistence a class called PersistentBeanCollection, it calls its constructor with the property "type" and then calls the method add() on the newInstance.
    new DefaultPersistenceDelegate(new String[]{"type"}) {
    protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) {
    PersistentBeanCollection oldBeanCollection = (PersistentBeanCollection) oldInstance;
    for (Iterator iterator = oldBeanCollection.iterator(); iterator.hasNext();) {
    out.writeStatement(new Statement(oldInstance, "add", new Object[]{iterator.next()}));
    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
    return (newInstance != null && oldInstance.getClass() == newInstance.getClass());
    Cheers
    Parwy

  • Possible Java Runtime problem

    I am an amatuer at best.
    I am receiving an error when trying to access any part of windows explorer now. I can't open folders at all.
    Included in picture format is the error.
    I'm running XP Home edition service pack 2
    more than enough ram/HD
    I recently un-installed AND re-installed java (from java.com). When java isn't installed - windows explorer works just fine.
    This problem is recent (last week or so) To my knowledge ZERO applications are been installed or modified. This computer is solely used for archiving pictures/video and web surfing (with the occasional video playback via VLC media player.
    Please let me know if you have any suggestions on how to combat this problem without having to re-install windows.
    If you need more information: please ask.
    Java is: 1.6.0_01
    http://img.photobucket.com/albums/v245/all2e_z/errormessage.jpg

    Hai create a batch file mode.bat
    in mode.bat write the code like dir > out.txt
    try {
                                  String line;
                                  Process p = Runtime.getRuntime().exec("mode.bat");
                                  BufferedReader input =  new BufferedReader(new InputStreamReader(p.getInputStream()));
                                  while ((line = input.readLine()) != null) {
                                  input.close();
                                catch (Exception err) {
                                }or if you need the in formation sbout the directory use the following code:
    import java.io.File;
    import java.io.IOException;
    public class FileUtil {
      public static void main(String[] a)throws IOException{
        showDir(1, new File("d:\\"));
      static void showDir(int indent, File file) throws IOException {
    File f=new     File("d:\\out.txt");
    FileWriter fw=new FileWrite(f);
    for (int i = 0; i < indent; i++)
          fw.write('-');
        fw.write(file.getName());
        if (file.isDirectory()) {
          File[] files = file.listFiles();
          for (int i = 0; i < files.length; i++)
            showDir(indent + 4, files);
    regards,
    Naga Raju

  • Execute an external java program with Runtime, problem with classpath

    Hi,
    I m calling an external java program by the command:
    Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
    "java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
    Could anyone give some pointers please?
    Many thanks!
    Edited by: 836590 on 14-Feb-2011 09:03

    836590 wrote:
    Hi,
    I m calling an external java program by the command:
    Runtime.getRuntime().exec("java -classpath \"library/*\" org.mypackage.TestMainProgram param1 c:/input/files c:/output/files");All my classes are stored in the relative directory "library", and it contains ONLY .jar files. However, I keep getting errors like:
    "java.lang.NoClassDefFoundError: library/antlr/jarCaused by: java.lang.ClassNotFoundException: library.antlr.jar     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)Could not find the main class: library/antlr.jar. Program will exit.Exception in thread "main" where "antlr.jar" is a jar file in "library". It is there but still the program keeps complaining it cannot be found. The problem applies to any jars in "library", ie.., if i have "mylib.jar" then it will complain "NoClassDefFoundError: library/mylib/jar".
    Could anyone give some pointers please?
    Many thanks!
    Edited by: 836590 on 14-Feb-2011 09:03First, if you run from the command line
    java -classpath "library/*" org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesfrom the parent directory of library, does it work?
    Despite what I said to Kayaman about Runtime.exec not expanding the asterisk, it looks like that's what's happening, so that you're getting
    java -claspath library/aaaa_something_before_antlr.jar library/antlr.jar library/bbb.jar library/ccc.jar  org.mypackage.TestMainProgram param1 c:/input/files c:/output/filesThat is, it *is* expanding the asterisk to a list of files in the directory, and the first one is being taken as the classpath, and the second one--library/antlr.jar is being taken as the class to execute. I'm certain this doesn't happen on Linux, so it must be a Windows thing.
    Two suggestions:
    1) Try single quotes instead of double.
    2) Try the exec that takes an array
    Runtime.getRuntime().exec(new String[] {"java", "-classpath", "'library/*'", "org.mypackage.TestMainProgram", "param1", "c:/input/files", "c:/output/files");Edited by: jverd on Feb 14, 2011 9:41 AM

  • Runtime problem in custom program

    I have created a program awhile back that calculates the sales tax and total price for a product. I successfully compiled and ran the terminal version, but due to some problems, I decided to make a GI version. However, I'm having problems. After what felt like many trials and error, I finally got it to compile and show the window but after typing in the info to test my program, the dialog box will not show up with the results. here is the code I put into the program.
    import javax.swing.*;
    import java.text.*;
    import java.awt.*;
    import java.lang.*;
    import java.awt.event.*;
    class SwingWindow extends JFrame
              JLabel messageLabel;
              JLabel messageLabel2;
              JTextField num1;
              JTextField num2;
              JButton calcButton;
              JPanel panel;
         public SwingWindow()
              super("Sales Tax calculator");
              setSize(400, 150);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              messageLabel = new JLabel("Enter your sales tax rate:");
              num1 = new JTextField(10);
              messageLabel2 = new JLabel("Enter the listed price of the product:");
              num2 = new JTextField(10);
              calcButton = new JButton("Calculate");
              calcButton.addActionListener(new CalcButtonListener());
              panel = new JPanel();
              panel.add(messageLabel);
              panel.add(num1);
              panel.add(messageLabel2);
              panel.add(num2);
              panel.add(calcButton);
              setVisible(true);
              Container contentArea = getContentPane();
              contentArea.setBackground(Color.white);
              contentArea.add(panel);
              setContentPane(contentArea);
         private class CalcButtonListener implements ActionListener
              public void actionPerformed(ActionEvent e)
                   NumberFormat cf = NumberFormat.getCurrencyInstance();
                   String str1;
                   String str2;
                   float rate;
                   float total;
                   str1 = num1.getText();
                   str2 = num2.getText();
                   rate = Float.parseFloat(str1) * Float.parseFloat(str2);
                   total = rate + Float.parseFloat(str2);
                   JOptionPane.showMessageDialog(null, cf.format(str2) + "is the listed price and" + str1 + "is your sales tax rate and" + cf.format(rate) + "is the sales tax for the product and" + cf.format(total) + "is the overall cost for the product.");
    public class Salestax
         public static void main(String[] args)
              SwingWindow Salestax = new SwingWindow();
    }What can I do or need to do to make that dialog box appear when the Calculate button is clicked? I looked at a tutorial on frames from Sun, but I had troubles compiling afterwards. I'm using Java version 6, if that helps any.
    Edited by: gotenks05 on Sep 18, 2008 11:54 AM

    Hello, I'm the one who posted this thread this is just a different name because I could not figure out how to get back under the name I posted as. I know that when compiling being syntax error free does not guarantee an error free runtime, but nobody can run a program if it is not or cannot be compiled. This is why I need help. I want the dialog box to appear and the code to be syntax error free. When I ran the program from terminal, I got the following:
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Cannot format given Object as a Number     at java.text.DecimalFormat.format(DecimalFormat.java:487)
         at java.text.Format.format(Format.java:140)
         at SwingWindow$CalcButtonListener.actionPerformed(Salestax.java:51)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6126)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
         at java.awt.Component.processEvent(Component.java:5891)
         at java.awt.Container.processEvent(Container.java:2102)
         at java.awt.Component.dispatchEventImpl(Component.java:4497)
         at java.awt.Container.dispatchEventImpl(Container.java:2160)
         at java.awt.Component.dispatchEvent(Component.java:4327)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4366)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4030)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3960)
         at java.awt.Container.dispatchEventImpl(Container.java:2146)
         at java.awt.Window.dispatchEventImpl(Window.java:2440)
         at java.awt.Component.dispatchEvent(Component.java:4327)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:300)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:210)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:200)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:195)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:187)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)>
    I know there is something that needs to be done with the source, but I don't what it is, especially since I did not get this problem when I compiled the text based version.
    update: I got the dialog box to show, but I want the numbers in currency format.
    update 2: I finally got the result I wanted, with a bit of tweaking thanks for the help so far given. I just made another variable to show the number as a float, then used cf.format for currency.
    Edited by: realgotenks05 on Sep 18, 2008 1:55 PM
    Edited by: realgotenks05 on Sep 18, 2008 2:10 PM

  • Runtime problem , please help,

    public class execInput {
    public static void main(String Argv[]) {
    try {
    String output;
    String[] cmd ={"c:\\xpdf\\pdftotext.exe", "c:\\pdfFile\\dispatching.pdf"};
    Process pr = Runtime.getRuntime().exec(cmd);
    }catch (IOException e) {
    System.exit(0);
    Above program is run in Ms-DOS : c�F\xpdf\pdftotext.exe
    no problem. But I ran it in Java, compiles is fine.
    when I run it. it let me press any key to continue.
    and a GUI apper to tell me an error:
    16bit MS-DOS subsystem
    C�F\WINDOWS\system32\ntvdm.exe
    Error while setting up environment for the application
    choose "close" to terminate the application.
    Please help me solve it, I hava tried on different machine and I re-install the WinXP system, but the problem still appears,
    many many Thanks!

    Cross posted. All posts:
    http://forum.java.sun.com/thread.jspa?threadID=664225&messageID=3890448#3890448
    http://forum.java.sun.com/thread.jspa?threadID=664226&messageID=3890449#3890449
    http://forum.java.sun.com/thread.jspa?threadID=664227&messageID=3890450#3890450
    http://forum.java.sun.com/thread.jspa?threadID=664228&messageID=3890452#3890452
    http://forum.java.sun.com/thread.jspa?threadID=664229&messageID=3890453#3890453

  • Java runtime problem Internet Sales

    I am getting a runtime error in the SAP Internet Sales Shop Management tool when I try to create a new shop. I am quite sure my problem is java related because the SAP generated webform fails too fast. There doesn't seem to be any time for abap processing.
    Has anyone experienced this before. How can I find out where the problem is?
    Thanks very much,

    Hi Pankaj,
    you can try with the first patch of the SP 9 - for example try the file ISAWAC40SP09_0-10002109.SAR. Extract the file using the sapcar program and search for docs.sar file where the documents are.
    I hope this will help you.
    Regards
    Borislav

  • Serialization using XMLEncoder/XMLDecoder - problems for SpringLayout

    I am using JDK 1.4.0 (obviously, as I have problems with XMLEncoder... :o)
    What I need to do is create a JFrame with some Swing components inside (JPanel's, JLabel's, etc.), to save it as an XML file and be able to restore it later.
    Everything went OK at the beginning, but there came the time to manage the layout part. For various reasons, the most appropriate layout manager for my application is SpringLayout.
    The first step was again OK: when defining a SpringLayout for a panel, this property was transferred to the XML by XMLEncoder and restored by XMLDecoder.
    But then, the happy days are over! In order for a SpringLayout to work, one must obviously define lots of SpringLayout.Constraints, using Spring's. But none of these things are transferred by XMLEncoder to the XML.
    And, quite naturally, even if I modify manually the XML to include some constraint info, the XMLDecoder won't read that info!
    Does anybody know if there is any trick about this? Or is there a known bug concerning the serialization of Spring's, and you know about a workaround?
    Thanks a lot,
    Adrian

    Hi Adrian, there are no persistence delegates defined for SpringLayout and its children.
    I spent quite some time over the last six months trying to get SpringLayouts to save
    correctly - but failed. There are two bugs in the way - both of which should be fixed for
    1.4.1 (I think). One was in SpringLayout - the other in XMLEncoder itself:
    http://developer.java.sun.com/developer/bugParade/bugs/4679556.html
    One thing you said in your note that I thought Id comment on. You can edit the XML file manually
    and this will (probably) lead to a solution. The XMLDecoder is an interpreter - it doesn't need access
    to persistence delegates or require any knowledge of the swing APIs to work.
    Hope that helps.
    Philip

  • Runtime problems on Linux Ubuntu 7.04

    Here is the error code I get. I am new to Linux, so bear with me please,
    root@circuit-circus:/home/sidewalkcynic/.opera/cache4/Compendium# ./compendium.sh
    Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.70)
    at java.awt.Window.<init>(libgcj.so.70)
    at java.awt.Frame.<init>(libgcj.so.70)
    at java.awt.Frame.<init>(libgcj.so.70)
    at javax.swing.SwingUtilities$OwnerFrame.<init>(libgcj.so.70)
    at javax.swing.SwingUtilities.getOwnerFrame(libgcj.so.70)
    at javax.swing.JDialog.<init>(libgcj.so.70)
    at javax.swing.JDialog.<init>(libgcj.so.70)
    at com.compendium.ui.dialogs.UIStartUp.<init>(UIStartUp.java:51)
    at com.compendium.ProjectCompendium.main(ProjectCompendium.java:69)
    Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory
    at java.lang.Runtime._load(libgcj.so.70)
    at java.lang.Runtime.loadLibrary(libgcj.so.70)
    at java.lang.System.loadLibrary(libgcj.so.70)
    at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(libgcj.so.70)
    at java.lang.Class.initializeClass(libgcj.so.70)
    at java.lang.Class.forName(libgcj.so.70)
    at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
    ...10 more
    root@circuit-circus:/home/sidewalkcynic/.opera/cache4/Compendium#
    What do I do?

    Hi,
    have had this problem myself...although model=basic DOES get the internal speakers working, the headphones jack then fails..(or at least it did for me ;))
    im using the ALC262 codec (which can be determined from the output of cat /proc/asound/card0/codec#* ), and i found that
    options snd-hda-intel model=hippo worked best for me... (ie both internal speaker and headphone jack working)
    if in doubt...more info can be found in the alsa drivers ALSA-Configuration.txt
    HTH
    damian

  • Runtime problems after migrating from Flex3 to 4 in compatibility mode

    We are migrating our Flex-3.2 application to Flex 4.1, mainly to take advantage of the new text flow/engine features. In a first step we decided to go with compiling for MX-only and in Flex-3-compatibility mode.
    Thanks to some helpful resources (
    http://www.adobe.com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html
    http://stackoverflow.com/questions/1563482/any-flex-4-migration-experience
    http://www.adobe.com/devnet/flex/articles/flex3and4_differences_02.html
    ) I am able to compile our application.
    But I find myself surprised about the amount of runtime differences ranging from the problem that I cannot cast ResultEvent.currentTarget to HTTPService ( which apparently was introduced in 3.5 ) to many layout problems to differences in event dispatching ( e.g. one of our legacy components listens to the add event which it just doesn't seem to get anymore ).
    It seems there is very little documentation on this. I'd like to find a list with detailed changes so that we don't have to rely on QA to stumble across hopefully all issues.
    This documents lists some, but doesn't seem exhaustive.
    Does someone have a better list of documented changes from SDK 3.2 to 4.1?
    Thanks
    Stefan
    PS. Concrete example of one surprising change:
    In Flex 4:
        <?xml version="1.0" encoding="utf-8"?>
        <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" minWidth="955" minHeight="600">
        <fx:Script>
        <![CDATA[
        private function notFired():void
        trace("ADDED");
        private function fired():void
        trace("COMPLETE");
        ]]>
        </fx:Script>
        <mx:TextArea add="notFired();" creationComplete="fired();"/>
        </mx:Application>
    Now do the same in Flex 3 and you'll see both events fire.

    The add event is a bug.

  • Adobe Bridge is really bogging down and PS CS5 will not open at all (runtime problem), ideas

    Also many thanks to Adobe for not supporting their software.

    It is possible that your security software (firewall, anti-virus) blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full, unrestricted, access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    *https://support.mozilla.org/kb/fix-problems-connecting-websites-after-updating

Maybe you are looking for