Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 15 of 15

Thread: Java web app, Saving to desktop?

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Exclamation Java web app, Saving to desktop?

    http://javaprogrammers.webs.com/
    I cannot get the error because it is no longer loading for me, this is simply a testing site that i've made not a real site.

    I'm getting a error about a destination of some sort.

    import java.awt.FlowLayout;
    import java.awt.event.*;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
     
    import java.io.*;
     
     
    public class MainClass extends JFrame {
     
     
    		private JButton saveButton;
    		private JTextField fileName;
    		private JLabel fileName2;
    		private JTextField text;
    		private JLabel text2;
    		private JTextField title;
    		private JLabel title2;
    		private JTextField number;
    		private JLabel number2;
     
     
    		public MainClass(){
     
    			super("MB Creator");
    			setLayout( new FlowLayout());
     
     
    			fileName2 = new JLabel("Filename: ");
    			add(fileName2);
     
    			fileName = new JTextField("",10);
    			add(fileName);
     
    			text2 = new JLabel("   Text: ");
    			add(text2);
     
    			text = new JTextField ("",10);
    			add(text);
     
    			number2 = new JLabel("   Number: ");
    			add(number2);
     
    			number = new JTextField("",10);
    			add(number);
     
    			title2 = new JLabel("   Title: ");
    			add(title2);
     
    			title = new JTextField("", 10);
    			add(title);
     
    			saveButton = new JButton("    Create    ");
    			add( saveButton );
    			saveButton.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent event) {
     
    					           try {
    						               FileWriter outFile = new FileWriter(fileName.getText()+ ".vbs");
    						              PrintWriter out = new PrintWriter(outFile);
    						              out.write("msgbox(\""+text.getText()+"\"),"+number.getText()+",(\""+title.getText()+"\")");
    						             out.close();
    						          } catch (IOException e){
    						              e.printStackTrace();
    						          }
     
    											}
    										}
    									)
    								;
    							}
    						;
    					{
    				}
    			{
    		;
    	}
    }


    The javaScript I'm Using
    <HTML>
    <HEAD>
    <TITLE>MessageBox_Creator</TITLE>
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    </HEAD>
     
    <BODY>
     
    <applet name="MessageBox_Creator" width="170" height="300" archive="MessageBoxCreator.jar" code="MessageBoxCreator.class">
    <param name="java_arguments" value="-Xmx1024m">
    </applet>
     
    </BODY>
    </HTML>



    Can someone tell me what I'm doing wrong?
    the code has no errors runs perfect on a Desktop.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    I'm getting a error about a destination of some sort.
    What is the error?

    What is the relationship between the java code you posted and the html you posted?

  3. #3
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    Quote Originally Posted by Norm View Post
    What is the error?

    What is the relationship between the java code you posted and the html you posted?
    Iposted why i could get the error already.
    I cannot get the error because it is no longer loading for me

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    What is the relationship between the java code you posted and the html you posted?

  5. #5
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    makes the application load on the website?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    Is that a question? Are you saying you don't know if there is any relationship between those two files. I don't see any connection between them.

  7. #7
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    messageboxcreator is uploaded as a jar and its grabbing it from a website..

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    messageboxcreator is uploaded as a jar
    Where is messageboxcreator? I see something similiar: code="MessageBoxCreator.class" but it is spelled differently. Names are case sensitive, so those two are different names.

    How is the code you posted related to the jar file?

    I don't understand your problem yet.

  9. #9
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    <applet name="MessageBox_Creator" width="170" height="300" archive="MessageBoxCreator.jar" code="MessageBoxCreator.class">

    your missing the point, this applcation saves a vbs script to your desktop if ran on your computer, but on the website it cannot find your desktop?

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    Are you talking about two different, separate programs?
    One an applet in a jar file that is loaded into a browser and does ???
    The other a desktop application that writes a file to your PC's disk

    I don't see how they are related and you seem to want to obfuscate their relationship.

  11. #11
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    i don't know how much clearer i can get.

    trying going to the website that i listed, its the program.

  12. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    how much clearer i can get.
    So far I have learned nothing about your problem.
    trying going to the website
    Sorry, I try not to go to unknown,testing websites if I can help it.

    If you can't show any error messages or describe what the code is supposed to be doing, then I'll leave you for someone else.

    Good luck.

  13. #13
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    Learn to read. I listed the code above, and told you that the error is a directory. Ex: C:/doucments and settings/whatever... and its not a 'test website' all it has is the program on it, the rest is blank.

  14. #14
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java web app, Saving to desktop?

    Calm down. I'm sure some one else will be along shortly to help you.

  15. #15
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Java web app, Saving to desktop?

    Java Plug-in 10.2.0.13
    Using JRE version 1.7.0_02-b13 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Owner
    ----------------------------------------------------
    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>
    ----------------------------------------------------

Similar Threads

  1. Creating a Java Desktop Application in NetBeans
    By cslx99 in forum Java Theory & Questions
    Replies: 5
    Last Post: December 2nd, 2012, 01:25 AM
  2. NetBeans Desktop Application in Java
    By knightmetal in forum Java IDEs
    Replies: 5
    Last Post: November 9th, 2011, 06:47 AM
  3. Updatable Java Desktop Application
    By Onur in forum Java Theory & Questions
    Replies: 3
    Last Post: September 18th, 2011, 03:15 PM
  4. saving list of data from JSP into java object
    By nrao in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: January 12th, 2011, 11:24 AM
  5. Get dataset from .Net webservice by java desktop client
    By doikhongcodon in forum Member Introductions
    Replies: 1
    Last Post: December 23rd, 2010, 10:12 PM