"Save" in applet

The default menu of an Applet (when it loads) has a Save option.
It saves the Applet in a .ser format.
Can this .ser format file be used anyway? It can not be opened with appletviewer.exe.

xpost
http://forum.java.sun.com/thread.jspa?threadID=576923&messageID=2891366#2891366

Similar Messages

  • 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...

  • Save Applet as a jpeg/gif image

    I wrote a small applet to draw some lines.
    it work fine.
    What i want to know is how can i save this applet to a jpeg/gif file.
    (Assume there is a Button in the Applet or Even in the HTML page; when click the button needs to save the applet as an image file)
    is it possible??
    import java.applet.*;
    import java.awt.*;
    public class Test extends Applet {
       int width, height;
       public void init() {
          width = getSize().width;
          height = getSize().height;
          setBackground( Color.black );
       public void paint( Graphics g ) {
          g.setColor( Color.green );
          for ( int i = 0; i < 10; ++i ) {
             g.drawLine( width, height, i * width / 10, 0 );
    <applet code="Test" width="300" height="300">
    </applet>
    Message was edited by:
    jugp

    After finding out some facts i tried to do like this;
    but still having some runtime exceptions....
    need help from anybody!!!
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import javax.imageio.ImageIO;
    import java.io.File;
    import java.io.IOException;
    public class Test extends Applet implements ActionListener{
       int width, height;
    Image backbuffer;
       Button save;
       public void init() {
          save = new Button("save");
          add(save);
          save.addActionListener(this);
               width = getSize().width;
          height = getSize().height;
          setBackground( Color.black );
       public void paint( Graphics g ) {
          g.setColor( Color.green );
          for ( int i = 0; i < 10; ++i ) {
             g.drawLine( width, height, i * width / 10, 0 );
       public void actionPerformed(ActionEvent e) {
         String cmd = e.getActionCommand();  
         if (cmd.equals("save")){
                 BufferedImage bufferedImage = new BufferedImage ( width, height,
                       BufferedImage.TYPE_INT_BGR  );
                        bufferedImage.createGraphics().drawImage( backbuffer, 0, 0, this);
                   try {
                        ImageIO.write( bufferedImage, "jpg", new File ( "image.jpg" ) );
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
    <applet code="Test" width="300" height="300">
    </applet>
    */

  • Need help with Java applet, might need NetBeans URL

    I posted the below question. It was never answered, only I was told to post to the NetBeans help forum. Yet I don't see any such forum on this site. Can someone tell me where the NetBeans help forum is located (URL).
    Here is my original question:
    I have some Java source code from a book that I want to compile. The name of the file is HashTest.java. In order to compile and run this Java program I created a project in the NetBeans IDE named javaapplication16, and I created a class named HashTest. Once the project was created, I cut and pasted the below source code into my java file that was default created for HashTest.java.
    Now I can compile and build the project with no errors, but when I try and run it, I get a dialog box that says the following below (Ignore the [...])
    [..................Dialog Box......................................]
    Hash Test class wasn't found in JavaApplication16 project
    Select the main class:
    <No main classes found>
    [..................Dialog Box......................................]
    Does anyone know what the problem is here? Why won't the project run?
    // Here is the source code: *****************************************************************************************************
    import java.applet.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import java.util.*;
    public class HashTest extends Applet implements ItemListener
    // public static void main(String[] args) {
    // Hashtable to add tile images
    private Hashtable imageTable;
    // a Choice of the various tile images
    private Choice selections;
    // assume tiles will have the same width and height; this represents
    // both a tile's width and height
    private int imageSize;
    // filename description of our images
    private final String[] filenames = { "cement.gif", "dirt.gif", "grass.gif",
    "pebbles.gif", "stone.gif", "water.gif" };
    // initializes the Applet
    public void init()
    int n = filenames.length;
    // create a new Hashtable with n members
    imageTable = new Hashtable(n);
    // create the Choice
    selections = new Choice();
    // create a Panel to add our choice at the bottom of the window
    Panel p = new Panel();
    p.add(selections, BorderLayout.SOUTH);
    p.setBackground(Color.RED);
    // add the Choice to the applet and register the ItemListener
    setLayout(new BorderLayout());
    add(p, BorderLayout.SOUTH);
    selections.addItemListener(this);
    // allocate memory for the images and load 'em in
    for(int i = 0; i < n; i++)
    Image img = getImage(getCodeBase(), filenames);
    while(img.getWidth(this) < 0);
    // add the image to the Hashtable and the Choice
    imageTable.put(filenames[i], img);
    selections.add(filenames[i]);
    // set the imageSize field
    if(i == 0)
    imageSize = img.getWidth(this);
    } // init
    // tiles the currently selected tile image within the Applet
    public void paint(Graphics g)
    // cast the sent Graphics context to get a usable Graphics2D object
    Graphics2D g2d = (Graphics2D)g;
    // save the Applet's width and height
    int width = getSize().width;
    int height = getSize().height;
    // create an AffineTransform to place tile images
    AffineTransform at = new AffineTransform();
    // get the currently selected tile image
    Image currImage = (Image)imageTable.get(selections.getSelectedItem());
    // tile the image throughout the Applet
    int y = 0;
    while(y < height)
    int x = 0;
    while(x < width)
    at.setToTranslation(x, y);
    // draw the image
    g2d.drawImage(currImage, at, this);
    x += imageSize;
    y += imageSize;
    } // paint
    // called when the tile image Choice is changed
    public void itemStateChanged(ItemEvent e)
    // our drop box has changed-- redraw the scene
    repaint();
    } // HashTest

    BigDaddyLoveHandles wrote:
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    That wasn't attention-grabbing enough apparantly. Let's try it again.
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}
    h1. {color:red}MULTIPOST: [http://forums.sun.com/thread.jspa?threadID=5358840&messageID=10564025]{color}

  • Save iGrid as image

    Greetings,
    Does anyone know how to save an iGrid as an image?
    We have Chart action block which takes Query Template and Display Template (only Charts) as inputs and saves that chart as image with the help of Image Saver.
    But for iGrid how to do this?
    Thanks and Regards
    Khaleel

    Badeghar
    Save as image is one of most used functions in real time business.
    SAP-xMII supports a built-in method <b>String saveImage()</b>, which is used to get the URL reference to the GIF representation of the image being displayed by the current applet, and is only supported by the <u>iGrid</u>, iChart, and iSPCChart.
    So to save iGrid Applet as image, you can use as follows:
    Step 1: Create a Query Template & a Display Template with data as required
    Step 2: In IRPT page (Javascript), use Applet (<Applet>...</Applet>) to show the applet with code = iGrid. This will display the desired data in iGrid Applet
    Step 3: Put a button anywhere near the applet, which will call (using onClick) to save that iGrid as an image. Say the applet's name is MyApplet, then use the code in the calling function <b>document.MyApplet.saveImage()</b>.
    This is easier and too simple task to save any applet (no matter it is iGrid, iChart or iSPCChart) using Javascript in xMII-based IRPT pages, while Business Logic Editor does support Charts and takes those as input image.
    Regards
    Som

  • Why do we have a "Save"

    The default menu of an Applet (when it loads) has a Save option.
    It saves the Applet in a .ser format.
    Can this .ser format file be used anyway? It can not be opened with appletviewer.exe.

    I have no idea but apparently it is a seralized copy of the applet.
    I did a search in google and got these
    http://www.glenmccl.com/tip_042.htm
    http://www.unix.org.ua/orelly/java/javanut/ch16_01.htm
    http://www.ajug.org/info/tech/serial/serial6.html
    A "serialized applet" might also be the result of a GUI builder. The advantage of this approach is that it can be used to pre-configure some of the properties of the applet.
    rykk

  • Converting Applets to PDF..

    Hi, I am looking for ways to save an applet ouput directly as a pdf file.
    Without using iText or other packages ....
    Thx.

    Welcome to the forums!
    If you are running OS X Tiger, you can try this:
    - Choose the Print menu item
    - In the Print Dialog box, use the "Copies and Pages" dropdown menu to select the "ColorSync" menu item
    - In the panel that pops up, in the Quartz Filter dropdown menu, choose "Reduce File Size". This will reduce the resolution of the images in the file (including things like the background), and so can greatly reduce the size of the file.
    - Once this item is selected, use the Print Dialog PDF dropdown menu to create the PDF
    Unfortunately, Leopard has done away with the Quartz Filter options in the Print Dialog. However, if you are running Leopard, another option may be to export the presentation as images (you can control the quality, and therefore file size, of JPEGS), and then use Preview to gather those separate images into a multipage PDF.

  • Where to host your applets

    Hi, I tried to save an applet on my freewebs account so I could access it from anywhere in an html webpage, but for some reason it refuses to work.
    Does anyone know how I can fix this? If not, do you know of a good, (free) place where you can upload java applets, and access them within an html webpage?
    Btw, I'm also fairly new to java and to programming in general, so don't assume I know a lot. :-\

    again, I'm fairly new to this stuff, especially web programming so i don't fully understand some of your questions. :-(
    I don't know what FTP accesss means so I'm not sure if I have it. :-\
    If a file on freewebs is an image, you can view the image just by typing its url.
    If I try to access a .class file though, nothing happens, but heck, nothing happens if you try to open a .class file
    directly on your own computer, right?
    here's my html code
    <html>
    <head>
       <title> myTitle </title>
    </head>
    <body>
    <APPLET CODE="http://www.freewebs.com/mikau16/JavaShapeArray4.class"></APPLET>
    </body>
    </html>and here are the error messages:
    Java Plug-in 1.5.0_06
    Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Rav
    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
    p:   reload proxy configuration
    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>
    load: class http://www.freewebs.com/mikau16/JavaShapeArray4.class not found.
    java.lang.ClassNotFoundException: http:..www.freewebs.com.mikau16.JavaShapeArray4.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    load: class http://www.freewebs.com/mikau16/JavaShapeArray4.class not found.
    java.lang.ClassNotFoundException: http:..www.freewebs.com.mikau16.JavaShapeArray4.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more

  • Coverting applet to a jpg file

    Hi,
    I have a class that creates an applet with some parameters found in a file. I need to save the applet into a .jpg file, so I can publish it on a web client.
    Is it possible to do this??
    Thanks

    I want to publish in a jsp the graph that is in the applet. Write your canvas content out to a JPG file.
    I want the client to be able to see the applet on its browser.... Put your applet out where you can have people access it, make a note saying they need to have Java 1.XX on thier computer to run the applet.

  • Where browser saved its applet files?

    Hi friends,
    When applet is loaded into browser, is there any local copy somewhere under browser or its temp directory? I am wondering where the browser saves the applet.jar or *.class files in user's local machine? Or it just loaded into the user's memory, and does not save anywhere?
    Thanks.

    The applet class file is cached in the user's home directory if you are using Windows. For example I'm using win2k so it gets cached in C:\Documents and Settings\jaind\.jpi_cache\file\1.0\ directory and there are two files XYZApplet.class-680e2d01-7c564852.class and UnzipApplet.class-680e2d01-7c564852.idx. Next time when browser tries to load applet it looks at this version. If the server version is newer than this it again downloads the applet class otherwise uses the cached class.

  • NT security problems with file I/O

    I have 2 problems with file I/O. When I read from a file I use the getAbsolutePath() method that is part of the File class to find what directory the files are currenlty. The problem is that the returned path says that the file is on the desktop no matter what directory the file really is in. The second problem is that I am unable to save files anywhere but the desktop. I must run the class files from the desktop too to get it to work.
    I am using NT 4.0 for development. I'm guessing that these problems might be NT security related. Could someone help me?
    Code below:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.io.File;
    import java.awt.event.*;
    //import java.security.*;
    //import sun.security.*;
    //import java.awt.Window;
    //import com.ms.security.*;
    public class Edit extends Applet implements ActionListener, ItemListener
    String Gselect;
    reader readit;
    int mhz, khz;
    TextField textField1;
    String freq = "000.000";
    String data;
    Choice freqC;
    Button ActivateB, SaveB, /*CancelB, HelpB,*/ DeleteB;
    Checkbox SetC;
    int NotUsedReply[] = new int[200];
    int HwListReply[] = new int[200];
    public void init()
    readit = new reader();
    String myFile="satellite.st1";
    // myFile = myFile.concat(Gselect);
    File satellite = new File(myFile);
    textField1 = new TextField();
    textField1.setText( "(void) " );
    add( textField1 );
    SetC = new Checkbox("TRAP-RX");
    add(SetC);
    SetC.addItemListener(this);
    freqC = new Choice();
    freqC.setSize(20,50);
    freqC.add("000.000");
    add(freqC);
    freqC.addItemListener(this);
    ActivateB = new Button("Activate");
    add(ActivateB);
    ActivateB.addActionListener(this);
    SaveB = new Button("Save");
    add(SaveB);
    SaveB.addActionListener(this);
    DeleteB = new Button("Delete");
    add(DeleteB);
    DeleteB.addActionListener(this);
         /*CancelB = new Button("Cancel");
    add(CancelB);
    CancelB.addActionListener(this);
         HelpB = new Button("Help");
    add(HelpB);
    HelpB.addActionListener(this);*/
    //textField1.setText( data );
    for(int a = 1; a < 9; a++)
    data = readit.getData(satellite.getAbsolutePath(), a);//("E:\\forte4j\\system\\Projects\\Zebra\\satellite.st1", a);
    freqC.addItem(data);
    textField1.setText(satellite.getAbsolutePath() );
    public void paint(Graphics g)
    //g.drawString("Radio Setup Files",20, 20);
    //g.drawString(getParameter("wse"),20, 20);
    public void actionPerformed(ActionEvent event)
    if(event.getSource() == ActivateB)
    activator();
    if(event.getSource() == SaveB)
    /*if(event.getSource() == CancelB)
    stop();
    if(event.getSource() == HelpB)
    if(event.getSource() == DeleteB)
    public void itemStateChanged(ItemEvent e)
    if(e.getItemSelectable() == SetC)
    textField1.setText("Check box 1 clicked!");
    if(e.getItemSelectable() == freqC)
    freq = ((Choice)e.getItemSelectable()).getSelectedItem();
    public void activator()
    makeMHZ();
    makeKHZ();
    if(mhz > 254)
    int StartLink[]={0x0c,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00};          //New Link Proc Start
    int TrapConfig[]={0x25,0x80,0x00,0x00,0x00,0xb7,0x00,0x0c,0x0b,          //TRAP Configuration
    0x00,0x00,0x00,0xff,0xa0,0xff,0x0d,0xff,0xe8,
    0xff,0x0d,0xff,0x00,0xff,0x15,0xff,0xb0,0xff,
    0xff,0xff,0x94,0x0a,0x01,0x06,0x1a,0x00,0x0d,
    0x2d,0x21};
    TrapConfig[11]=(mhz-255);
    TrapConfig[12]=(khz/5);
    int SetUserOutput[]={0x41,0x42,0x49,0x54,0x52,0x41,0x50,0x20,0x34, //Sets User Output Format
    0x35,0x34,0x35,0x30,0x30,0x2e,0x30,0x4e,0x30,
    0x38,0x32,0x34,0x35,0x30,0x30,0x2e,0x30,0x57,
    0x30,0x31,0x30,0x30,0x2e,0x30,0x30,0x4b,0x4d,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00};
    sendget CmdFunc;
    CmdFunc=new sendget();
    try
    //PolicyEngine.assertPermission(PermissionID.SYSTEM);
    Socket h = new Socket("192.9.200.155",9000);
    Socket s = new Socket("192.9.200.155",9001);
    Socket t = new Socket("192.9.200.155",9002);
    int j;
    CmdFunc.SendCmd(h,0,0x01,null);
    CmdFunc.GetCmd(h,HwListReply);
    CmdFunc.SendCmd(s,9,0x1e,StartLink); //New Link Proc Start
    CmdFunc.GetCmd(s,NotUsedReply);
    CmdFunc.SendCmd(s,37,0x00,TrapConfig); //TRAP Configuration
    CmdFunc.GetCmd(s,NotUsedReply);
    CmdFunc.SendCmd(s,155,0x03,SetUserOutput);//Sets User Output Format
    CmdFunc.GetCmd(s,NotUsedReply);
    catch(Exception e){}
    else
    textField1.setText( "000.000 is the null choice. Try another." );
    public void receiveText1( String select )
    Gselect=select;
    public void makeMHZ()
    String y = freqC.getSelectedItem();
    y = y.substring(0,3);
    mhz = Integer.parseInt(y);
    //textField1.setText( y );
    public void makeKHZ()
    String y = freqC.getSelectedItem();
    y = y.substring(4,7);
    khz = Integer.parseInt(y);
    //textField1.setText( y );
    import java.awt.*;
    import java.applet.*;
    import java.io.RandomAccessFile;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.LineNumberReader;
    import java.awt.event.*;
    import com.ms.security.*;
    import netscape.security.*;
    import netscape.util.*;
    public class saver extends Applet implements ActionListener
    String nameS = "Data.txt";
    String dataS = "Default Data";
    Button saveB;
    public void init()
    saveB = new Button("SaveFile");
    add(saveB);
    saveB.addActionListener(this);
    public void actionPerformed(ActionEvent event)
    if(event.getSource() == saveB)
    RandomAccessFile RAF;
    byte array0[] = dataS.getBytes();
    try
    if (Class.forName("com.ms.security.PolicyEngine") != null)
    PolicyEngine.assertPermission(PermissionID.SYSTEM);
    if(Class.forName("netscape.security.PrivilegeManager") != null)
    netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
    catch (Throwable cnfe)
    try
    RAF = new RandomAccessFile(nameS, "rw");
    // RAF.writeUTF(dataS);
    RAF.write(dataS.getBytes());
    RAF.close();
    catch(Exception e)
    public void receiveND(String name, String data)
    if(name != null)
    nameS = name;
    dataS=data;
    import java.io.RandomAccessFile;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.LineNumberReader;
    //import java.security.*;
    import com.ms.security.*;
    import netscape.security.*;
    import netscape.util.*;
    public class reader
    //Signature sig;
    public String getData(String filename, int pass)
    //String nameS = "Data.txt";
    String dataS = "Default Data Sucks";
    String comma = ",";
    int get = pass, count=0, top=0, bottom=0;
    char[] work;
    try
    if (Class.forName("com.ms.security.PolicyEngine") != null)
    PolicyEngine.assertPermission(PermissionID.SYSTEM);
    if(Class.forName("netscape.security.PrivilegeManager") != null)
    netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
    catch (Throwable cnfe)
    try
    //sig.sign();
    //nameS = filename;
    RandomAccessFile RAF = new RandomAccessFile(filename, "r");
    // dataS = RAF.readUTF();
    dataS = RAF.readLine();
    RAF.close();
    catch(Exception e)
    return e.toString();
    work = dataS.toCharArray();
    for(int i = 0; i < dataS.length(); i++)
    if( work[i] == ',' )
    count++;
    if(get == count)
    bottom = i + 1;
    if( (work[i] == ',') && (count > get) && (top == 0) )
    top = i;
    dataS = dataS.substring(bottom,top);
    return dataS;
    }

    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.io.File;
    import java.awt.event.*;
    //import java.security.*;
    //import sun.security.*;
    //import java.awt.Window;
    //import com.ms.security.*;
    public class Edit extends Applet implements ActionListener, ItemListener
    String Gselect;
    reader readit;
    int mhz, khz;
    TextField textField1;
    String freq = "000.000";
    String data;
    Choice freqC;
    Button ActivateB, SaveB, /*CancelB, HelpB,*/ DeleteB;
    Checkbox SetC;
    int NotUsedReply[] = new int[200];
    int HwListReply[] = new int[200];
    public void init()
    readit = new reader();
    String myFile="satellite.st1";
    // myFile = myFile.concat(Gselect);
    File satellite = new File(myFile);
    textField1 = new TextField();
    textField1.setText( "(void) " );
    add( textField1 );
    SetC = new Checkbox("TRAP-RX");
    add(SetC);
    SetC.addItemListener(this);
    freqC = new Choice();
    freqC.setSize(20,50);
    freqC.add("000.000");
    add(freqC);
    freqC.addItemListener(this);
    ActivateB = new Button("Activate");
    add(ActivateB);
    ActivateB.addActionListener(this);
    SaveB = new Button("Save");
    add(SaveB);
    SaveB.addActionListener(this);
    DeleteB = new Button("Delete");
    add(DeleteB);
    DeleteB.addActionListener(this);
    /*CancelB = new Button("Cancel");
    add(CancelB);
    CancelB.addActionListener(this);
    HelpB = new Button("Help");
    add(HelpB);
    HelpB.addActionListener(this);*/
    //textField1.setText( data );
    for(int a = 1; a < 9; a++)
    data = readit.getData(satellite.getAbsolutePath(), a);//("E:\\forte4j\\system\\Projects\\Zebra\\satellite.st1", a);
    freqC.addItem(data);
    textField1.setText(satellite.getAbsolutePath() );
    public void paint(Graphics g)
    //g.drawString("Radio Setup Files",20, 20);
    //g.drawString(getParameter("wse"),20, 20);
    public void actionPerformed(ActionEvent event)
    if(event.getSource() == ActivateB)
    activator();
    if(event.getSource() == SaveB)
    /*if(event.getSource() == CancelB)
    stop();
    if(event.getSource() == HelpB)
    if(event.getSource() == DeleteB)
    public void itemStateChanged(ItemEvent e)
    if(e.getItemSelectable() == SetC)
    textField1.setText("Check box 1 clicked!");
    if(e.getItemSelectable() == freqC)
    freq = ((Choice)e.getItemSelectable()).getSelectedItem();
    public void activator()
    makeMHZ();
    makeKHZ();
    if(mhz > 254)
    int StartLink[]={0x0c,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00}; //New Link Proc Start
    int TrapConfig[]={0x25,0x80,0x00,0x00,0x00,0xb7,0x00,0x0c,0x0b, //TRAP Configuration
    0x00,0x00,0x00,0xff,0xa0,0xff,0x0d,0xff,0xe8,
    0xff,0x0d,0xff,0x00,0xff,0x15,0xff,0xb0,0xff,
    0xff,0xff,0x94,0x0a,0x01,0x06,0x1a,0x00,0x0d,
    0x2d,0x21};
    TrapConfig[11]=(mhz-255);
    TrapConfig[12]=(khz/5);
    int SetUserOutput[]={0x41,0x42,0x49,0x54,0x52,0x41,0x50,0x20,0x34, //Sets User Output Format
    0x35,0x34,0x35,0x30,0x30,0x2e,0x30,0x4e,0x30,
    0x38,0x32,0x34,0x35,0x30,0x30,0x2e,0x30,0x57,
    0x30,0x31,0x30,0x30,0x2e,0x30,0x30,0x4b,0x4d,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00};
    sendget CmdFunc;
    CmdFunc=new sendget();
    try
    //PolicyEngine.assertPermission(PermissionID.SYSTEM);
    Socket h = new Socket("192.9.200.155",9000);
    Socket s = new Socket("192.9.200.155",9001);
    Socket t = new Socket("192.9.200.155",9002);
    int j;
    CmdFunc.SendCmd(h,0,0x01,null);
    CmdFunc.GetCmd(h,HwListReply);
    CmdFunc.SendCmd(s,9,0x1e,StartLink); //New Link Proc Start
    CmdFunc.GetCmd(s,NotUsedReply);
    CmdFunc.SendCmd(s,37,0x00,TrapConfig); //TRAP Configuration
    CmdFunc.GetCmd(s,NotUsedReply);
    CmdFunc.SendCmd(s,155,0x03,SetUserOutput);//Sets User Output Format
    CmdFunc.GetCmd(s,NotUsedReply);
    catch(Exception e){}
    else
    textField1.setText( "000.000 is the null choice. Try another." );
    public void receiveText1( String select )
    Gselect=select;
    public void makeMHZ()
    String y = freqC.getSelectedItem();
    y = y.substring(0,3);
    mhz = Integer.parseInt(y);
    //textField1.setText( y );
    public void makeKHZ()
    String y = freqC.getSelectedItem();
    y = y.substring(4,7);
    khz = Integer.parseInt(y);
    //textField1.setText( y );
    import java.awt.*;
    import java.applet.*;
    import java.io.RandomAccessFile;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.LineNumberReader;
    import java.awt.event.*;
    import com.ms.security.*;
    import netscape.security.*;
    import netscape.util.*;
    public class saver extends Applet implements ActionListener
    String nameS = "Data.txt";
    String dataS = "Default Data";
    Button saveB;
    public void init()
    saveB = new Button("SaveFile");
    add(saveB);
    saveB.addActionListener(this);
    public void actionPerformed(ActionEvent event)
    if(event.getSource() == saveB)
    RandomAccessFile RAF;
    byte array0[] = dataS.getBytes();
    try
    if (Class.forName("com.ms.security.PolicyEngine") != null)
    PolicyEngine.assertPermission(PermissionID.SYSTEM);
    if(Class.forName("netscape.security.PrivilegeManager") != null)
    netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
    catch (Throwable cnfe)
    try
    RAF = new RandomAccessFile(nameS, "rw");
    // RAF.writeUTF(dataS);
    RAF.write(dataS.getBytes());
    RAF.close();
    catch(Exception e)
    public void receiveND(String name, String data)
    if(name != null)
    nameS = name;
    dataS=data;
    import java.io.RandomAccessFile;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.LineNumberReader;
    //import java.security.*;
    import com.ms.security.*;
    import netscape.security.*;
    import netscape.util.*;
    public class reader
    //Signature sig;
    public String getData(String filename, int pass)
    //String nameS = "Data.txt";
    String dataS = "Default Data Sucks";
    String comma = ",";
    int get = pass, count=0, top=0, bottom=0;
    char[] work;
    try
    if (Class.forName("com.ms.security.PolicyEngine") != null)
    PolicyEngine.assertPermission(PermissionID.SYSTEM);
    if(Class.forName("netscape.security.PrivilegeManager") != null)
    netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
    catch (Throwable cnfe)
    try
    //sig.sign();
    //nameS = filename;
    RandomAccessFile RAF = new RandomAccessFile(filename, "r");
    // dataS = RAF.readUTF();
    dataS = RAF.readLine();
    RAF.close();
    catch(Exception e)
    return e.toString();
    work = dataS.toCharArray();
    for(int i = 0; i < dataS.length(); i++)
    if( work == ',' )
    count++;
    if(get == count)
    bottom = i + 1;
    if( (work == ',') && (count > get) && (top == 0) )
    top = i;
    dataS = dataS.substring(bottom,top);
    return dataS;

  • Concerning automatic plugin download

    i have a simple question
    what is required to make a applet,
    (automatically prompt the user to dl the pluggin) for the newest jre
    if they do not have it.
    2. if i use a <applet> tag does this prevent it i heard that it is supposed to be automatic.
    thanks in advance to anyone who answers my newbie question.

    what is required to make a applet ???The only thing that is required to make a applet is the JDK install on the person's computer that is making the applet. They/You would have to
    write and save the applet in a '.java' file eg: myApp.java
    Then compile it to a normal '.class' <java class file> file
    eg: myApp.class
    Then in included it in the webpage with <applet> tag
    also:
    The other thing is that to put/have it on a webpage page, the web browser would have to have Java enabled, most webbrowsers download with this plugin or it's own thing for java <ie MSIE> if not a person would be prompted (depends on browser setting)
    (automatically prompt the user to dl the pluggin) for
    the newest jre
    if they do not have it.Now this is different, if your applet uses any java class not found in the current version of java/jre that the person viewing your webpage has loaded with there browser or as a plug-in. You can make/(not force) but suggest to the web browser in code (which is the prompt that pops up) that the user should dl the lastest/required version of java or the jre. You can put the code in javascript/vbsccript/or the java applet.
    *The reason why I typed java/jre is b/c as a non-programmer (anyone visiting your web page doesn't need the entire java SDK installed) may have need for just the updated JRE. Also if the person is a programmer that has Java installed (the JDK) they may want to updated there entire JDK (which also updated the java plugin,java classes,etc..).
    2.if i use a <applet> tag does this prevent it i
    heard that it is supposed to be automatic.If you use an <applet> tag the web browser would use it's default action for having the applet, which depends on how the user setup there web browser.
    ie: I use Netscape and MSIE, and I'm a programmer (the means I have the Java SDK installed). In MSIE I setup it so that the Java Console from Sun runs to handle any java/javascript programming for that web browser.
    **Java Console installed with the Java SDK <Locationed in Control Panel
    In Netscape I use the install JRE that install with the browser to handle any Java/javascript <I do this for performance reasons!>
    I really hope this makes sense, and that it answers your question!
    Jimdogee ,and your welcome!

  • Remote control Tool for non-IT staff

    Hi
    We currently run ZENworks for Desktops v7 and have a requirement to
    offer our financial systems team the ability to remote control users'
    workstation without the need to use Console 1. All workstations are
    currently Windows XP SP2 or SP3.
    1. Are there any 3rd party/Cool tools that can be used to offer remote
    control instead of using Console 1?
    2. Do these tools require additional roles/rights?
    Thank you.

    You can use our DSRAZOR for eDirectory/NDS and NetWare product for this.
    See the applets called "ZEN Remote Control / Remote View by User" and "ZEN
    Remote Control / Remote View by Workstation" in the HelpDesk Examples
    section of the DSRAZOR Console. The applets can be customized to your
    needs - such as limiting which containers and/or which workstations are
    shown, and allowing only remote control or only remote view (instead of
    both). After any necessary modifications are made (we can show you how or
    make the changes for you), save the applet as an EXE to distribute to the
    people who will use it. Having the applet as an EXE means they will not
    need ConsoleOne and they will not need the full DSRAZOR product either.
    The example applet in the DSRAZOR Console is based on the user's own
    privileges. If you do not want to grant these users their own privileges
    for remote control / remote view, the applet can be modified to use our
    optional Zero Privilege Helpdesk NLM. You would need one NetWare server to
    run the Zero Privilege Helpdesk NLM. When you load the NLM you will specify
    the name of a group (such as financial systems group). Then only the
    members of that group will be able to successfully use the applet, which
    they will have as a stand-alone EXE.
    An evaluation of DSRAZOR is available from:
    http://www.visualclick.com/?source=NVsupZen7r
    "Donald Sparko" <[email protected]> wrote in message
    news:eaK4m.1481$[email protected]..
    > Hi
    >
    > We currently run ZENworks for Desktops v7 and have a requirement to
    > offer our financial systems team the ability to remote control users'
    > workstation without the need to use Console 1. All workstations are
    > currently Windows XP SP2 or SP3.
    >
    > 1. Are there any 3rd party/Cool tools that can be used to offer remote
    > control instead of using Console 1?
    >
    > 2. Do these tools require additional roles/rights?
    >
    > Thank you.
    >
    > --
    >

  • Exportin JApplet as an image

    Hi,
    Is there a way to save me applet as an image (eps, gif, bmp, whatever)? I would like to have a button that will save the JApplet as an image. Thanks.
    [email protected]

    Luckily for you, Java has created a Robot object which has a createScreenCapture method. Turning what it gives you into something useful is a little more difficult but not that much ...
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import java.awt.image.BufferedImage;
    import java.awt.Robot;
    import java.awt.Point;
    import java.awt.Component;... Main class code ...
      public static void saveComponentAsJPEG(Component cmp, String jpegfile) {
        Rectangle d = cmp.getBounds();
        try {
           Robot r = new Robot();
           Point p = cmp.getLocationOnScreen();
           d.x = p.x;
           d.y = p.y;
           BufferedImage bi = r.createScreenCapture(d);
           saveImageAsJPEG(bi, jpegfile);
        catch (Exception e) { e.printStackTrace(); }
      public static void saveImageAsJPEG(BufferedImage bi, String filename) {
        try {
          ByteArrayOutputStream boutstream = new ByteArrayOutputStream();
          JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(boutstream);
          enc.encode(bi);
          FileOutputStream fimage = new FileOutputStream(new File(filename));
          boutstream.writeTo(fimage);
          fimage.close();
          catch (Exception e) { System.out.println(e); }
      }I think that should do it for you, I am using this code in a program I am writing currently and it seems to work for me, but I have to call the function using SwingUtilities.invokeLater() or else the display is always in need of repaint when the picture is taken.
    Good luck.
    Will

  • Visual Studio, FrontPage, DreamWeaver

    Just got back from xMII class, where they used FrontPage.   Discovered today that FrontPage is no longer a product.  Is the follow-on product (Expression Web) supported (i.e. does the xMII install integrate plugins correctly?).  Is there any way to get these plugins to work with VisualStudio.Net?   What are most people using for development?

    Hello Ryan,
    How was the training?
    xMII has plug ins for FrontPage and Dreamweaver.  If you don't have those you should use the "standalone" wizard - which you can download from the xMII server and install on your computer.  The standalone will ask you to login to the xmii server - and when you click the "Create HTML" button - it saves the applet code to the clipboard.  Then you can paste it into your webpage.
    Hope this helps.
    Joe

Maybe you are looking for