<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FDevelopment%2FJNLP</id>
		<title>Java Tutorial/Development/JNLP - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FDevelopment%2FJNLP"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Development/JNLP&amp;action=history"/>
		<updated>2026-04-22T00:06:18Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Development/JNLP&amp;diff=3678&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Development/JNLP&amp;diff=3678&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 17:44, 31 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Development/JNLP&amp;diff=3679&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Development/JNLP&amp;diff=3679&amp;oldid=prev"/>
				<updated>2010-05-31T15:28:50Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  An Example JNLP File ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 @(#)webpad.jnlp        1.3 02/07/29&lt;br /&gt;
 &lt;br /&gt;
 Copyright (c) 2002 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 &lt;br /&gt;
 Redistribution and use in source and binary forms, with or without&lt;br /&gt;
 modification, are permitted provided that the following conditions are met:&lt;br /&gt;
 &lt;br /&gt;
 -Redistribution of source code must retain the above copyright notice, this&lt;br /&gt;
  list of conditions and the following disclaimer.&lt;br /&gt;
 &lt;br /&gt;
 -Redistribution in binary form must reproduce the above copyright notice, &lt;br /&gt;
  this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
  and/or other materials provided with the distribution.&lt;br /&gt;
 &lt;br /&gt;
 Neither the name of Sun Microsystems, Inc. or the names of contributors may &lt;br /&gt;
 be used to endorse or promote products derived from this software without &lt;br /&gt;
 specific prior written permission.&lt;br /&gt;
 &lt;br /&gt;
 This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL &lt;br /&gt;
 EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING&lt;br /&gt;
 ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE&lt;br /&gt;
 OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. (&amp;quot;SUN&amp;quot;)&lt;br /&gt;
 AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE&lt;br /&gt;
 AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS&lt;br /&gt;
 DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST &lt;br /&gt;
 REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, &lt;br /&gt;
 INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY &lt;br /&gt;
 OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, &lt;br /&gt;
 EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 &lt;br /&gt;
 You acknowledge that this software is not designed, licensed or intended&lt;br /&gt;
 for use in the design, construction, operation or maintenance of any&lt;br /&gt;
 nuclear facility.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;jnlp spec=&amp;quot;1.0&amp;quot; codebase=&amp;quot;http://localhost/jws&amp;quot; href=&amp;quot;Notepad.jnlp&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;information&amp;gt;&lt;br /&gt;
      &amp;lt;title&amp;gt;Notepad Demo&amp;lt;/title&amp;gt;&lt;br /&gt;
      &amp;lt;vendor&amp;gt;Sun Microsystems, Inc.&amp;lt;/vendor&amp;gt;&lt;br /&gt;
   &amp;lt;/information&amp;gt;&lt;br /&gt;
   &amp;lt;resources&amp;gt;&lt;br /&gt;
      &amp;lt;property name=&amp;quot;jnlp.publish-url&amp;quot; value=&amp;quot;$$context/publish&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;j2se version=&amp;quot;1.3+&amp;quot; href=&amp;quot;http://java.sun.ru/products/autodl/j2se&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;jar href=&amp;quot;Notepad.jar&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/resources&amp;gt;&lt;br /&gt;
   &amp;lt;application-desc main-class=&amp;quot;Notepad&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/jnlp&amp;gt;&lt;br /&gt;
File: index.html&lt;br /&gt;
&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.0 Transitional//EN&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
&amp;lt;HEAD&amp;gt;&lt;br /&gt;
   &amp;lt;TITLE&amp;gt;Java Web Start Demo&amp;lt;/TTLE&amp;gt;    &lt;br /&gt;
&amp;lt;/HEAD&amp;gt;&lt;br /&gt;
&amp;lt;BODY&amp;gt;&lt;br /&gt;
&amp;lt;H1&amp;gt;Java Web Start Demo&amp;lt;/H1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This link is to the Notepad.jnlp file.&lt;br /&gt;
&amp;lt;/BODY&amp;gt;&lt;br /&gt;
&amp;lt;/HTML&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Uses the JNLP API to open and save files ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 *&lt;br /&gt;
 * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Sun grants you (&amp;quot;Licensee&amp;quot;) a non-exclusive, royalty free, license to use,&lt;br /&gt;
 * modify and redistribute this software in source and binary code form,&lt;br /&gt;
 * provided that i) this copyright notice and license appear on all copies of&lt;br /&gt;
 * the software; and ii) Licensee does not utilize the software in a manner&lt;br /&gt;
 * which is disparaging to Sun.&lt;br /&gt;
 *&lt;br /&gt;
 * This software is provided &amp;quot;AS IS,&amp;quot; without a warranty of any kind. ALL&lt;br /&gt;
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY&lt;br /&gt;
 * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR&lt;br /&gt;
 * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE&lt;br /&gt;
 * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING&lt;br /&gt;
 * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS&lt;br /&gt;
 * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,&lt;br /&gt;
 * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER&lt;br /&gt;
 * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF&lt;br /&gt;
 * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE&lt;br /&gt;
 * POSSIBILITY OF SUCH DAMAGES.&lt;br /&gt;
 *&lt;br /&gt;
 * This software is not designed or intended for use in on-line control of&lt;br /&gt;
 * aircraft, air traffic, aircraft navigation or aircraft communications; or in&lt;br /&gt;
 * the design, construction, operation or maintenance of any nuclear&lt;br /&gt;
 * facility. Licensee represents and warrants that it will not use or&lt;br /&gt;
 * redistribute the Software for such purposes.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.io.*;&lt;br /&gt;
import java.awt.*;&lt;br /&gt;
import java.awt.event.*;&lt;br /&gt;
import javax.swing.*;&lt;br /&gt;
import javax.swing.filechooser.*;&lt;br /&gt;
import javax.jnlp.*;&lt;br /&gt;
public class JWSFileChooserDemo extends JPanel&lt;br /&gt;
                                implements ActionListener {&lt;br /&gt;
    static private final String newline = &amp;quot;\n&amp;quot;;&lt;br /&gt;
    JButton openButton, saveButton;&lt;br /&gt;
    JTextArea log;&lt;br /&gt;
    public JWSFileChooserDemo() {&lt;br /&gt;
        super(new BorderLayout());&lt;br /&gt;
        //Create the log first, because the action listeners&lt;br /&gt;
        //need to refer to it.&lt;br /&gt;
        log = new JTextArea(5,20);&lt;br /&gt;
        log.setMargin(new Insets(5,5,5,5));&lt;br /&gt;
        log.setEditable(false);&lt;br /&gt;
        JScrollPane logScrollPane = new JScrollPane(log);&lt;br /&gt;
        //Create the open button.  We use the image from the JLF&lt;br /&gt;
        //Graphics Repository (but we extracted it from the jar).&lt;br /&gt;
        openButton = new JButton(&amp;quot;Open a File...&amp;quot;, &lt;br /&gt;
                                 createImageIcon(&amp;quot;images/Open16.gif&amp;quot;));&lt;br /&gt;
        openButton.addActionListener(this);&lt;br /&gt;
        //Create the save button.  We use the image from the JLF&lt;br /&gt;
        //Graphics Repository (but we extracted it from the jar).&lt;br /&gt;
        saveButton = new JButton(&amp;quot;Save a File...&amp;quot;,&lt;br /&gt;
                                 createImageIcon(&amp;quot;images/Save16.gif&amp;quot;));&lt;br /&gt;
        //PENDING: removed the Save button action listener&lt;br /&gt;
        //so that people won&amp;quot;t overwrite existing files.&lt;br /&gt;
        //See bug 4761577.&lt;br /&gt;
        //saveButton.addActionListener(this); &lt;br /&gt;
        saveButton.setEnabled(false);&lt;br /&gt;
        //For layout purposes, put the buttons in a separate panel&lt;br /&gt;
        JPanel buttonPanel = new JPanel();&lt;br /&gt;
        buttonPanel.add(openButton);&lt;br /&gt;
        buttonPanel.add(saveButton);&lt;br /&gt;
        //Add the buttons and the log to this panel.&lt;br /&gt;
        add(buttonPanel, BorderLayout.PAGE_START);&lt;br /&gt;
        add(logScrollPane, BorderLayout.CENTER);&lt;br /&gt;
    }&lt;br /&gt;
    public void actionPerformed(ActionEvent e) {&lt;br /&gt;
        //Handle open button action.&lt;br /&gt;
        if (e.getSource() == openButton) {&lt;br /&gt;
            FileOpenService fos = null;&lt;br /&gt;
            FileContents fileContents = null;&lt;br /&gt;
            try {&lt;br /&gt;
                fos = (FileOpenService)ServiceManager.&lt;br /&gt;
                          lookup(&amp;quot;javax.jnlp.FileOpenService&amp;quot;); &lt;br /&gt;
            } catch (UnavailableServiceException exc) { }&lt;br /&gt;
            if (fos != null) {&lt;br /&gt;
                try {&lt;br /&gt;
                    fileContents = fos.openFileDialog(null, null); &lt;br /&gt;
                } catch (Exception exc) {&lt;br /&gt;
                    log.append(&amp;quot;Open command failed: &amp;quot;&lt;br /&gt;
                               + exc.getLocalizedMessage()&lt;br /&gt;
                               + newline);&lt;br /&gt;
                    log.setCaretPosition(log.getDocument().getLength());&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            if (fileContents != null) {&lt;br /&gt;
                try {&lt;br /&gt;
                    //This is where a real application would do something&lt;br /&gt;
                    //with the file.&lt;br /&gt;
                    log.append(&amp;quot;Opened file: &amp;quot; + fileContents.getName()&lt;br /&gt;
                               + &amp;quot;.&amp;quot; + newline);&lt;br /&gt;
                } catch (IOException exc) {&lt;br /&gt;
                    log.append(&amp;quot;Problem opening file: &amp;quot;&lt;br /&gt;
                               + exc.getLocalizedMessage()&lt;br /&gt;
                               + newline);&lt;br /&gt;
                }&lt;br /&gt;
            } else {&lt;br /&gt;
                log.append(&amp;quot;User canceled open request.&amp;quot; + newline);&lt;br /&gt;
            }&lt;br /&gt;
            log.setCaretPosition(log.getDocument().getLength());&lt;br /&gt;
        }&lt;br /&gt;
        //Handle save button action.&lt;br /&gt;
        if (e.getSource() == saveButton) {&lt;br /&gt;
            FileSaveService fss = null;&lt;br /&gt;
            FileContents fileContents = null;&lt;br /&gt;
            ByteArrayInputStream is = new ByteArrayInputStream(&lt;br /&gt;
                    (new String(&amp;quot;Saved by JWSFileChooserDemo&amp;quot;).getBytes()));&lt;br /&gt;
                                             //XXX YIKES! If they select an&lt;br /&gt;
                                             //XXX existing file, this will&lt;br /&gt;
                                             //XXX overwrite that file.&lt;br /&gt;
            try {&lt;br /&gt;
                fss = (FileSaveService)ServiceManager.&lt;br /&gt;
                          lookup(&amp;quot;javax.jnlp.FileSaveService&amp;quot;); &lt;br /&gt;
            } catch (UnavailableServiceException exc) { }&lt;br /&gt;
            if (fss != null) {&lt;br /&gt;
                try {&lt;br /&gt;
                    fileContents = fss.saveFileDialog(null,&lt;br /&gt;
                                                      null,&lt;br /&gt;
                                                      is,&lt;br /&gt;
                                                      &amp;quot;JWSFileChooserDemo.txt&amp;quot;); &lt;br /&gt;
                } catch (Exception exc) {&lt;br /&gt;
                    log.append(&amp;quot;Save command failed: &amp;quot;&lt;br /&gt;
                               + exc.getLocalizedMessage()&lt;br /&gt;
                               + newline);&lt;br /&gt;
                    log.setCaretPosition(log.getDocument().getLength());&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            if (fileContents != null) {&lt;br /&gt;
                try {&lt;br /&gt;
                    log.append(&amp;quot;Saved file: &amp;quot; + fileContents.getName()&lt;br /&gt;
                               + &amp;quot;.&amp;quot; + newline);&lt;br /&gt;
                } catch (IOException exc) {&lt;br /&gt;
                    log.append(&amp;quot;Problem saving file: &amp;quot;&lt;br /&gt;
                               + exc.getLocalizedMessage()&lt;br /&gt;
                               + newline);&lt;br /&gt;
                }&lt;br /&gt;
            } else {&lt;br /&gt;
                log.append(&amp;quot;User canceled save request.&amp;quot; + newline);&lt;br /&gt;
            }&lt;br /&gt;
            log.setCaretPosition(log.getDocument().getLength());&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /** Returns an ImageIcon, or null if the path was invalid. */&lt;br /&gt;
    protected static ImageIcon createImageIcon(String path) {&lt;br /&gt;
        java.net.URL imgURL = JWSFileChooserDemo.class.getResource(path);&lt;br /&gt;
        if (imgURL != null) {&lt;br /&gt;
            return new ImageIcon(imgURL);&lt;br /&gt;
        } else {&lt;br /&gt;
            System.err.println(&amp;quot;Couldn&amp;quot;t find file: &amp;quot; + path);&lt;br /&gt;
            return null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Create the GUI and show it.  For thread safety,&lt;br /&gt;
     * this method should be invoked from the&lt;br /&gt;
     * event-dispatching thread.&lt;br /&gt;
     */&lt;br /&gt;
    private static void createAndShowGUI() {&lt;br /&gt;
        //Create and set up the window.&lt;br /&gt;
        JFrame frame = new JFrame(&amp;quot;JWSFileChooserDemo&amp;quot;);&lt;br /&gt;
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;
        //Create and set up the content pane.&lt;br /&gt;
        JComponent newContentPane = new JWSFileChooserDemo();&lt;br /&gt;
        newContentPane.setOpaque(true); //content panes must be opaque&lt;br /&gt;
        frame.setContentPane(newContentPane);&lt;br /&gt;
        //Display the window.&lt;br /&gt;
        frame.pack();&lt;br /&gt;
        frame.setVisible(true);&lt;br /&gt;
    }&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        //Schedule a job for the event-dispatching thread:&lt;br /&gt;
        //creating and showing this application&amp;quot;s GUI.&lt;br /&gt;
        javax.swing.SwingUtilities.invokeLater(new Runnable() {&lt;br /&gt;
            public void run() {&lt;br /&gt;
                createAndShowGUI();&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>