Image creation from Swing Frame

Hello friends,
I have created a Swing application which depicts a Invoice form in any normal business. The issue is that when I click save button, the screen details captured in components such as textfields,combos etc..should get saved in DB (which is done) & the Invoice screen should be saved as an image (.tiff format --- multipage)which when viewed later shows the data captured for that particular invoice at the time the invoice was saved.
In simple words, I want to save the Swing form as an image if (tiff) format is difficult then (gif) format is also ok.
Can anyone plz help me in this matter. How do I capture the Swing Frame details?
Its very URGENT.
regards
Jeeves

Why do you need a GIF image for that?
A simple Image or Bufferedimage should do.
Check this out:
http://forum.java.sun.com/thread.jspa?threadID=477654&messageID=2220990
And camickr's ScreenImage class:
http://forum.java.sun.com/thread.jspa?threadID=604040

Similar Messages

  • Dynnamic image creation from Swing Component

    Hi,
    I am trying to make a drag and drop area of an application, which will change the mouse cursor image to the component being dragged (a JPanel with several child Components).
    I know how to change the mouse cursor to a GIF image, my problem lies in dynamically creating the image from the onscreen components.
    Is there any way to get the image stream created by a container and pass that to a GIF creation method, or is there a simpler way?

    Why do you need a GIF image for that?
    A simple Image or Bufferedimage should do.
    Check this out:
    http://forum.java.sun.com/thread.jspa?threadID=477654&messageID=2220990
    And camickr's ScreenImage class:
    http://forum.java.sun.com/thread.jspa?threadID=604040

  • Change image duration from 1 frame to 2 seconds

    I have imported some images from an iMovie project to the timeline of FCP. They imported at 1 frame duration. I have tried every suggestion from other threads as to changing the duration of the images, to no avail. They seem to be locked. Nothing works. What am I missing? I need to change them to 2 seconds. I tried control/click and changing the duration to 2 seconds - no go. I have reset the preferences to 2 seconds, and imported another image as a test - still imports at 1 frame only. I have changed the duration in the Browser - doesn't change anything. I have tried the Viewer and can't make it budge. Help!
    I imported directly from iMovie to the timeline so I could keep the images in order. If I import from the browser, it imports at the preference setting, but that means I would need to wade through the browser to put them in order again (very time consuming to do it with 300 images)
    gary

    Would making a freeze frame of the image work? Could be pretty fast. Load in viewer, shift-n. drag to browser. Do you want to email me one of the images and I'll see if there's anything obvious? My email address is in my profile.
    Also, what format did you export them from in IMovie. You might be able to use a graphic utility or photoshop to do a batch conversion

  • Changing default still image time from 150 frames to timecode option?

    I want to change the default duration for still images under Preferences in CS6. It is showing up as 150 frames by default. Is there a way to change this so I can just enter it as timecode 00;00;03;00 instead?
    Thanks.

    Most of the time, 30 frames per second is a safe way to calculate things on a 29.97 sequence. If you really have a problem with that, and many animators do, since you are using still images, use a custom setting for your sequence. Create one using 30 frames per second and use non-drop frame timecode. Use square pixels and No Fields (Progressive).
    Now, if you are turning this over to someone for use in a commercial, for example, where the exact number of frames is required so that 30 seconds is not exceeded, then that is a different story.
    Your second question - sorry - but you really want to determine the duration prior to importing the image. Once you have the image in the project, the duration is already set and must be changed for each and every one individually. As far as I know, you can't set one and then copy the duration to the others.

  • How to render a video from image sequence with custom frame rate?

    Dear all,
    For a project i would like to create a video from 47 images with a custom frame rate. To achieve this i take the following steps in Photoshop CS6 extended:
    1) File -> Open...
    2) Select the first image and select " image sequence ". All images have the same size (1280 x 1261 px) and are numbered correctly.
    3) Click open
    4) Frame Rate: Custom 3 fps
    5) File -> Export -> Render Video... -> Render
    6) Play the video with VLC. The video shows a still image of the first image.
    If i choose a frame rate of 10 fps, then there is no problem. VLC plays the video as expected.
    Is there a other way to create a video from 47 images and choose a custom frame rate? Or what am i doing wrong?

    Seen this SO thread?
    http://stackoverflow.com/questions/6691136/how-to-convert-series-of-images-into- movie-in-ios

  • Animation. How do I import still images in final cut pro x (from dragon frame) duration 3 frames pr. image?

    Animation. How do I import still images in final cut pro x (from dragon frame) duration 3 frames pr. image? We have allready tried to set stillimages duration in preferences to 0,08 sek, but it does not have any effect!

    You can drag your images to the timeline, select all, ctrl-d and set the duration to 3 frames by typing 3 and enter.
    Or you can use Quicktime 7 to "open image sequence", select the desired duration, export your animation to quicktime and import that into FCP X for further editing.

  • I want to take an image that's from my files, no cropped and be able to set up action(s) where I can drop that image behind an 8x10 frame overlay, then the same with a 5x7 frame overlay, then the same image behind a memory mate overlay that's an 8x10 size

    So is there a way to do this using the images right from the camera, where I don't have to crop three different sized images and drag them into the overlays?  I can set up an action for each, but cropping the same image 3x is a pain in the ***..!

    There are.  I did not write you need to learn scripting and write your own scripts.  As I wrote most Photoshop will never write a script.  However I would write every Photoshop user will at times use a Photoshop script to do some automated process for them. 
    I wrote the it would be very hard to do what you want to do would a straight Photoshop action.  Actions on their own can not use logic.  An action would need to to it by brute force.
    However in Photoshop CC Adobe added conditional action support.  With this support it is now possible to create a group of actions to process some conditions.  Like you can separate Landscape from portraits have an Action for processing  landscape images and an other for processing portrait images.
    Size is still hard to deal with for you can have landscape's the are extremely wide to landscapes that are square and portraits the are extremely narrow to those that are almost square.
    Image the extreme aspect ratio will not fill a 8:10 or 5:7  area it resized to 10 and 7 and creating crops the have 8"10 and 5:7 will have images compositions where most of your image content has been discarded.
    Camera images do not have extreme aspect ratio the usually have  3:2 or 4:3 aspect ratios there are exceptions.  When you have print made the are 5x7 and 8x10 by printers  the prints you receive from the printers are center crops from your image files.
    It is very easy to make center crops if aree images have the same aspect ratio and orientation to begin with.  Now with CC you can have seperate actions to the two orientations.
    A general solution would need handle arbitrary aspect ratios the resulting center crop may well not have a satisfactory image composition for source image with extreme aspect ratios.
    Photoshop ship with several scripts users use all the time to process their image.  You may have used some yourself. Do any of these sound familiar to you. Conditional Mode Change, ContactSheetII, Delete All Empty Layers, Export Layers To Files, ExportColorLookupTables,  Fit Image, Flatten All Layer Effects, Flatten All Masks, generate, Image Processor, Layer Comps To Files, Layer Comps To PDF, Lens Correct, Load DICOM, Load Files into Stack, Merge To HDR, Photomerge, Script Events Manager and Statistics.
    My action package as I wrote contains more the a dozen script I wrote to be used in actions to add logic into the actions.
    It would also be extremely easy to create a Photo Collage Template PSD that contains a background layer that has your two frames the 8x10 and 5x7 and also have two alpha channels to map the locations of the images.  That can be batch populated with my script  BatchPicturePackage.
    Photo Collage Toolkit
    Photoshop scripting is powerful and I believe this package demonstrates this A video showing a 5 image collage PSD template  being populates with images:
    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    Size the photo collage templates for the print size you want - width, height and print DPI resolution.
    Photo collage templates must have a Photoshop background layer. The contents of this layer can be anything.
    Photo collage templates must have alpha channels named "Image 1", "Image 2", ... "Image n".
    Photo collage templates layers above the background layers must provide transparent areas to let the images that will be placed below them show through.
    There are twelve scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder
    PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
    PCTpreferences.jsx - Edit This File to Customize Collage Populating scripts default setting and add your own Layer styles.
    Documentation and Examples

  • Movie Creation from an Image Sequence

    Hi, my question is about how to use iMovie to create a movie from an image sequence.
    I have much experience doing this in Quicktime Pro. I just import the image sequence and select the time interval for each frame.
    I want to use iMovie 4 nstead of Quicktime Pro to do this because I'd like the frames to span variable time lengths and be synced to audio. I'm sure this is easy, but as someone new to iMovie I have no idea how to do it.
    thanks
    Powerbook G4 15 aluminum   Mac OS X (10.4.7)  

    Another way is to import the sequence directly into iMovie, automatically importing with the duration you want. iMovie lets you set a duration from 1 frame up.
    • iMovie lets you select any number of images to import at the same time, so you can select one image to import or a sequence of images in a folder. (Use the Import command so the numbered sequence arrives in the proper order.)
    (To import all the images in a folder, press Command-A after navigating to that folder. Otherwise use Command-clicking and Shift-clicking to select the images.)
    • Imported images always conform to your current Ken Burns settings. So if KB is set to import as 5 seconds with no zoom, that's how the images arrive.
    But you're not limited to <n> seconds. You can force KB to import as 1 frame, 10 frames or whatever. The trick is to first configure KB to import with that duration.
    Trouble is, the KB duration textbox is buggy so you can't type your desired duration there. But KB can be set another way, by clicking on any previously-imported image. So the trick is to create a clip with the duration you want, then use it as a "template" for importing other images.
    To create a clip with the duration you want, double-click on a previously-imported clip and set its duration to <n> frames. (Type 00:00:01 for one frame.) Before importing the sequence, click on that clip, which sets KB to apply its settings for the next import(s).
    One can create a series of "template" clips, one for each duration commonly used. Before importing each new set of images, click on the clip you want to control the next import.
    Unfortunately, once images are imported there is no way to simultaneously Update all to a new duration using a textbox. It may be easiest to simply re-import the images with a new duration.
    Karl

  • Firefox upon opening an image in a new tab, centers the image from top and bottom and surrounds the image with a grey frame. Just started having the problem today, searched Google to no avail.

    Firefox upon opening an image in a new tab, centers the image from top and bottom and surrounds the image with a grey frame. Just started having the problem today, searched Google to no avail.

    Oh wow, looks like a new feature.
    The "page" links in a stylesheet with the address "resource://gre/res/TopLevelImageDocument.css". If you remove that reference, then the image displays in the old style.
    '''''Edit: Please skip the rest of this post and check out the next one.'''''
    There might be a more elegant solution than that, but you could use a bookmarklet to strip out that link when you want to view the page in its old style. A bookmarklet is a snippet of JavaScript you save on the Bookmarks toolbar for quick access.
    First, copy the following code to the clipboard (it's all one long line):
    <br>javascript:var ssheet=document.querySelector('link[href="resource://gre/res/TopLevelImageDocument.css"]'); if(ssheet)ssheet.parentNode.removeChild(ssheet); void 0;
    Next, if you are not displaying the Bookmarks Toolbar, use View > Toolbars > Bookmarks Toolbar to display it. (If you aren't using the classic Menu bar, press Alt+v to call up the old View menu. Right-clicking the gray area just below the page address also allows you to display the Bookmarks Toolbar.)
    Right-click on the Bookmarks Toolbar (or Mac equivalent of right-click!) and choose New Bookmark.
    Paste the code into the Location box (the second box).
    Then type a useful name in the Name box (e.g., Oldstyle Picture) and click Add.
    Now, when you want to tweak the image display, click the button to run the script.
    Manual clicking is a hassle, so it might make sense to look into other solutions. (Greasemonkey didn't seem to work; I think it might not run on .jpg files.)

  • Image creation with MDT task sequence- "Windows has recovered from an unexpected shutdown"

    I'm using MDT 2012 U1 to build and capture a Windows 7 x86 image for deployment with ConfigMgr 2012 SP1.  I'm using the standard client task sequence in MDT.
    The MDT task sequence consistently fails after the reboot in the "Postinstall" group.  The install OS, Copy Scripts, Configure, Inject Drivers, Next Phase, and Restart Computer tasks all execute successfully, then the MDT-initiated reboot
    completes successfully.  There is nothing else helpful in the SMSTS.LOG, these are the last entries in the log:
    Successfully complete the action (Restart Computer) with the exit win32 code 0
    Sending status message
    Executing in non SMS standalone mode.  Ignoring send a task execution status message request
    Set a global environment variable _SMSTSLastActionRetCode=0
    Set a global environment variable _SMSTSLastActionSucceeded=true
    Expand a string %_SMSTSMDataPath%\Logs
    Deleting file without retrying
    The error message on the reference computer says, "Windows has recovered from an unexpected shutdown" along with "An existing in-progress deployment was found but is not in an expected state.  Would you like to ignore this in-progress
    deployment and start a new one?"
    I have found one post that suggested modifying customsettings.ini with  HideShell=Yes, which I tried.  It didn't help.
    I am not sure why MDT thinks the reboot was unexpected?  Has anybody run into this?  What steps can I take to narrow down the problem?
    Any help/suggestions are appreciated.
    Thanks,
    FP

    Thanks for your reply Phil.
    Setuperr.log is empty, zero bytes.  Setupact.log looks good to me, it has these entries at the end:
    OrchestrateUpdateImageState: Updating image state from [IMAGE_STATE_UNDEPLOYABLE] --> [Image_State_Complete]
    OOBELdr.exe exiting with code [0x0]...
    Process exited with exit code [0x0]
    c:\windows\panther\SetupInfo succeeded.
    c:\windows\panther\setupinfo.
    Windeploy.exe exiting with code [0x0]
    SetupSQM Started
    Panther path is C:\windows\Panther
    SQM not opted in
    SetupSQM is finished
    Our image environment was created during an MCS Engagement, so we have the solution pack and there are many variables in customsettings.ini.  I will need to find out how to narrow this down but I'm not finding a log file that tells me where it's choking... 
    Any suggestions are appreciated.
    Thanks,
    FP

  • How can I display an Internal from a frame

    Hello,
    I have a frame application, inside the frame I have a jtable. when the users double click on a row from the table. I want to display an internalJFrame, which contain a tree with data on it. I try different combination with no luck. Below is the code where I am calling the internalJFrame and the internalJFrame code. Thank you for your help.
    if (e.getClickCount () == 2) {
    try {
    String tempID = jTable1.getValueAt(jTable1.getSelectedRow(), 0).toString();
    selectedID = Long.parseLong(tempID);
    }catch (NumberFormatException nfe) {
    hierarchicalPanel = new HierarchicalPanel(selectedID);
    hierarchicalPanel.setAddedToDesktop (true);
    desktop.add(hierarchicalPanel);
    hierarchicalPanel.setVisible(true);
    private HierarchalView hierarchalView;
    //tree stuff
    private DefaultMutableTreeNode root = null;
    private DefaultTreeModel treeModel;
    private CommRecord commRec;
    private InstalledComponent installedAComponent;
    private InstalledComponent installedZComponent;
    private static boolean addedToDesktop;
    /** Creates new form Hierarchical */
    public HierarchicalPanel(long sipID) {
    initComponents();
    hierarchalView = new HierarchalView();
    createNodes(sipID);
    createTree();
    * create a JTree
    public void createTree() {
    jTree1 = new JTree(treeModel);
    jTree1.putClientProperty("JTree.lineStyle", "Angled");
    jTree1.getSelectionModel()
    .setSelectionMode(TreeSelectionModel
    .DISCONTIGUOUS_TREE_SELECTION);
    jTree1.setOpaque(false);
    // tree.setCellRenderer(new AlphaRenderer());
    jTree1.expandRow(0);
    //this.llistenToTree(treeModel);
    //popup();
    //return tree;
    * Add nodes to model
    public void createNodes(long sipID){
    DefaultMutableTreeNode root = null;
    DefaultMutableTreeNode node = null;
    DefaultMutableTreeNode child = null;
    commRec = hierarchalView.getComRec(sipID);
    long aComponentID = commRec.getSiteAInstalledComponent().getId();
    long zComponentID = commRec.getSiteZInstalledComponent().getId();
    long comID = commRec.getId();
    //String desc = getSipData(sipID).getCustomerName();
    root = new DefaultMutableTreeNode("SIP ID" + sipID);
    treeModel = new DefaultTreeModel(root);
    node = new DefaultMutableTreeNode("Communication ID");
    root.add(node);
    child = new DefaultMutableTreeNode("A InstallComponent " + aComponentID );
    node.add(child);
    child = new DefaultMutableTreeNode("Z InstallComponent " + zComponentID );
    node.add(child);
    System.out.println("finish inside node********");
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    jTree1 = new javax.swing.JTree();
    jPanel1.setLayout(new java.awt.BorderLayout());
    jPanel1.setMinimumSize(new java.awt.Dimension(5, 100));
    jPanel1.setPreferredSize(new java.awt.Dimension(5, 100));
    jTree1.setMaximumSize(new java.awt.Dimension(78, 50));
    jTree1.setMinimumSize(new java.awt.Dimension(80, 20));
    jTree1.setPreferredSize(new java.awt.Dimension(100, 50));
    jPanel1.add(jTree1, java.awt.BorderLayout.CENTER);
    getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
    pack();
    * Called whenever the value of the selection changes.
    * @param e the event that characterizes the change.
    public void valueChanged(TreeSelectionEvent e) {
    /** Getter for property addedToDesktop.
    * @return Value of property addedToDesktop.
    public boolean isAddedToDesktop () {
    return addedToDesktop;
    /** Setter for property addedToDesktop.
    * @param addedToDesktop New value of property addedToDesktop.
    public void setAddedToDesktop (boolean addedToDesktop) {
    this.addedToDesktop = addedToDesktop;

    If you have a local html file, or open an image locally from the menu, then yes, it works, but with web pages that are served from a remote location (web server), security kicks in and prevents the web page from accessing local files (and files on a networked drive).
    you will either have to put the image on the web server and access it through http, or you can load it into the database/workspace images and access it that way.

  • Data from a frame to another (bis)

    Hi,
    I have a first Frame DataPanelCli, when I use the button "Rechercher" in the class ButtonPanelCli, I find the informations of my company in the class FindRecCli. After when I use the button "STRUCTURE", I use the JFrame StructRecCli BUT I CAN NOT show the data coming from my first Frame.
    Here is the programme, could you please help me.
    regards.
    Thierry
    import java.util.*;
    import java.sql.*;
    import java.io.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.Container;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.text.*;
    import java.lang.String;
    public class AppClient extends JFrame {
         private DataPanelCli screenvarcli;
         private JTextArea msgout;
         private Connection dbconn;
         public AppClient() {
              //titre fen�tre
              super( " APPLICATION CLIENT");
              // set up GUI environment
              Container p = getContentPane();
              screenvarcli = new DataPanelCli();
              msgout = new JTextArea( 8, 40);
              p.setLayout( new FlowLayout() );
              p.add( new JScrollPane(screenvarcli) );
              p.add( new JScrollPane(msgout) );
              // DB Connection
              try {
                   String url = "jdbc:odbc:Access";
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   // Cr�ation d'une liaison
                   dbconn = DriverManager.getConnection(url, "dba", "sql" );
                   msgout.append("Connection successful !\n");
              catch (ClassNotFoundException cnfex) {
                   cnfex.printStackTrace();
                   msgout.append("Connection unsuccessful\n" +
                        cnfex.toString());
              catch (SQLException sqlex) {
                   sqlex.printStackTrace();
                   msgout.append("Connection unsuccessful\n" +
                        sqlex.toString());
              catch (Exception excp) {
                   excp.printStackTrace();
                   msgout.append(excp.toString());
              // Complete GUI
              ButtonPanelCli controls = new
              ButtonPanelCli(dbconn, screenvarcli, msgout);
              p.add(controls);
    //          RadioButtons rb = new RadioButtons(dbconn, screenvarcli, msgout);
    //          p.add(rb);
              setSize(500,475);
              show();
         public static void main( String args[]) {
              AppClient cli = new AppClient();
              cli.addWindowListener(
                   new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                             System.exit(0);
    class DataPanelCli extends JPanel {
         JTextField ICCliFact, INSociete,
              ILAdresseA, ICPostal, ILLocalite, ICPays;
         JLabel LCCliFact, LNSociete,
              LLAdresseA, LCPostal, LLLocalite, LCPays;
         public DataPanelCli() {
              //Label Panel
              JPanel labelPanelCli = new JPanel();
              labelPanelCli.setLayout( new GridLayout(6, 1));
              LNSociete = new JLabel( "Nom ", 0);
              labelPanelCli.add(LNSociete);
              LCCliFact = new JLabel( "Num�ro Client", 0);
              labelPanelCli.add(LCCliFact);
              LLAdresseA = new JLabel( "Adresse ", 0);
              labelPanelCli.add(LLAdresseA);
              LCPostal = new JLabel( "Code Postal ", 0);
              labelPanelCli.add(LCPostal);
              LLLocalite = new JLabel( "Localite ", 0);
              labelPanelCli.add(LLLocalite);
              LCPays = new JLabel( "Pays ", 0);
              labelPanelCli.add(LCPays);
              //TextField Panel
              JPanel screenvarcliPanel = new JPanel();
              screenvarcliPanel.setLayout( new GridLayout(6, 1));
              INSociete = new JTextField("Enter Name - click RECHERCHER", 20);
              screenvarcliPanel.add(INSociete);
              ICCliFact = new JTextField( 20);
              screenvarcliPanel.add(ICCliFact);
              ILAdresseA = new JTextField( 20);
              screenvarcliPanel.add(ILAdresseA);
              ICPostal = new JTextField( 20);
              screenvarcliPanel.add(ICPostal);
              ILLocalite = new JTextField( 20);
              screenvarcliPanel.add(ILLocalite);
              ICPays = new JTextField( 20);
              screenvarcliPanel.add(ICPays);
              // Accessibility Section - relate labels and text fields
              // for use by assistive technologies
              LNSociete.setLabelFor( INSociete);
              LLAdresseA.setLabelFor( ILAdresseA);
              LCPostal.setLabelFor( ICPostal);
              LLLocalite.setLabelFor( ILLocalite);
              LCPays.setLabelFor( ICPays);
              setLayout( new GridLayout( 1, 2));
              add( labelPanelCli);
              add( screenvarcliPanel);
    class ButtonPanelCli extends JPanel {
         public ButtonPanelCli( Connection dbc, DataPanelCli scv, JTextArea msg ) {
              setLayout( new GridLayout( 2 ,0 ));
              JButton findcli = new JButton( "Rechercher" );
              findcli.addActionListener( new FindRecCli( dbc, scv, msg ));
              add( findcli );
              JButton addcli = new JButton( "Ajouter" );
              addcli.addActionListener( new AddRecCli( dbc, scv, msg ));
              add( addcli );
              JButton clearcli = new JButton( "Clear" );
              clearcli.addActionListener( new ClearScreenCli( scv ));
              add( clearcli );
              JButton printcli = new JButton( "Impression" );
    //          printcli.addActionListener( new PrintRecCli( dbc, scv, msg ));
              add( printcli );
              JButton structcli = new JButton( "STRUCTURE" );
              structcli.addActionListener( new StructRecCli( dbc, scv, msg ));
              add( structcli );
              JButton commerccli = new JButton( "COMMERCIAL" );
    //          commerccli.addActionListener( new CommercRecCli( dbc, scv, msg ));
              add( commerccli );
              JButton financli = new JButton( "FINANCIER" );
    //          financli.addActionListener( new FinanRecCli( dbc, scv, msg ));
              add( financli );
    class ClearScreenCli implements ActionListener {
         private DataPanelCli screenvarcli;
         public ClearScreenCli( DataPanelCli scv ) {
              screenvarcli = scv;
         public void actionPerformed( ActionEvent e ) {
              screenvarcli.ICCliFact.setText( "" );
              screenvarcli.INSociete.setText( "" );
              screenvarcli.ILAdresseA.setText( "" );
              screenvarcli.ICPostal.setText( "" );
              screenvarcli.ILLocalite.setText( "" );
              screenvarcli.ICPays.setText( "" );
    // Recherche Ajout Maj record
    // FIND NUMERO CLIENT
    class FindRecCli implements ActionListener {
         private DataPanelCli screenvarcli;
         private JTextArea msgout;
         private Connection dbconn;
         public FindRecCli( Connection dbc, DataPanelCli scv, JTextArea msg ) {
              dbconn = dbc;
              screenvarcli = scv;
              msgout = msg;
         public void actionPerformed( ActionEvent e ) {
              try {
                   String rechnom = new String();
                   rechnom = screenvarcli.INSociete.getText();
              if ( !rechnom.equals( "" )) {
                   Statement statement = dbconn.createStatement();
                   String query = "SELECT * " +
                        "FROM Cli_fact, Adresse " +
                        "WHERE Cli_fact.n_societe_c = '" + rechnom + "' " +
                        "AND c_adresse = c_cli_fact " +
                        "AND c_type_adr = '02'";
    //                    "WHERE n_societe_c = '" +
    //                    rechnom + "' ";
                   msgout.append( "\nSending query " +
                   dbconn.nativeSQL( query ) + "\n" );
                   ResultSet rs = statement.executeQuery( query );
                   display( rs );
                   statement.close();
              else
                   screenvarcli.INSociete.setText( "Entrer le NOM de Soci�t� ");
              catch ( SQLException sqlex ) {
                   msgout.append( sqlex.toString() + sqlex.getMessage() );
         // Display results of query
         public void display( ResultSet rs ) {
              try {
                   rs.next();
                   int recordNumber = rs.getInt( 1);
                   if ( recordNumber != 0 ) {
                        screenvarcli.ICCliFact.setText( String.valueOf(recordNumber) );
                        screenvarcli.INSociete.setText( rs.getString(2));
                        screenvarcli.ILAdresseA.setText( rs.getString(35));
                        screenvarcli.ILLocalite.setText( rs.getString(32));
                        screenvarcli.ICPostal.setText( rs.getString(31));
                        screenvarcli.ICPays.setText( rs.getString(33));
                        msgout.append( "\n Enregistrements trouv�s!!!!!!!\n" );
                   else
                        msgout.append( "\nPas d'enregistrements trouv�s\n" );
              catch ( SQLException sqlex ) {
                   msgout.append( "\n*** Nom de Soci�t� pas dans la data Base ***\n" );
    // ADD CLIENT
    class AddRecCli implements ActionListener {
         private DataPanelCli screenvarcli;
         private JTextArea msgout;
         private Connection dbconn;
         public AddRecCli( Connection dbc, DataPanelCli scv, JTextArea msg ) {
              dbconn = dbc;
              screenvarcli = scv;
              msgout = msg;
         public void actionPerformed( ActionEvent e ) {
              try {
              Statement statement = dbconn.createStatement();
              String rechnom = new String();
              rechnom = screenvarcli.INSociete.getText();
              if ( !rechnom.equals( "" )) {
                   String query = "INSERT INTO cli_fact (" +
                   "n_societe_c) VALUES ('" +
                   screenvarcli.INSociete.getText() + "')";
                   msgout.append( "\nSending query " +
                   dbconn.nativeSQL( query ) + "\n" );
                   int result = statement.executeUpdate( query );
                   if ( result == 1 ) {
                   // read just inserted rec to obtain c_cli_fact field
                   // needed to place STRUCTURE COMMERCIAL FINANCIER
                   msgout.append( "\nInsertion r�ussie\n" );
                   try {
                   query = "SELECT * FROM cli_fact WHERE n_societe_c='" +
                        rechnom + "'";
                   ResultSet rs = statement.executeQuery( query );
                   rs.next();
                   screenvarcli.ICCliFact.setText(String.valueOf(rs.getInt(1)));
                   catch ( SQLException sqlex ) {
                   msgout.append( sqlex.toString() );
              else {
                   msgout.append( "\nInsertion NON r�ussie\n" );
                   screenvarcli.INSociete.setText( "" );
              else
              msgout.append( "\nEntrer au moins le non de soci�t� puis press NOUVEAU\n" );
              statement.close();
              catch ( SQLException sqlex ) {
              msgout.append( sqlex.toString() );
              screenvarcli.INSociete.setText("Nom de soci�t� existe d�j� -- reenter");
    // STRUCTURE
    //class StructRecCli extends JFrame implements ActionListener {
    class StructRecCli implements ActionListener {
         private DataPanelCli screenvarcli;
         private JTextArea msgout;
         private Connection dbconn;
         private boolean firsttime = true;
         public StructRecCli( Connection dbc, DataPanelCli scv, JTextArea msg ) {
              super( " APPLICATION CLIENT STUCTURE " );
              dbconn = dbc;
              screenvarcli = scv;
              msgout = msg;
         public void actionPerformed( ActionEvent e) {
              if (firsttime) {
                   Container cnt = getContentPane();
                   cnt.setLayout( new FlowLayout() );
                   StruCliBox ob = new StruCliBox();
                   cnt.add( ob );
         screenvarcli.INSociete.getText();
                   ButtonPanelStr controls = new
                   ButtonPanelStr(dbconn, screenvarcli, msgout);
                   cnt.add(controls);
                   setSize(500, 475);
                   firsttime = false;
              show();
    class StruCliBox extends JPanel {
         JTextField ICCliFact, INSociete,
              ILAdresseA, ICPostal, ILLocalite, ICPays;
         JLabel LCCliFact, LNSociete,
              LLAdresseA, LCPostal, LLLocalite, LCPays;
         public StruCliBox() {
              //Label Panel
              JPanel s = new JPanel();
              s.setLayout( new GridLayout(6, 1));
              LNSociete = new JLabel( "Nom ", 0);
              s.add(LNSociete);
              LCCliFact = new JLabel( "Num�ro Client", 0);
              s.add(LCCliFact);
              LLAdresseA = new JLabel( "Adresse ", 0);
              s.add(LLAdresseA);
              LCPostal = new JLabel( "Code Postal ", 0);
              s.add(LCPostal);
              LLLocalite = new JLabel( "Localite ", 0);
              s.add(LLLocalite);
              LCPays = new JLabel( "Pays ", 0);
              s.add(LCPays);
              //TextField Panel
              JPanel screenvarcliPanel = new JPanel();
              screenvarcliPanel.setLayout( new GridLayout(6, 1));
              INSociete = new JTextField( 20);
              screenvarcliPanel.add(INSociete);
    //          String rechnom = new String();
    //          screenvarcli.INSociete.getText();
              ICCliFact = new JTextField( 20);
              screenvarcliPanel.add(ICCliFact);
              ILAdresseA = new JTextField( 20);
              screenvarcliPanel.add(ILAdresseA);
              ICPostal = new JTextField( 20);
              screenvarcliPanel.add(ICPostal);
              ILLocalite = new JTextField( 20);
              screenvarcliPanel.add(ILLocalite);
              ICPays = new JTextField( 20);
              screenvarcliPanel.add(ICPays);
              // Accessibility Section - relate labels and text fields
              // for use by assistive technologies
    //          LNSociete.setLabelFor( INSociete);
              LLAdresseA.setLabelFor( ILAdresseA);
              LCPostal.setLabelFor( ICPostal);
              LLLocalite.setLabelFor( ILLocalite);
              LCPays.setLabelFor( ICPays);
              setLayout( new GridLayout( 1, 2));
              add( s);
              add( screenvarcliPanel);
    //          setLayout(new FlowLayout() );
    //          add(s);     
    class ButtonPanelStr extends JPanel {
         public ButtonPanelStr( Connection dbc, DataPanelCli scv, JTextArea msg ) {
              setLayout( new GridLayout( 1 ,0 ));
              JButton addstr = new JButton("Ajouter");
    //          addstr.addActionListener( new AddStructure( dbconn, screenvarcli, msgout, ob));
              add( addstr );
              JButton majstr = new JButton("Mise � jour");
    //          majstr.addActionListener( new MajStructure( dbconn, screenvarcli, msgout, ob));
              add( majstr );
              JButton clestr = new JButton("Clear");
    //          clestr.addActionListener( new CleStructure( dbconn, screenvarcli, msgout, ob));
              add( clestr );
              JButton prnstr = new JButton("Impression");
    //          prnstr.addActionListener( new PrnStructure( dbconn, screenvarcli, msgout, ob));
              add( prnstr );
         // Fermeture de l'application
    //     protected void processWindowEvent(WindowEvent e) {
    //          if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    //               System.exit(0);

    To get data from one frame to another, either create one frame with a reference to the other one so it can discover the data in it, or create a static variable in one of your classes that both frames can access

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • HELP ME i need to pass String variables from one Frame to another

    I need help with some code.
    i need to pass a set of string values from one frame to another.
    from the mainscreen i need to pass what type of seats the user has requested this is done by radio buttons. i need this information to then be passed onto the next frame called Mydialog1 and placed in a textbox with label st. it dosn't comple and i don't know why
    this is getting me depressed. I need some serious help with this
    can anybody get this to work??
    here is the code
    Mainscreen1 code
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mainscreen1 extends Applet implements ItemListener,
    ActionListener
    private Image layout1;
    private int frame;
    private int xpos,ypos,xdir,ydir;
    public TextField tn, tt1, tt2, total;
    public int value, ticketnum, sum, nr_seats, ctot;
    public Label title, seat, need, payable;
    public Button b1, b2, b3;
    Mydialog1 d;
    String stype, c1, sr;
    public void init()
         setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
    //Mydialog1.mehod(sr);
    title=new Label("The Almeida Theater booking system");
         title.setBounds(100,0,400,30);
         title.setFont(new Font("Verdana", Font.PLAIN,24));
         add(title);
    seat=new Label("Please choose a seating location:");
         seat.setBounds(300,40,190,20);
         seat.setFont(new Font("Verdana", Font.BOLD,12));
         add(seat);
    payable=new Label("Total Payable:�");
         payable.setBounds(300,390,100,20);
         payable.setFont(new Font("Verdana", Font.BOLD,12));
         add(payable);
         need=new Label("Please enter the number of seats needed:");
         need.setBounds(300,180,245,20);
         need.setFont(new Font("Verdana", Font.BOLD,12));
         add(need);
         CheckboxGroup sr = new CheckboxGroup();
         Checkbox Stalls = new Checkbox("Stalls", true, sr);
         Stalls.setBounds(490,40,60,25);
         add(Stalls);
         Stalls.addItemListener(this);
         Checkbox Balcony = new Checkbox("Balcony", false, sr);
         Balcony.setBounds(490,65,65,25);
         add(Balcony);
         Balcony.addItemListener(this);
         Checkbox Concessions = new Checkbox("Concessions", false,
    sr);
         Concessions.setBounds(490,90,94,25);
         add(Concessions);
         Concessions.addItemListener(this);
    Button b1=new Button("Quote");
         b1.setBounds(20,395,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Confirm booking");
         b2.setBounds(110,395,100,30);
         add(b2);
         b2.addActionListener( this );
         Button b3=new Button("Clear");
         b3.setBounds(480,410,100,30);
         add(b3);
         b3.addActionListener( this );
         tt1=new TextField(60);
         tt1.setBounds(300,250,270,20);
    add(tt1);
         tt1.setEditable (false);
         tt1.addActionListener(this);
         tt2=new TextField(60);
         tt2.setBounds(300,300,150,20);
         add(tt2);
         tt2.setEditable (false);
         tt2.addActionListener(this);
         tn=new TextField(3);
         tn.setBounds(545,180,30,20);
         add(tn);
         tn.addActionListener(this);
         total=new TextField(5);
         total.setBounds(400,390,45,20);
         add(total);
         total.setEditable (false);
         total.addActionListener(this);
         xpos = getSize().width/-1400;
         ypos = getSize().height/12;
         layout1 = getImage(getDocumentBase(),"layout1.gif");
         repaint();
    public void itemStateChanged(ItemEvent e)
         String c1 = (String) e.getItem();
         if (c1 == "Stalls")
              value = 20;
         else if (c1 == "Balcony")
              value = 15;
         else
              value = 10;
         tt1.setText("You have chosen to sit in the " + c1 + "
    area");
         tt2.setText("Each seat will cost: �" + value);
         repaint();
    public void clearValue()
              //cb.setSelectiob
              total.setText("");
              tt1.setText("");
              tt2.setText("");
              tn.setText("");
    public void actionPerformed ( ActionEvent e )
    if( e.getActionCommand() == "Quote" )
         int nr_seats = Integer.parseInt(tn.getText());
         total.setText("" +nr_seats*value);
    else if( e.getActionCommand() == "Confirm booking")
         int nr_seats = Integer.parseInt(tn.getText());
         int ctot = Integer.parseInt(total.getText());
         //String stype = String.parseString(c1.getText());
         total.setText("" +nr_seats*value);   
         d = new Mydialog1();      
         d.set_text(nr_seats);
         d.set_texts(ctot);
         stype = sr.getSelectedItem();
    else if ( e.getActionCommand() == "Clear")
         clearValue();
              ticketnum = Integer.parseInt(tn.getText());
              repaint();
         public void paint(Graphics g)
              g.setColor(Color.black);
              g.drawString ("You have chosen:" + ticketnum +"
    seats", 300, 365);
              g.drawImage(layout1,xpos,ypos,null);
    Mydialog1 code
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Mydialog1 extends Frame implements ItemListener,
    ActionListener
    public Label title, custd, custd1, custfn, custad, custsn, custpc,
    custph, custem, custem1, need;
    public Button b1, b2, b3;
    public TextField cfnt, csnt, cdt,cdt2,cdt3,cdt4, tf, tt, st,
    cpct, cph, cem;
    public int value, nr_seats, ctot;
    creditcard cc;
    String stype, c;
    public Mydialog1() //constructor
         init();
    public void init()
         custer(String c)
         stype = c;
         setBackground(Color.yellow);
    setSize (500, 500);
    setLayout(null);
         setLocation(320,140);
         setVisible(true);
         //Mydialog1(Frame f);
    title=new Label("The Almeida Theater booking system");
         title.setBounds(70,20,400,30);
         title.setFont(new Font("Verdana", Font.PLAIN,24));
         add(title);
         CheckboxGroup ct = new CheckboxGroup();
         Checkbox Mr = new Checkbox("Mr", true, ct);
         Mr.setBounds(5,190,36,25);
         add(Mr);
         Mr.addItemListener(this);
         Checkbox Mrs = new Checkbox("Mrs", false, ct);
         Mrs.setBounds(50,190,42,25);
         add(Mrs);
         Mrs.addItemListener(this);
         Checkbox Miss = new Checkbox("Miss", false, ct);
         Miss.setBounds(95,190,45,25);
         add(Miss);
         Miss.addItemListener(this);
    custd=new Label("If above booking details are correct please
    fill in your deatils below");
         custd.setBounds(5,140,400,30);
         add(custd);
         custd1=new Label("If they are incorrect please click on
    close and re-book seats.");
         custd1.setBounds(5,160,400,30);
         add(custd1);
         custfn=new Label("*ForeName:");
         custfn.setBounds(5,220,60,20);
         add(custfn);
         cfnt=new TextField(60);
         cfnt.setBounds(70,220,150,20);
    add(cfnt);
         custsn=new Label("*SurName:");
         custsn.setBounds(230,220,60,20);
         add(custsn);
         csnt=new TextField(60);
         csnt.setBounds(300,220,150,20);
    add(csnt);
         custad=new Label("*Address:");
         custad.setBounds(5,250,55,20);
         add(custad);
         cdt=new TextField(60);
         cdt.setBounds(70,250,180,20);
    add(cdt);
         cdt2=new TextField(60);
         cdt2.setBounds(70,270,180,20);
    add(cdt2);
         cdt3=new TextField(60);
         cdt3.setBounds(70,290,180,20);
    add(cdt3);
         cdt4=new TextField(60);
         cdt4.setBounds(70,310,180,20);
    add(cdt4);
         custpc=new Label("*Postcode:");
         custpc.setBounds(5,330,60,20);
         add(custpc);
         cpct=new TextField(60);
         cpct.setBounds(70,330,180,20);
    add(cpct);
         custph=new Label("*Telephone:");
         custph.setBounds(5,360,65,20);
         add(custph);
         cph=new TextField(60);
         cph.setBounds(70,360,180,20);
    add(cph);
         custem=new Label("E-mail:");
         custem.setBounds(5,390,65,20);
         add(custem);
         cem=new TextField(60);
         cem.setBounds(70,390,180,20);
    add(cem);
         custem1=new Label("eg: [email protected]");
         custem1.setBounds(250,390,150,20);
         add(custem);
         need=new Label("* = required field.");
         need.setBounds(350,400,150,20);
         add(need);
         //seat number being pased into this textbox
         tf = new TextField();
    tf.setBounds(5, 80, 160,20);
         tf.setEditable (false);
    add(tf);
         //seat number being pased into this textbox
         tt = new TextField();
    tt.setBounds(5, 100, 160,20);
         tt.setEditable (false);
    add(tt);
         //seat number being pased into this textbox
         st = new TextField(stype);
    st.setBounds(5, 120, 230,20);
         st.setEditable (false);
    add(st);
         setVisible(true);
         Button b1=new Button("Close");
         b1.setBounds(20,440,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Proced with booking");
         b2.setBounds(110,440,150,30);
         add(b2);
         b2.addActionListener( this );
         Button b3=new Button("Clear");
         b3.setBounds(350,440,100,30);
         add(b3);
         b3.addActionListener( this );
    public void itemStateChanged(ItemEvent e)
         String c2 = (String) e.getItem();
         if (c2 == "Mr")
              value = 20;
         else if (c2 == "Mrs")
              value = 15;
         else
              value = 10;
    public void clearValuea()
              //cb.setSelectiob
              cem.setText("");
              cph.setText("");
              cdt.setText("");
              cdt2.setText("");
              cdt3.setText("");
              cdt4.setText("");
              cfnt.setText("");
              csnt.setText("");
              cpct.setText("");
              cph.setText("");
              cem.setText("");
    public void actionPerformed( ActionEvent e )
    if( e.getActionCommand() == "Close" )
    this.dispose();
    else if( e.getActionCommand() == "Proced with booking")
    cc = new creditcard();
    else if( e.getActionCommand() == "Clear")
    clearValuea();
         public void set_text (int nr_seats)
         tf.setText (" You have booked " + nr_seats + " seat/s");
         public void set_texts (int ctot)
         tt.setText (" The total is � " + ctot);
         public void SetTextField(String c1)
         st.setText(c1);
    creditcard
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class creditcard extends Frame implements ActionListener
         public Label title, ccd1, ccfn;
         public Button b1, b2;
         public TextField cnt, cdt, ccfnt;
         public String cfnt;
    public creditcard() //constructor
         init();
    public void init()
         setBackground(Color.green);
    setSize (500, 500);
    setLayout(null);
         setLocation(320,140);
         setVisible(true);
         //Mydialog1(Frame f);
    title=new Label("The Almeida Theater booking system");
         title.setBounds(70,20,400,30);
         title.setFont(new Font("Verdana", Font.PLAIN,24));
         add(title);
         ccd1=new Label("If billing address is different please edit below information.");
         ccd1.setBounds(5,50,400,20);
         ccd1.setFont(new Font("Verdana", Font.BOLD,12));
         add(ccd1);
         ccfn=new Label("*ForeName:");
         ccfn.setBounds(5,220,60,20);
         add(ccfn);
         ccfnt=new TextField(60);
         ccfnt.setBounds(70,220,150,20);
    add(ccfnt);
         Button b1=new Button("Close");
         b1.setBounds(20,440,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Proced with booking");
         b2.setBounds(110,440,150,30);
         add(b2);
         b2.addActionListener( this );
    public void actionPerformed( ActionEvent e )
    if( e.getActionCommand() == "Close" )
    this.dispose();
    else if( e.getActionCommand() == "Proced with booking")
    setBackground(Color.red);

    Here's the new mainscreen1.java file...
    public class mainscreen1 extends Applet implements ItemListener,
    ActionListener
      private Image layout1;
      private int frame;
      private int xpos,ypos,xdir,ydir;
      public TextField tn, tt1, tt2, total;
      public int value, ticketnum, sum, nr_seats, ctot;
      public Label title, seat, need, payable;
      public Button b1, b2, b3;
      Mydialog1 d;
      CheckboxGroup checkGroup; // heres the new global CheckboxGroup variable.
      String stype, c1, dialogString; // new name for the string too...
      public void init()
        setBackground(Color.pink);
        setSize(600, 460);
        setLayout(null);
        //dialogString = "Hi";
        //Mydialog1.mehod(dialogString);
        title=new Label("The Almeida Theater booking system");
        title.setBounds(100,0,400,30);
        title.setFont(new Font("Verdana", Font.PLAIN,24));
        add(title);
        seat=new Label("Please choose a seating location:");
        seat.setBounds(300,40,190,20);
        seat.setFont(new Font("Verdana", Font.BOLD,12));
        add(seat);
        payable=new Label("Total Payable:�");
        payable.setBounds(300,390,100,20);
        payable.setFont(new Font("Verdana", Font.BOLD,12));
        add(payable);
        need=new Label("Please enter the number of seats needed:");
        need.setBounds(300,180,245,20);
        need.setFont(new Font("Verdana", Font.BOLD,12));
        add(need);
        checkGroup = new CheckboxGroup(); // instantiate the global CheckboxGroup
        Checkbox Stalls = new Checkbox("Stalls", true, checkGroup); // add to the CheckboxGroup
        Stalls.setBounds(490,40,60,25);
        add(Stalls);
        Stalls.addItemListener(this);
        Checkbox Balcony = new Checkbox("Balcony", false, checkGroup);
        Balcony.setBounds(490,65,65,25);
        add(Balcony);
        Balcony.addItemListener(this);
        Checkbox Concessions = new Checkbox("Concessions", false, checkGroup);
        Concessions.setBounds(490,90,94,25);
        add(Concessions);
        Concessions.addItemListener(this);
        Button b1=new Button("Quote");
        b1.setBounds(20,395,80,30);
        add(b1);
        b1.addActionListener( this );
        Button b2=new Button("Confirm booking");
        b2.setBounds(110,395,100,30);
        add(b2);
        b2.addActionListener( this );
        Button b3=new Button("Clear");
        b3.setBounds(480,410,100,30);
        add(b3);
        b3.addActionListener( this );
        tt1=new TextField(60);
        tt1.setBounds(300,250,270,20);
        add(tt1);
        tt1.setEditable(false);
        tt1.addActionListener(this);
        tt2=new TextField(60);
        tt2.setBounds(300,300,150,20);
        add(tt2);
        tt2.setEditable(false);
        tt2.addActionListener(this);
        tn=new TextField(3);
        tn.setBounds(545,180,30,20);
        add(tn);
        tn.addActionListener(this);
        total=new TextField(5);
        total.setBounds(400,390,45,20);
        add(total);
        total.setEditable(false);
        total.addActionListener(this);
        xpos = getSize().width/-1400;
        ypos = getSize().height/12;
        layout1 = getImage(getDocumentBase(),"layout1.gif");
        repaint();
      public void itemStateChanged(ItemEvent e) {
        String c1 = (String) e.getItem();
        if (c1 == "Stalls") {
          value = 20;
        else if (c1 == "Balcony") {
          value = 15;
        else {
          value = 10;
        tt1.setText("You have chosen to sit in the " + c1 + " area");
        tt2.setText("Each seat will cost: �" + value);
        repaint();
      public void clearValue() {
        //cb.setSelectiob
        total.setText("");
        tt1.setText("");
        tt2.setText("");
        tn.setText("");
      public void actionPerformed( ActionEvent e ) {
        if( e.getActionCommand() == "Quote" ) {
          int nr_seats = Integer.parseInt(tn.getText());
          total.setText("" +nr_seats*value);
        else if( e.getActionCommand() == "Confirm booking") {
          int nr_seats = Integer.parseInt(tn.getText());
          int ctot = Integer.parseInt(total.getText());
          total.setText("" +nr_seats*value);
          d = new Mydialog1();
          d.set_text(nr_seats);
          d.set_texts(ctot);
          // You can do your checkbox selection data transfer here like this...
          // I used d.SetTextField because you had that defined in the Mydialog1 class.
          Checkbox chkBx = checkGroup.getSelectedCheckbox();
          d.SetTextField(chkBx.getLabel());
        else if ( e.getActionCommand() == "Clear") {
          clearValue();
        ticketnum = Integer.parseInt(tn.getText());
        repaint();
      public void paint(Graphics g)
        g.setColor(Color.black);
        g.drawString("You have chosen:" + ticketnum +" seats", 300, 365);
        g.drawImage(layout1,xpos,ypos,null);
    }

  • Image creation failed?

    Trying to create a NetRestore image.
    Used SuperDuper to repair peremissions and create DMG of Client Zero HD
    Ran SIU. Log Follows. Seemed to be going OK but hung at this point, or was I too impatient to wait any longer? had been sitting there for 20+ minutes before I Quit SIU...
    Any pointers, please?
    Starting image creation.
    Workflow Started (2011-03-17 08:47:57 +0000)
    Mac OS X Server 10.6.6 (10J567), System Image Utility 10.6.5 (447)
    Starting action: Define Image Source (1.2)
    Finished running action: Define Image Source
    Starting action: Create Image (1.5.3)
    Starting image creation process...
    Create NetInstall Image
    Initiating NetInstall from Restore Media.
    progressPrefix="_progress"
    ++ progressPrefix=_progress
    scriptsDebugKey="DEBUG"
    ++ scriptsDebugKey=DEBUG
    imageIsUDIFKey="1"
    ++ imageIsUDIFKey=1
    mountPoint="/tmp/mnt.pde0nj"
    ++ mountPoint=/tmp/mnt.pde0nj
    ownershipInfoKey="505:20"
    ++ ownershipInfoKey=505:20
    mkextPathKey="/System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mk ext"
    ++ mkextPathKey=/System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mk ext
    sourceVol="/Volumes/Macintosh HD 1"
    ++ sourceVol='/Volumes/Macintosh HD 1'
    skipFileChecksumKey="0"
    ++ skipFileChecksumKey=0
    dmgTarget="NetInstall"
    ++ dmgTarget=NetInstall
    destPath="/image in here/NetRestore ofRolloutDMG"
    ++ destPath='/image in here/NetRestore ofRolloutDMG'
    asrSource="ASRInstall.pkg"
    ++ asrSource=ASRInstall.pkg
    blockCopyDeviceKey="0"
    ++ blockCopyDeviceKey=0
    . "$1/createCommon.sh"
    + . /tmp/niutemp.laZrfc41/createCommon.sh
    # createCommon.sh
    # Common functionality for the Image creation process.
    # sourced in by the various SIU scripts
    # Copyright 2007 Apple Inc. All rights reserved.
    # Using dscl, create a user account
    AddLocalUser()
    # $1 long name
    # $2 short name
    # $3 isAdminUser key
    # $4 password hash
    # $5 user picture path
    # $6 Language string
    local databasePath="/Local/Target/Users/${2}"
    # Find a free UID between 501 and 599
    for ((i=501; i<600; i++)); do
    output=`/usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -search /Local/Target/Users UniqueID $i`
    # If there is already an account dscl returns it, so we're looking for an empty return value.
    if [ "$output" == "" ]; then
    break
    fi
    done
    # Create the user record
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -create $databasePath || exit 1
    # Add long name
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath RealName "${1}" || exit 1
    # Add PrimaryGroupID
    if [ "${3}" == 1 ]; then
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath PrimaryGroupID 80 || exit 1
    else
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath PrimaryGroupID 20 || exit 1
    fi
    # Add UniqueID
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath UniqueID ${i} || exit 1
    # Add Home Directory entry
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath dsAttrTypeNative:home /Users/${2} || exit 1
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath authentication_authority ";ShadowHash;" || exit 1
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath picture "${5}" || exit 1
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath passwd "*" || exit 1
    # Add shell
    /usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -append $databasePath UserShell "/bin/bash" || exit 1
    # lookup generated uid
    genUID=`/usr/bin/dscl -f "${mountPoint}/var/db/dslocal/nodes/Default" localonly -read /Local/Target/Users/${2} GeneratedUID` || exit 1
    genUID=${genUID:14:36}
    # make sure the shadow/hash directory exists
    if [ ! -e "${mountPoint}/var/db/shadow/hash" ] ; then
    /bin/mkdir -p "${mountPoint}/var/db/shadow/hash" || exit 1
    /bin/chmod -R 700 "${mountPoint}/var/db/shadow" || exit 1
    fi
    # to copy our password hash in there...
    echo "${4}" > "${mountPoint}/var/db/shadow/hash/$genUID"
    /bin/chmod 600 "${mountPoint}/var/db/shadow/hash/$genUID" || exit 1
    # Create Home directory
    if [ -e "/System/Library/User Template/${6}.lproj/" ]; then
    /usr/bin/ditto "/System/Library/User Template/${6}.lproj/" "${mountPoint}/Users/${2}" || exit 1
    else
    /usr/bin/ditto "/System/Library/User Template/English.lproj/" "${mountPoint}/Users/${2}" || exit 1
    fi
    /usr/sbin/chown -R $i:$i "${mountPoint}/Users/${2}" || exit 1
    # If they exist, apply any Append.bom changes
    ApplyAppendBom()
    local tempDir="$1"
    local srcVol="$2"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    if [ -e "$tempDir/Append.bom" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Applying Append.bom additions from System Image Utility"
    fi
    /usr/bin/ditto $opt -bom "$tempDir/Append.bom" "$srcVol" "${mountPoint}" || exit 1
    fi
    if [ -e "$srcVol/Library/Application Support/Apple/System Image Utility/Append.bom" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Applying Append.bom additions from $srcVol"
    fi
    /usr/bin/ditto $opt -bom "$srcVol/Library/Application Support/Apple/System Image Utility/Append.bom" "$srcVol" "${mountPoint}" || exit 1
    fi
    # Copies a list of packages (full paths contained in the file at $1) from source to .../System/Installation/Packages/
    CopyPackagesFromFile()
    local theFile="$1"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    while read FILE
    do
    if [ -e "${FILE}" ]; then
    local leafName=`basename "${FILE}"`
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Copying ${FILE}."
    fi
    /usr/bin/ditto $opt "${FILE}" "${mountPoint}/System/Installation/Packages/${leafName}" || exit 1
    fi
    done < "
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    while read FILE
    do
    if [ -e "${FILE}" ]; then
    local leafName=`basename "${FILE}"`
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Copying ${FILE}."
    fi
    read SUB_PATH
    /usr/bin/ditto $opt "${FILE}" "${mountPoint}/System/Installation/Packages/${SUB_PATH}${leafName}" || exit 1
    fi
    done < "${theFile}"
    # Create the dyld shared cache files
    CreateDyldCaches()
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Creating dyld shared cache files"
    # This spews too much for verbose mode... only enable for debug
    if [ "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-debug"
    fi
    fi
    /usr/bin/updatedyld_sharedcache -root "${mountPoint}" -universal_boot -force $opt
    # Validate or create the destination directory and mount point
    CreateOrValidateDestination()
    local destDir="$1"
    if [ ! -d "$destDir" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Creating working path at $destDir"
    fi
    /bin/mkdir -p "$destDir" || exit 1
    fi
    # Create mount point
    if [ ! -d "${mountPoint}" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Creating mountpoint for in $destDir"
    fi
    /bin/mkdir -p "${mountPoint}" || exit 1
    fi
    # If any exist, apply any user accounts
    CreateUserAccounts()
    local count="${#userFullName[*]}"
    if [ $count -gt 0 ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Adding $count user account(s) to the image"
    fi
    for ((index=0; index<$count; index++)); do
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Adding user ${userFullName[$index]}"
    fi
    #lay down user here
    AddLocalUser "${userFullName[$index]}" "${userUnixName[$index]}" "${userIsAdmin[$index]}" "${userPassHash[$index]}" "${userImagePath[$index]}" "${userLanguage[$index]}"
    done
    # "touch"
    /usr/bin/touch "${mountPoint}/private/var/db/.AppleSetupDone"
    /usr/bin/touch "${mountPoint}/Library/Receipts/.SetupRegComplete"
    fi
    # retry the hdiutil detach until we either time out or it succeeds
    retryhdiutildetach()
    local mount_point="${1}"
    local tries=0
    local forceAt=0
    local limit=24
    local opt=""
    forceAt=$(($limit - 1))
    while [ $tries -lt $limit ]; do
    tries=$(( tries + 1 ))
    /bin/sleep 5
    echo "Attempting to detach the disk image again..."
    /usr/bin/hdiutil detach "${mount_point}" $opt
    if [ $? -ne 0 ]; then
    # Dump a list of any still open files on the mountPoint
    if [ "${scriptsDebugKey}" == "DEBUG" ]; then
    /usr/sbin/lsof +fg "${mount_point}"
    fi
    if [ $tries -eq $forceAt ]; then
    echo "Failed to detach disk image at '${mount_point}' normally, adding -force."
    opt="-force"
    fi
    if [ $tries -eq $limit ]; then
    echo "Failed to detach disk image at '${mount_point}'."
    exit 1
    fi
    else
    tries=$limit
    fi
    done
    # Create the dyld shared cache files
    DetachAndRemoveMount()
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Detaching disk image"
    # Dump a list of any still open files on the mountPoint
    if [ "${scriptsDebugKey}" == "DEBUG" ]; then
    /usr/sbin/lsof +fg "${mountPoint}"
    fi
    fi
    # Finally detach the image and dispose the mountPoint directory
    /usr/bin/hdiutil detach "${mountPoint}" || retryhdiutildetach "${mountPoint}" || exit 1
    /bin/rmdir "${mountPoint}" || exit 1
    # If the pieces exist, enable remote access for the shell image
    EnableRemoteAccess()
    local srcVol="$1"
    local opt=""
    if [ -e "${srcVol}/usr/lib/pam/pam_serialnumber.so.2" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Enabling shell image remote access support"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    # install some things (again which aren't part of BaseSystem) needed for remote ASR installs
    /usr/bin/ditto $opt "${srcVol}/usr/lib/pam/pam_serialnumber.so.2" "${mountPoint}/usr/lib/pam/pam_serialnumber.so.2" || exit 1
    if [ -e "${srcVol}/usr/sbin/installer" ]; then
    /usr/bin/ditto $opt "${srcVol}/usr/sbin/installer" "${mountPoint}/usr/sbin/installer" || exit 1
    fi
    # copy the sshd config and add our keys to the end of it
    if [ -e "${srcVol}/etc/sshd_config" ]; then
    /bin/cat "${srcVol}/etc/sshd_config" - > "${mountPoint}/etc/sshd_config" << END
    HostKey /private/var/tmp/sshhostkey
    HostKey /private/var/tmp/sshhost_rsakey
    HostKey /private/var/tmp/sshhost_dsakey
    END
    fi
    fi
    # If it exists, install the sharing names and/or directory binding support to the install image
    HandleNetBootClientHelper()
    local tempDir="$1"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    if [ -e "$tempDir/bindingNames.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing Directory Service binding information"
    fi
    /usr/bin/ditto $opt "$tempDir/bindingNames.plist" "${mountPoint}/etc/bindingNames.plist" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/etc/bindingNames.plist"
    /bin/chmod 644 "${mountPoint}/etc/bindingNames.plist"
    fi
    if [ -e "$tempDir/sharingNames.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing Sharing Names support"
    fi
    /usr/bin/ditto $opt "$tempDir/sharingNames.plist" "${mountPoint}/etc/sharingNames.plist" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/etc/sharingNames.plist"
    /bin/chmod 644 "${mountPoint}/etc/sharingNames.plist"
    fi
    if [ -e "$tempDir/NetBootClientHelper" ]; then
    /usr/bin/ditto $opt "$tempDir/NetBootClientHelper" "${mountPoint}/usr/sbin/NetBootClientHelper" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/usr/sbin/NetBootClientHelper"
    /bin/chmod 555 "${mountPoint}/usr/sbin/NetBootClientHelper"
    /usr/bin/ditto $opt "$tempDir/com.apple.NetBootClientHelper.plist" "${mountPoint}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist " || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist "
    /bin/chmod 644 "${mountPoint}/System/Library/LaunchDaemons/com.apple.NetBootClientHelper.plist "
    # finally, make sure it isn't disabled...
    /usr/libexec/PlistBuddy -c "Delete :com.apple.NetBootClientHelper" "${mountPoint}/var/db/launchd.db/com.apple.launchd/overrides.plist" > /dev/null 2>&1
    fi
    # Create an installer package in /System/Installation/Packages/ wrapping the supplied script
    InstallerPackageFromScript()
    local tempDir="$1"
    local scriptPath="$2"
    local scriptName=`basename "${scriptPath}"`
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Create installer for script $scriptName"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    # shouldn't exist on entry...
    if [ -e "${tempDir}/emptyDir" ]; then
    /bin/rm -rf "${tempDir}/emptyDir"
    fi
    # make some directories to work in
    /bin/mkdir $opt -p "${tempDir}/$scriptName.pkg/Contents/Resources"
    /bin/mkdir $opt "${tempDir}/emptyDir" || exit 1
    cd "${tempDir}/emptyDir"
    # Create Archive.pax.gz
    /bin/pax -w -x cpio -f "$tempDir/$scriptName.pkg/Contents/Archive.pax" .
    /usr/bin/gzip "$tempDir/$scriptName.pkg/Contents/Archive.pax"
    # Create the Archive.bom file
    /usr/bin/mkbom "$tempDir/emptyDir/" "$tempDir/$scriptName.pkg/Contents/Archive.bom"
    # Create the Info.plist
    /bin/cat > "$tempDir/$scriptName.pkg/Contents/Info.plist" << END
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>CFBundleIdentifier</key>
    <string>com.apple.server.SystemImageUtility.$scriptName</string>
    <key>CFBundleShortVersionString</key>
    <string>1</string>
    <key>IFMajorVersion</key>
    <integer>1</integer>
    <key>IFMinorVersion</key>
    <integer>0</integer>
    <key>IFPkgFlagDefaultLocation</key>
    <string>/tmp</string>
    <key>IFPkgFlagInstallFat</key>
    <false/>
    <key>IFPkgFlagIsRequired</key>
    <false/>
    <key>IFPkgFormatVersion</key>
    <real>0.10000000149011612</real>
    </dict>
    </plist>
    END
    echo "pkmkrpkg1" > "$tempDir/$scriptName.pkg/Contents/PkgInfo"
    echo "major: 1\nminor: 0" > "$tempDir/$scriptName.pkg/Contents/Resources/package_version"
    # Copy the script
    /bin/cp "$scriptPath" "$tempDir/$scriptName.pkg/Contents/Resources/postflight"
    # copy the package to the Packages directory
    /usr/bin/ditto $opt "$tempDir/$scriptName.pkg" "${mountPoint}/System/Installation/Packages/$scriptName.pkg" || exit 1
    # clean up
    /bin/rm -r "$tempDir/emptyDir"
    /bin/rm -r "$tempDir/$scriptName.pkg"
    # If it exists, install the PowerManagement.plist onto the install image
    InstallPowerManagementPlist()
    local tempDir="$1"
    local opt=""
    if [ -e "$tempDir/com.apple.PowerManagement.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing PowerManagement plist to install image"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    /usr/bin/ditto $opt "$tempDir/com.apple.PowerManagement.plist" "${mountPoint}/Library/Preferences/SystemConfiguration/com.apple.PowerManagemen t.plist" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/Library/Preferences/SystemConfiguration/com.apple.PowerManagemen t.plist"
    /bin/chmod 644 "${mountPoint}/Library/Preferences/SystemConfiguration/com.apple.PowerManagemen t.plist"
    fi
    # If it exists, install the InstallerStatusNotifications.bundle and progress emitter onto the install image
    InstallProgressPieces()
    local tempDir="$1"
    local opt=""
    if [ -e "$tempDir/InstallerStatusNotifications.bundle" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing progress announcer to install image"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    /usr/bin/ditto $opt "$tempDir/InstallerStatusNotifications.bundle" "${mountPoint}/System/Library/CoreServices/InstallerStatusNotifications.bundle" || exit 1
    /usr/sbin/chown -R root:wheel "${mountPoint}/System/Library/CoreServices/InstallerStatusNotifications.bundle"
    /bin/chmod 755 "${mountPoint}/System/Library/CoreServices/InstallerStatusNotifications.bundle"
    fi
    if [ -e "$tempDir/com.apple.ProgressEmitter.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing status emitter to image"
    fi
    /usr/bin/ditto $opt "$tempDir/progress_emitter" "${mountPoint}/usr/sbin/progress_emitter" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/usr/sbin/progress_emitter"
    /bin/chmod 555 "${mountPoint}/usr/sbin/progress_emitter"
    /usr/bin/ditto $opt "$tempDir/com.apple.ProgressEmitter.plist" "${mountPoint}/System/Library/LaunchDaemons/com.apple.ProgressEmitter.plist" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/System/Library/LaunchDaemons/com.apple.ProgressEmitter.plist"
    /bin/chmod 644 "${mountPoint}/System/Library/LaunchDaemons/com.apple.ProgressEmitter.plist"
    fi
    # Converts a list of scripts (full paths contained in the file at $1) into packages in .../System/Installation/Packages/
    InstallScriptsFromFile()
    local tempDir="$1"
    local theFile="$2"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Converting scripts into install packages"
    fi
    while read FILE
    do
    if [ -e "${FILE}" ]; then
    # make an installer package out of the script
    InstallerPackageFromScript "$tempDir" "${FILE}"
    fi
    done < "
    local destDir="$2"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Performing post install cleanup"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    opt="-v"
    fi
    fi
    # delete the DS indices to force reindexing...
    if [ -e "${mountPoint}/var/db/dslocal/indices/Default/index" ]; then
    /bin/rm $opt "${mountPoint}/var/db/dslocal/indices/Default/index"
    fi
    # detach the disk and remove the mount folder
    DetachAndRemoveMount || exit 1
    # copy the NBImageInfo.plist file
    /usr/bin/ditto $opt "$tempDir/NBImageInfo.plist" "$destDir/NBImageInfo.plist" || exit 1
    echo "Correcting permissions. ${ownershipInfoKey} $destDir"
    /usr/sbin/chown -R "${ownershipInfoKey}" "$destDir"
    # rename the folder to .nbi
    if [ ! -e "$destDir.nbi" ]; then
    /bin/mv $opt "$destDir" "$destDir.nbi" || exit 1
    else
    local parentDir=`dirname "${destDir}"`
    local targetName=`basename "${destDir}"`
    for ((i=2; i<1000; i++)); do
    if [ ! -e "${parentDir}/${targetName}_$i.nbi" ]; then
    /bin/mv $opt "$destDir" "${parentDir}/${targetName}_$i.nbi" || exit 1
    break
    fi
    done
    fi
    # Prepare the source by deleting stuff we don't want to copy if sourcing a volume
    PreCleanSource()
    local srcVol="$1"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    opt="-v"
    fi
    fi
    if [ -e "$srcVol/private/var/vm/swapfile*" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Removing swapfiles on $1"
    fi
    /bin/rm $opt "$srcVol/private/var/vm/swapfile*"
    fi
    if [ -d "$srcVol/private/tmp" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Cleaning out /private/tmp on $1"
    fi
    /bin/rm -r $opt "$srcVol/private/tmp/*"
    fi
    if [ -d "$srcVol/private/var/tmp" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Cleaning out /private/var/tmp on $1"
    fi
    /bin/rm -r $opt "$srcVol/private/var/tmp/*"
    fi
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Cleaning out devices and volumes on $1"
    fi
    if [ -d "$srcVol/Volumes" ]; then
    /bin/rm -r $opt "$srcVol/Volumes/*"
    fi
    if [ -d "$srcVol/dev" ]; then
    /bin/rm $opt "$srcVol/dev/*"
    fi
    if [ -d "$srcVol/private/var/run" ]; then
    /bin/rm -r $opt "$srcVol/private/var/run/*"
    fi
    # Copy kernel and build the kext cache on the boot image
    PrepareKernelAndKextCache()
    local destDir="$1"
    local opt=""
    local archx8664=`/usr/bin/file -b "${mountPoint}/mach_kernel" | /usr/bin/sed -ne 's/.(x86_64)):./\1/p'`
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Preparing the kernel and kext cache for the boot image"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    # Insure the kext cache on our source volume (the boot shell) is up to date
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Updating kext cache on source volume"
    fi
    /usr/sbin/kextcache -update-volume "${mountPoint}" || exit 1
    # Copy the i386 and, if it exists, the x86_64 architecture
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Preparing Intel architecture"
    fi
    # Prepare the kernel
    /bin/mkdir $opt "$destDir/i386" || exit 1
    /usr/bin/lipo -extract i386 "${mountPoint}/mach_kernel" -output "$destDir/i386/mach.macosx" || exit 1
    # Build kext cache
    /usr/sbin/kextcache -a i386 -s -l -n -z -mkext2 "$destDir/i386/mach.macosx.mkext" "${mountPoint}/System/Library/Extensions" || exit 1
    # If the x86_64 architecture exists, copy it
    if [ "${archx8664}" = "x86_64" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Preparing x86_64 architecture"
    fi
    # Prepare the kernel
    /bin/mkdir $opt "$destDir/i386/x86_64" || exit 1
    /usr/bin/lipo -extract x86_64 "${mountPoint}/mach_kernel" -output "$destDir/i386/x86_64/mach.macosx" || exit 1
    # Build kext cache
    /usr/sbin/kextcache -a x86_64 -s -l -n -z -mkext2 "$destDir/i386/x86_64/mach.macosx.mkext" "${mountPoint}/System/Library/Extensions" || exit 1
    fi
    # Create the i386 and x86_64 boot loaders on the boot image
    PrepareBootLoader()
    local srcVol="$1"
    local destDir="$2"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Preparing boot loader"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    # Copy the i386 and, by default, the x86_64 architecture
    if [ -e "${mountPoint}/usr/standalone/i386/boot.efi" ]; then
    /usr/bin/ditto $opt "${mountPoint}/usr/standalone/i386/boot.efi" "$destDir/i386/booter" || exit 1
    else
    /usr/bin/ditto $opt "$srcVol/usr/standalone/i386/boot.efi" "$destDir/i386/booter" || exit 1
    fi
    # If it exists, install the partitioning application and data onto the install image
    ProcessAutoPartition()
    local tempDir="$1"
    local opt=""
    if [ -e "$tempDir/PartitionInfo.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing Partitioning application and data to install image"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    /usr/bin/ditto $opt "$tempDir/PartitionInfo.plist" "${mountPoint}/System/Installation/PartitionInfo.plist" || exit 1
    /usr/bin/ditto $opt "$tempDir/AutoPartition.app" "${mountPoint}/System/Installation/AutoPartition.app" || exit 1
    # Tell the installer to run the Partitioning application
    /bin/echo "#!/bin/sh
    /System/Installation/AutoPartition.app/Contents/MacOS/AutoPartition" > "${mountPoint}/private/etc/rc.cdrom.postWS"
    # Due to the way rc.install sources the script, it needs to be executable
    /usr/sbin/chown root:wheel "${mountPoint}/private/etc/rc.cdrom.postWS"
    /bin/chmod 755 "${mountPoint}/private/etc/rc.cdrom.postWS"
    fi
    # If it exists, install the InstallPreferences.plist onto the install image
    ProcessInstallPreferences()
    local tempDir="$1"
    local opt=""
    if [ -e "$tempDir/InstallPreferences.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing InstallPreferences.plist to install image"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    /usr/bin/ditto $opt "$tempDir/InstallPreferences.plist" "${mountPoint}/System/Installation/Packages/InstallPreferences.plist" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/System/Installation/Packages/InstallPreferences.plist"
    /bin/chmod 644 "${mountPoint}/System/Installation/Packages/InstallPreferences.plist"
    fi
    # If it exists, install the minstallconfig.xml onto the install image
    ProcessMinInstall()
    local tempDir="$1"
    local opt=""
    if [ -e "$tempDir/minstallconfig.xml" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing minstallconfig.xml to install image"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    /usr/bin/ditto $opt "$tempDir/minstallconfig.xml" "${mountPoint}/etc/minstallconfig.xml" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/etc/minstallconfig.xml"
    /bin/chmod 644 "${mountPoint}/etc/minstallconfig.xml"
    fi
    # untar the OSInstall.mpkg so it can be modified
    untarOSInstallMpkg()
    local tempDir="$1"
    local opt=""
    # we might have already done this, so check for it first
    if [ ! -d "${tempDir}/OSInstall_pkg" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "uncompressing OSInstall.mpkg"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    fi
    /bin/mkdir "${tempDir}/OSInstall_pkg"
    cd "${tempDir}/OSInstall_pkg"
    /usr/bin/xar $opt -xf "${mountPoint}/System/Installation/Packages/OSInstall.mpkg"
    # make Distribution writeable
    /bin/chmod 777 "${tempDir}/OSInstall_pkg"
    /bin/chmod 666 "${tempDir}/OSInstall_pkg/Distribution"
    fi
    handler ()
    echo "Terminated. Cleaning up. Unmounting $destPath"
    # detach the disk and remove the mount folder
    DetachAndRemoveMount
    # Remove the items we created
    /bin/rm -r "$destPath/i386"
    /bin/rm "$destPath/$dmgTarget.dmg"
    /bin/rm "$destPath/System.dmg"
    # Finally, remove the directory IF empty
    /bin/rmdir "$destPath"
    exit 1
    InstallNetBootClientHelper()
    local tempDir="$1"
    local destDir="${mountPoint}/System/Installation/Packages/SIUExtras"
    local opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    opt="-v"
    fi
    if [ -e "${tempDir}/bindingNames.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing Directory Service binding information"
    fi
    /usr/bin/ditto $opt "${tempDir}/bindingNames.plist" "${destDir}/bindingNames.plist" || exit 1
    /usr/sbin/chown root:wheel "${destDir}/bindingNames.plist"
    /bin/chmod 644 "${destDir}/bindingNames.plist"
    fi
    if [ -e "${tempDir}/sharingNames.plist" ]; then
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ]; then
    echo "Installing Sharing Names support"
    fi
    /usr/bin/ditto $opt "${tempDir}/sharingNames.plist" "${destDir}/sharingNames.plist" || exit 1
    /usr/sbin/chown root:wheel "${destDir}/sharingNames.plist"
    /bin/chmod 644 "${destDir}/sharingNames.plist"
    fi
    # This is required, make sure it's here
    /usr/bin/ditto $opt "${tempDir}/NetBootClientHelper" "${destDir}/NetBootClientHelper" || exit 1
    /usr/sbin/chown root:wheel "${destDir}/NetBootClientHelper"
    /bin/chmod 555 "${destDir}/NetBootClientHelper"
    /usr/bin/ditto $opt "${tempDir}/com.apple.NetBootClientHelper.plist" "${destDir}/com.apple.NetBootClientHelper.plist" || exit 1
    /usr/sbin/chown root:wheel "${destDir}/com.apple.NetBootClientHelper.plist"
    /bin/chmod 644 "${destDir}/com.apple.NetBootClientHelper.plist"
    /usr/bin/ditto $opt "${tempDir}/installClientHelper.sh" "${mountPoint}/var/tmp/niu/postinstall/installClientHelper.sh" || exit 1
    /usr/sbin/chown root:wheel "${mountPoint}/var/tmp/niu/postinstall/installClientHelper.sh"
    /bin/chmod 555 "${mountPoint}/var/tmp/niu/postinstall/installClientHelper.sh"
    trap "handler" TERM INT
    + trap handler TERM INT
    # Set up for script debugging
    debug_opt=""
    + debug_opt=
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    debug_opt="-v"
    fi
    + '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
    + debug_opt=-v
    # See if the source volume was overridden (NetRestore from install media workflow)
    isRestoreFromInstallMedia="NO"
    + isRestoreFromInstallMedia=NO
    if [ ! -z "${3:-}" ]; then
    sourceVol="${3}"
    isRestoreFromInstallMedia="YES"
    fi
    + '[' '!' -z '' ']'
    # Prepare the destination
    CreateOrValidateDestination "$destPath"
    + CreateOrValidateDestination '/image in here/NetRestore ofRolloutDMG'
    + local 'destDir=/image in here/NetRestore ofRolloutDMG'
    + '[' '!' -d '/image in here/NetRestore ofRolloutDMG' ']'
    + '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
    + echo 'Creating working path at /image in here/NetRestore ofRolloutDMG'
    Creating working path at /image in here/NetRestore ofRolloutDMG
    + /bin/mkdir -p '/image in here/NetRestore ofRolloutDMG'
    + '[' '!' -d /tmp/mnt.pde0nj ']'
    # If the sourceVol is the boot drive we have an asr:// type source
    if [ "$sourceVol" == "/" ]; then
    # Create an empty image to skip the ASR volume creation
    /usr/bin/touch "${destPath}/System.dmg"
    fi
    + '[' '/Volumes/Macintosh HD 1' == / ']'
    # Look for an existing System.dmg
    if [ ! -e "$destPath/System.dmg" ]; then
    # update progress information
    echo "${progressPrefix}imagingSource"
    # Create an image of the source volume
    # /usr/bin/hdiutil create "$destPath/System" -srcfolder "$sourceVol" -format UDBZ -uid 0 -gid 80 -mode 1775 -ov -puppetstrings || exit 1
    if [ "${blockCopyDeviceKey}" == 1 ] ; then
    theDevice=`/usr/sbin/diskutil info "$sourceVol" | grep "Device Identifier:" | awk '{print $3}'`
    /usr/sbin/diskutil umount "${theDevice}"
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    echo "Creating block-level image of $theDevice"
    fi
    /usr/bin/hdiutil create "$destPath/System" -srcdevice "${theDevice}" -uid 0 -gid 80 -mode 1775 -ov -puppetstrings || exit 1
    /usr/sbin/diskutil mount "${theDevice}"
    else
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    echo "Creating image of $sourceVol"
    fi
    /usr/bin/hdiutil create "$destPath/System" -srcfolder "${sourceVol}" -fsargs "-c a=16384,c=8192,e=1280" -uid 0 -gid 80 -mode 1775 -ov -puppetstrings || exit 1
    fi
    # update progress information
    echo "${progressPrefix}preparingASR"
    # "Scan the image for restore"
    asr_opt="--filechecksum"
    if [ "${skipFileChecksumKey}" == 1 ] ; then
    asr_opt=""
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    echo "Preparing image for restore without file checksums"
    fi
    else
    if [ "${scriptsDebugKey}" == "VERBOSE" -o "${scriptsDebugKey}" == "DEBUG" ] ; then
    echo "Preparing image for restore"
    fi
    fi
    /usr/sbin/asr imagescan --source "$destPath/System.dmg" $asr_opt || exit 1
    fi
    + '[' '!' -e '/image in here/NetRestore ofRolloutDMG/System.dmg' ']'
    + echo progress_imagingSource
    + '[' 0 == 1 ']'
    + '[' DEBUG == VERBOSE -o DEBUG == DEBUG ']'
    + echo 'Creating image of /Volumes/Macintosh HD 1'
    Creating image of /Volumes/Macintosh HD 1
    + /usr/bin/hdiutil create '/image in here/NetRestore ofRolloutDMG/System' -srcfolder '/Volumes/Macintosh HD 1' -fsargs '-c a=16384,c=8192,e=1280' -uid 0 -gid 80 -mode 1775 -ov -puppetstrings
    PERCENT:0.000000
    PERCENT:0.433633
    PERCENT:87.806953
    PERCENT:-1.000000
    Finalizing disk image.
    detachTempimageFile: synchronous unmount /dev/disk1 returned 49153
    lsof: status error on /Volumes/Macintosh: No such file or directory
    lsof: status error on HD: No such file or directory
    lsof 4.82
    latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
    latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
    latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
    usage: [-?abhlnNoOPRtUvV] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]
    [-F [f]] [-g [s]] [-i ] [+|-L [l]] [+|-M] [-o [o]] [-p s]
    [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
    Use the ``-h'' option to get more help information.
    retrying unmount (#1)...
    detachTempImageFile: synchronous retry (#1) unmount /Volumes/Macintosh HD (/dev/disk1) returned 0
    Workflow Stopped (2011-03-17 10:01:33 +0000)
    Workflow Stopped (2011-03-17 10:01:34 +0000)
    Stopping image creation.
    Terminating script!

    Thanks for your input...I did wonder if I was being impatient...
    subsequently ran it again and was taken out of the office for a few hours, lo and behold on return all was well....
    Now however, netboot service won't start, netboot folder is not being created within library...another posting to follow
    Message was edited by: DaiVernon

Maybe you are looking for

  • Returning Set Top Box

    I was wondering if anyone here has any experience with returning equipment, particularly a set top box. I called Verizon on June 10th and told them that I wanted to return an HD box that we've been renting to save $9.99 a month. They said that would

  • BOX in Scripts.

    I want to display box in script dynamically. please tell how this is possible.

  • Web links not working in iPhone calendar notes. Used to work. Ideas?

    Web links not working in iPhone calendar notes. Used to work. Ideas?

  • Error ORA-01467: sort key too long

    Hi. I have just come across the error ORA-01467: sort key too long . In the Oracle documentation, the 2 line description of this error basically says that there may be too many columns or group functions in the query, so I need to reduce the number o

  • Adobe Ilustrator CC hangs in Windows 7 64 12GB Ram

    Hello, We have several computers with the same problem, the user is working as normal and Ilustrator stop responding. In windows even viewer it says that is something with ole32.dll and I also have the adobe log. This happens since a week ago sever t