Place image icon onto a 3D cube

Hi, I am currently doing a project on 3D java. I have created 3D color cube and
i am planning to put movable image icon on the cube so that i can move the image
icon to anywhere on the cube. The color cube can be rotated, translated and
zoomable. Lastly, when the cube is being rotated,the image icon on the cube must
move together also.
i am currently stuck at the part where i dont know how to do the coding on
creating the image icon and when the cube is rotated, the image icon will move
also. Can you give me some sample code on doing that as this is my first time
using java 3D.
Below is the code that i use to create the cube.
CODE
* IconGlassPanel3D.java
* Created on October 30, 2006, 2:57 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package Pas3DGUI;
import CobraNet.Zone;
import DbConnection.DAOFactory;
import DbConnection.ZoneDAO;
import Pas2DGUI.ZoneIcons;
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.behaviors.mouse.*;
import java.awt.Graphics;
import java.awt.Point;
import javax.media.j3d.*;
import javax.vecmath.*;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.*;
import java.util.Enumeration;
* @author 042255f
public class IconGlassPanel3D extends Applet {
// nImg =
Toolkit.getDefaultToolkit().getImage("C:\\TEMP\\unselected_speaker.gif");
/** Creates a new instance of IconGlassPanel3D */
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();
TransformGroup objTransform = new TransformGroup();
objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
objRoot.addChild(objTransform);
objTransform.addChild(new ColorCube(0.4));
// objRoot.addChild(new Axis());
MouseRotate myMouseRotate = new MouseRotate();
myMouseRotate.setTransformGroup(objTransform);
myMouseRotate.setSchedulingBounds(new BoundingSphere());
objRoot.addChild(myMouseRotate);
MouseTranslate myMouseTranslate = new MouseTranslate();
myMouseTranslate.setTransformGroup(objTransform);
myMouseTranslate.setSchedulingBounds(new BoundingSphere());
objRoot.addChild(myMouseTranslate);
MouseZoom myMouseZoom = new MouseZoom();
myMouseZoom.setTransformGroup(objTransform);
myMouseZoom.setSchedulingBounds(new BoundingSphere());
objRoot.addChild(myMouseZoom);
// Let Java 3D perform optimizations on this scene graph.
objRoot.compile();
return objRoot;
} // end of CreateSceneGraph method of MouseBehaviorApp
// Create a simple scene and attach it to the virtual universe
public IconGlassPanel3D() {
setLayout(new BorderLayout());
Canvas3D canvas3D = new Canvas3D(null);
add("Center", canvas3D);
BranchGroup scene = createSceneGraph();
// SimpleUniverse is a Convenience Utility class
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
// This will move the ViewPlatform back a bit so the
// objects in the scene can be viewed.
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(scene);
} // end of MouseBehaviorApp (constructor)
// The following allows this to be run as an application
// as well as an applet
public static void main(String[] args) {
System.out.println("Hold the mouse button while moving the mouse to make
the cube move.");
System.out.println(" left mouse button - rotate cube");
System.out.println(" right mouse button - translate cube");
System.out.println(" Alt+left mouse button - zoom cube");
Frame frame = new MainFrame(new IconGlassPanel3D(), 256, 256);
} // end of main (method of MouseBehaviorApp)
Thank You all for your help.I apprepciate it.

Use a Box instead of the ColorCube.. This might give you a start.
To texture the Box, assuming you have extended Applet -
        java.net.URL texImage = null;// the URL of the image to load
     Appearance app = new Appearance();
     Texture tex = new TextureLoader(texImage, this).getTexture();
     app.setTexture(tex);
     TextureAttributes texAttr = new TextureAttributes();
     texAttr.setTextureMode(TextureAttributes.MODULATE);
     app.setTextureAttributes(texAttr);
     Box textureCube = new Box(0.4f, 0.4f, 0.4f,
                      Box.GENERATE_TEXTURE_COORDS, app);IMHO you will be well served by texturing a plane congruent in size with the sides of the cube and manipulating that using the coords of each side of a Box derived from Shape3D.getGeometry. Don`t forget to add a Light or two.
regards

Similar Messages

  • How do I place images in a rotatable divided cube using Java?

    Hello- I am creating a puzzle that is like the "Rubik's Cube,"
    although this puzzle is played on the computer monitor, and the puzzle
    involves images placed on the sides of a cube. The mouse is used to
    rotate the sides of the cube. Each side of the cube is divided into
    three sections.
    The code for the basic puzzle has been written by another person. The
    link to the puzzle created by this person (including links to the
    program files or source files) may be found at:
    http://www.geocities.com/jaapsch/puzzles/cubie.htm
    My goal is to create a puzzle (using Jaap's code or script) whereby I
    will be able to place one of my photographs on each side of the puzzle
    cube (6 different photos per cube). The goal is to rotate the sides so
    that the photos are put together correctly.
    I have been in contact via email with the puzzle's author, Jaap
    Scherphuis, and he emailed me that I can use his puzzle's code or
    script (whichever it is), and place my photos in the puzzle. In return,
    Jaap would like to get the code or script that is created. When I spoke
    with Jaap by email several months ago he told me he was too busy to
    help me at that time.
    So, I am looking for a person to help me create a situation whereby I
    will be able to include my photographs on the sides of the puzzle with
    the images divided on each side and rotatable.
    I am interested in learning how to write the code (or script) myself so
    I am able to include different photos.
    Please let me know if you might offer any assistance.
    Thank you,
    Jeff Klamer
    www.jeffklamerdesign.com
    p.s. Please see my photo galleries to enjoy some of the images I am working with.

    [url http://forum.java.sun.com/thread.jspa?threadID=776111&messageID=4418806#4418806]Crosspost.
    [url http://forum.java.sun.com/thread.jspa?threadID=776112&messageID=4418809#4418809]Another Crosspost.

  • Not showing image in basic copy gif image icon and place on html page

    Trying to do a basic copy gif image icon and place it on a basic html page.
    The image shows up in my local page and shows on remote side but when I go to view in browser it does not show as a image. It shows the border but no image.
    The directions were (working with windows xp and IE8)
    Download the image to your C:\temp folder.
    4. Copy the gif file from your C:\temp folder and paste it in the same folder where your .html or .asp file is.
    I copied the image with right click save as in many different areas of computer. I even put on desktop.
    I add image and it shows on the site I am working in but when putting to remote side it does not view as an image on the browser.
    I have cleared cashe as well as pressed cntrl/refresh and still nothing.
    Other images work and show.
    on-line-vacations.com
    Thanks!

    Basic assumptions:
    You have Defined a site.
    All files reside within the defined site (including image files)
    All files use the appropriate file extensions, for example, image.gif
    You have saved and uploaded all site files to your server.
    You are EXACTLY naming the source image (no errant capital letters) in the link.
    If your other images are linking properly and showing, delete this image and insert it again (or re-link it to the image file within your site structure).
    Z

  • How to place an icon of a website (say my bank) onto my desktop for quick, regular access. Also, does firefox have an auto-fill feature?

    How to place an icon of a website (say my bank) onto my desktop for quick, regular access.
    Also, does Firefox have an auto-fill feature?

    https://support.mozilla.com/en-US/kb/Creating+a+desktop+shortcut+to+a+web+page
    Firefox doesn't have a true "autofill", but rather a form autocomplete. <br />
    [http://support.mozilla.com/en-US/kb/Form+autocomplete] <br />
    '''The difference being that form autocomplete recalls form data you have completed previously, and sometimes has totally inappropriate suggestions. Whereas, autofill uses data that you set up ahead of time - not "form history", and has a lot better accuracy.'' <br />
    There are a number of extensions that add a true "autofill" to Firefox. <br />
    https://addons.mozilla.org/en-US/firefox/addon/4775

  • Unable to place images in Illustrator

    (Illustrator CS2)
    Hi, Im still learning the program but this is an error that hasn't occurred before under the same circumstances. I am working on Macs at uni (as I dont have Illustrator at home) and with images from my USB drive. I want to get the images into my ai document and trace them to make a logo, but Illustrator is preventing me from doing this in any way I try.
    * I try to 'place' (file>place...) a jpg from the USB into the ai document and one of three things happens:
    1. It appears as though nothing has happened so I 'select all' and this highlights an empty box where my image should be. This always happens on the first try after I open the document.
    2. I delete the box and try again. This time not even the invisible box is placed. The computer processes and then acts as if I commanded it to do nothing.
    3. Irregularly, if I try again it seems like it's about to happen (with a preview showing and asking me to approve) and then I get the message "the operation cannot complete because of an unknown error".
    * I tried opening the jpg in Photoshop and copying and pasting from there and got the same "unknown error" message, followed by the empty invisible box.
    * The images place in photoshop with no problem.
    * The images cant be dragged and dropped into Illustrator.
    * I tried opening the image with Illustrator and get the message "insufficient memory was available to complete the operation". The image is only small - less than 1MB.
    * I tried changing the file to a tiff and a pdf. I tried uploading the jpg to internet and saving and placing from there but this is unsuccessful. I tried other images saved both from my computer and the uni computer and they dont work.
    * SOMETHING WORKS: I tried with random images from the internet and some (usually around 4kb) saved to Documents and placed are done so successfully. But this is no use to me.
    I have done this in the past and there have been no problems placing or pasting images whatsoever. I dont think uninstalling is really an option as they are the uni's computers and that would probably be an ordeal.. I really need this to be fixed quickly as I have no other access to Illustrator and it's part of a job. It happens with all the computers in the lab. I cant even start making the logo until this is overcome. I would really appreciate some help! your ideas on what the problem could be and what needs to be done to fix it.
    Thanks for your time,
    Simon.

    One causes of this error I've encountered has to do with the volume size of the disk the user's home folder is stored on.
    I'm guessing that Simon Manion is logged onto the Mac at his university using a networked home folder that is stored on a volume larger than Illustrator scratch disk management routines can handle. (2TB is the limit I think.)
    The workaround that I've been using is to create a 500MB disk image with Disk Utility, mounting the image, and using it as the only scratch disk. You may need to make your disk image larger. (Remember to restart Illustrator for the new scratch settings to take effect.)
    Even though the actual local volumes are under 2TB, they don't seem to work as scratch disks if the user's home folder lives on a large server. For some reason, setting the scratch disk to a virtual volume gets thing working correctly.
    This has solved the place image problem for me in Illustrator CS, CS2, and CS3.

  • Most efficient way to place images

    I am composing a Catalog with a lot of images along with the text.  The source images are often not square (perfectly vertical, portrait).  I also want to add a thin line frame around each one in InDesign to spurce up the look.  I'm spending a lot of time in Photoshop straightening images, because rotating in Indesign to get the image straight results in a non-straight frame.
    Should I create a small library of frames that I place, then place non-straight images in them (and how do I do that) and rotate in InDesign?  Etc?
    What would be the most efficient way to do this?
    Thanks

    To tag onto what Peter said, when you click on the image with the Direct Selection tool you can also use the up and down arrow in the rotation Dialog (where you enter the angle, at the top) to easily change the rotation.
    Also, when you place images in InDesign you can select a number of images at once and continually click the document (or image frame) and place all the images you selected to import. To clarify, you can have a whole bunch of empty image frames on the page then go to file > place and select all your images, then continually click and place them inside each empty frame.

  • Why can't I place disk icons on my desktop?

    Why can't I place disk icons on my desktop?
    I installed OSX Lion, version 10.7.1 from the App Store onto the internal disk of my MacBookPro which was cloned to an external FW800 GoFlexDesk drive. I booted from that external drive, ran the disk utility to erase and then repartition my internal drive so that I would have a "clean" installation of Lion. My disk icon (for the internal drive) does not even show in Finder windows. In Snow Leopard I showed my internal drive, my Time Capsule drives, and any external drives on my desktop as icons. Now these do not even show in Finder. I know they are there, because if I choose the path view option, they are shown when I pick "All My Files" under favorites. I can navigate backwards in the path bar, but still they do not actually allow me to select them or drag them to the desktop. In Snow Leopard, it was an option to show disks on desktop in general system preferences, but I find that option no where in Lion! What simple little thing am I missing?

    PilotShawn wrote:
    What simple little thing am I missing?
    Finder > Preferences > General > Show these items on the Desktop?

  • How do I place images in iBooks Author?

    How do I place images in iBooks Author?

    Drag them from the Finder onto a page
    ...or...
    Copy/Paste
    See: Publishing With iBooks Author
    http://shop.oreilly.com/product/0636920025597.do

  • How can I place photo icons on top of folders?

    I put 4 folders in my dock. I need to ID them with photo - icons.
    1) How can I place photo icons on top of 3 folders, so that they also retain
    their folder shape?
    2) And, to make one of them look like a folder that has text?
    Intel Mac - Dual - Tiger 10.4.9
    Thank you.

    It sounds like what you actually need to do is amend the icon itself - something like Iconographer will help you with that. Open the icon of any standard folder, copy in your photo image, amend the result to your satisfaction, and save it as a new icon. Then apply that icon to your folder.
    Matt

  • How can I possible lose my entire photo library/ referenced master image file if I have downloaded all my images directly onto Aperture?

    How can I possible lose my entire photo library/ referenced master image file if I have downloaded all my images directly onto Aperture?

    CeliaJane, you need to distinguish between the Aperture Library and the Aperture Application.
    Aperture stores your images in a database, and it is this database that we have to find and probably to repair, not the application (hopefully). And since you do not see any images, I suspect that Aperture created a new, empty Aperture Library,and you are now viewing this empty library. Usully the library sits in your Pictures fiolder.
    Look into your Pictures folder, if you see a file with a colorful icon with three pictures, called something.aplibrary, as shown above. And also enter ".applibrary" into the "Spotlight" searchfield in the upper right corner of your screen. If you have more than one Library, you should be able to find them this way.
    The largest file you find will probably be the correct library.
    When you have found the correct file called aperturexxxx.aplibrary, try to open it in "First Aid" mode.
    Select the Library and press down "command" and "option" key at the same time, while you double click the library.
    Now the First Aid dialogue should appear:
    Select: Repair Permissions" and see if you can open the Library again. If it did not help, try the other two options in turn.
    Regards
    Léonie

  • Where is the image icon on GL9?

    I'm having the hardest time finding the image icon so I can drag it onto the page.  Thank you!  I'm learning the ropes to GL9.

    The icon is here, but as Chris CA says, that may well not be your issue.

  • Find text place image

    Hello
    I have a script that find text and replaced it with a image, but it makes a new document and i want it in the same document that i have open.
    Can somebody help me with this problem. See script below. I work with Indesign CS 5 mac.
    Kinde regards,
    Patrick
    #target indesign
    var myDialogResult = CreateDialog();
    if (myDialogResult == undefined) exit();
    CheckIfChosenFoldersExist();
    var myIndFiles = [];
    var mySubFolders = [];
    CheckFolder(myDialogResult.indFolder);
    if (myIndFiles.length == 0) err("No InDesign files have been found in the selected folder and its subfolders.");
    var myStartFolder = myDialogResult.imagesFolder.parent;
    mySubFolders = getSubFolders(myStartFolder);
    WriteToFile("\r--------------------- Script started -- " + GetDate() + "---------------------\n");
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
    for (f = 0; f < myIndFiles.length; f++) {
              ProcessIndFile(myIndFiles[f]);
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    WriteToFile("--------------------- Script finished -- " + GetDate() + "---------------------\r\r");
    alert("All done!");
    // ------------------------------------------------- FUNCTIONS -------------------------------------------------
    function PlaceImages() {
              app.findGrepPreferences = app.changeGrepPreferences = null;
              app.findGrepPreferences.findWhat = '@.+?@';
              var myFoundItems = app.activeDocument.findGrep();
              for (i = 0; i < myFoundItems.length; i++) {
                        var myName = myFoundItems[i].contents.replace (/@/g, "");
                        var myFile = new File(myDialogResult.imagesFolder + "/" + myName);
                        var myFrame = myFoundItems[i].parentTextFrames[0];
                        if (myFile.exists) {
                                  PlaceIntoFrame(myFrame, myFile);
                                  continue;
                        if (!SearchInSubfolders(myName, myFrame)) {
                                  WriteToFile("\tNOT FOUND  -- " + myFile.fsName + "\n");
    function SearchInSubfolders(myName, myFrame) {
              for (j = 0; j < mySubFolders.length; j++) {
                        var myFolder = mySubFolders[j];
                        var myFile = new File(myFolder + "/" + myName);
                        if (myFile.exists) {
                                  PlaceIntoFrame(myFrame, myFile);
                                  return true;
              return false;
    function PlaceIntoFrame(myFrame, myFile) {
              try {
                        if (myFrame.characters.length < 100) {
                                  myFrame.getElements()[0].place(myFile);
                                  switch(myDialogResult.myRadSelected)          {
                                            case 2:
                                                      myFrame.fit(FitOptions.CENTER_CONTENT);
                                            break;
                                            case 3:
                                                      myFrame.fit(FitOptions.FRAME_TO_CONTENT);
                                            break;
                                            case 4:
                                                      myFrame.fit(FitOptions.PROPORTIONALLY);
                                            break;
                                            default:
                                            // do nothing
                        WriteToFile("\tPlaced -- " + myFile.fsName+ "\n");
              catch(e) {
                        WriteToFile("\tSome error occured while placing -- " + myFile.fsName + "\n");
    function CheckFolder(folder) {
              var fileList = folder.getFiles()
              for (var i = 0; i < fileList.length; i++) {
                        var file = fileList[i];
                        if (file instanceof File && file.name.match(/\.indd$/i)) {
                                  myIndFiles.push(file);
                        else if (file instanceof Folder) {
                                  CheckFolder(file);
    function getSubFolders(theFolder) {
              var myFileList = theFolder.getFiles();
              for (var i = 0; i < myFileList.length; i++) {
                        var myFile = myFileList[i];
                        if (myFile instanceof Folder){
                                  mySubFolders.push(myFile.absoluteURI);
                                  getSubFolders(myFile);
              return mySubFolders;
    function err(e, icon){
              alert(e, "Place Images Script", icon);
              exit();
    function ProcessIndFile(myFile) {
              try {
                        var myDoc = app.open(myFile);
                        WriteToFile(myDoc.name + "\n");
                        var myNewFile = new File(myFile.fsName.replace(/\.indd$/i, "_Backup.indd"));
                        myFile.copy(myNewFile);
              catch(e) {
                        WriteToFile("Cannot open file -- " + myFile.fsName + "\nError: " + e.message + " (Error# " + e.number  + ")\n");
              PlaceImages();
              myDoc = myDoc.save();
              myDoc.close();
    function CreateDialog() {
              var myIndFolder, myImagesFolder;
              if (app.extractLabel("Kas_PlaceImages_IndFolderPath") != "") {
                        var myIndFolderPath = app.extractLabel("Kas_PlaceImages_IndFolderPath");
              else {
                        var myIndFolderPath = "No folder has been selected";
              if (app.extractLabel("Kas_PlaceImages_ImageFolderPath") != "") {
                        var myImageFolderPath = app.extractLabel("Kas_PlaceImages_ImageFolderPath");
              else {
                        var myImageFolderPath = "No folder has been selected";
              var myDialog = new Window('dialog', 'Place Images');
              myDialog.orientation = 'row';
              myDialog.alignChildren = 'top';
              var myPanel = myDialog.add('panel', undefined, 'Choose folders for:');
              var myIndFolderStTxt = myPanel.add('statictext', undefined, myIndFolderPath);
              var myButtonInd = myPanel.add('button', undefined, 'InDesign files', {name:'indd'});
              var myImagesFolderStTxt = myPanel.add('statictext', undefined, myImageFolderPath);
              var myButtonImages = myPanel.add('button', undefined, 'Image files', {name:'images'});
              var myGroup = myDialog.add('group');
              myGroup.orientation = 'column';
              var myRadioPanel = myGroup.add('panel', undefined, 'After placing:');
              myRadioPanel.alignChildren = 'left';
              var myRadioBtn1 = myRadioPanel.add('radiobutton', undefined, 'do nothing');
              var myRadioBtn2 = myRadioPanel.add('radiobutton', undefined, 'center content');
              var myRadioBtn3 = myRadioPanel.add('radiobutton', undefined, 'fit frame to content');
              var myRadioBtn4 = myRadioPanel.add('radiobutton', undefined, 'fit content proportionally');
              if (app.extractLabel("Kas_PlaceImages_RadioSelected") != "") {
                        eval("myRadioBtn" + app.extractLabel("Kas_PlaceImages_RadioSelected") + ".value= true");
              else {
                        myRadioBtn1.value = true;
              var myOkCancelGroup = myGroup.add('group');
              myOkCancelGroup.orientation = 'row';
              var myOkBtn = myOkCancelGroup.add('button', undefined, 'Place', {name:'ok'});
              var myCancelBtn = myOkCancelGroup.add('button', undefined, 'Quit', {name:'cancel'});
              myButtonInd.onClick = function() {
                        myIndFolder = Folder.selectDialog ('Chose a folder for InDesign documents');
                        if (myIndFolder != null) {
                                  myIndFolderStTxt.text = myIndFolder.fsName;
              myButtonImages.onClick = function() {
                        myImagesFolder = Folder.selectDialog ('Chose a folder for Images');
                        if (myImagesFolder != null) {
                                  myImagesFolderStTxt.text = myImagesFolder.fsName;
              var myShowDialog = myDialog.show();
              if (myIndFolder == undefined) {
                        if (myIndFolderStTxt.text == "No folder has been selected") {
                                  myIndFolder = null;
                        else {
                                  myIndFolder = new Folder(myIndFolderStTxt.text);
              if (myImagesFolder == undefined) {
                        if (myImagesFolderStTxt.text == "No folder has been selected") {
                                  myImagesFolder = null;
                        else {
                                  myImagesFolder = new Folder(myImagesFolderStTxt.text);
              var myRadSelected;
              if (myRadioBtn1.value) {
                        myRadSelected = 1;
              else if(myRadioBtn2.value) {
                        myRadSelected = 2;
              else if(myRadioBtn3.value) {
                        myRadSelected = 3;
              else if(myRadioBtn4.value) {
                        myRadSelected = 4;
              app.insertLabel("Kas_PlaceImages_RadioSelected", myRadSelected + "");
              app.insertLabel("Kas_PlaceImages_IndFolderPath", myIndFolderStTxt.text);
              app.insertLabel("Kas_PlaceImages_ImageFolderPath", myImagesFolderStTxt.text);
              if (myShowDialog== 1) {
                        var myResult = {};
                        myResult.indFolder = myIndFolder;
                        myResult.imagesFolder = myImagesFolder;
                        myResult.myRadSelected = myRadSelected;
              return myResult;
    function WriteToFile(myText) {
              myFile = new File("~/Desktop/Place Images Report.txt");
              if ( myFile.exists ) {
                        myFile.open("e");
                        myFile.seek(0, 2);
              else {
                        myFile.open("w");
              myFile.write(myText);
              myFile.close();
    function GetDate() {
              var myDate = new Date();
              if ((myDate.getYear() - 100) < 10) {
                        var myYear = "0" + new String((myDate.getYear() - 100));
              } else {
                        var myYear = new String ((myDate.getYear() - 100));
              var myDateString = (myDate.getMonth() + 1) + "/" + myDate.getDate() + "/" + myYear + " " + myDate.getHours() + ":" + myDate.getMinutes() + ":" + myDate.getSeconds();
              return myDateString;
    function CheckIfChosenFoldersExist() {
               if (myDialogResult.indFolder == null) {
                        err("No folder has been chosen for InDesign files.", true);
              else if (myDialogResult.indFolder.constructor.name == "Folder") {
                        if (!myDialogResult.indFolder.exists) {
                                  err("Folder \"" + myDialogResult.indFolder.fsName + "\" chosen for InDesign files does not exist.", true);
              if (myDialogResult.imagesFolder == null) {
                        err("No folder has been chosen for pictures.", true);
              else if (myDialogResult.imagesFolder.constructor.name == "Folder") {
                        if (!myDialogResult.imagesFolder.exists) {
                                  err("Folder \"" + myDialogResult.imagesFolder.fsName + "\" chosen for images does not exist.", true);

    Try this, I use it every day
    /*******************ImagePlacer***************************
        this script will addimages to the document by
        substituting them with the name of the image file
        between @s (file format included[@mypic.bmp@]),
        selecting them from a specified file (see below)
        and applying object styles to them, as well as
        applying the right tab i necesary.
        It then looks for overflows in the document. If an
        overset is found, it will resize to margin size the
        text frame and if overset continues, it will add a
        new page and frame, which then will be linked
        to the previous frame, allowing the story flow.
        Questo file deve essere copiato nella cartella Script di InDesign
    //Creates a new document using the specified document preset.
    //Replace "myDocumentPreset" in the following line with the name
    //of the document preset you want to use.
    var myDocument = app.documents.add(true,app.documentPresets.item("MyPreset"));
    //If the active document has not been saved (ever), save it.
    if(app.activeDocument.saved == false){
    //If you do not provide a file name, InDesign displays the Save dialog box.
    app.activeDocument.save(new File("/Users/paolbot/Desktop/Document.indd"));
    function main()
    var myDocument = app.documents.item(0);
    var myPage = myDocument.pages.item(0);
    var myTextFrame = myPage.textFrames.add({geometricBounds:myGetBounds(myDocument,myPage)});
    myTextFrame.textFramePreferences.textColumnCount = 7;
    myTextFrame.place(File("/Users/paolbot/Desktop/text.txt"));
    //Place a text file in the text frame.
    //Parameters for TextFrame.place():
    //File as File object,
    //[ShowingOptions as Boolean = False]
    //You'll have to fill in your own file path.
    //Define GREP search
    var grepFind ="@@@.+@@@";
    //Name of the folder where pdf are
    var myFiguresFolder = "pictures";
    // Stile Paragrafo applicato
    var myPStyle = myDocument.paragraphStyles.item("Normal");
    var NextPStyleCS = myDocument.paragraphStyles.item("Par_Style");
    var NextPStyleEN = myDocument.paragraphStyles.item("Par_Style_en");
    var NextPStyleDE = myDocument.paragraphStyles.item("Par_Style_de");
    // Text style applied
    var myCStyle = myDocument.characterStyles.item("text");
    //Object style applyed
    var myOStyle = "";
    var oStyle_1 = myDocument.objectStyles.item("Pictures");
    var oStyle_2 = myDocument.objectStyles.item("Pictures");
    var oStyle_3 = myDocument.objectStyles.item("Pictures");
    //MEASUREMENTS
    var maxWidth = 467; //Maximum width of an image
    var maxHeight = 666; //Maximum Height of an image
    var colWidth = 468; //Width of the main columb (340pt) + maximum Tab (128pt)
    var maxTab = 0;
    var xTab;
    var xtTab;
    var minTWidth = 340; //any image with a width below this will have the maximum Tab (maxTab) applied.
    var PWidth; //Width of the Picture
    var PHeight;//Picture Height
    var myTotal;

  • InDesign CC will only let me place images from one directory

    I am a print designer and recently switched from a PC to a MacBook Pro. I'm using InDesign CC and it will only let me place images from one directory. If I try and choose another directory, the Finder window just disappears.

    Are you on Mac 10.9? There is an issue on mac 10.9 w.r.t finder window when try to open/pace file in "cover flow view" mode. The finder window dissapears then.
    Workaround: Choose Icon View, List View, or Column View

  • Place image on canvas

    Hi.
    I am trying to place image on canvas.
    However the image doesn't show!!!!!!!!!!!!! :(
    no error and compiles well....
    private void AddTile(String image, int startx, int starty, int endx, int endy)
    try{
    tiles = ImageIO.read(new File(image));
    catch(Exception e)
    System.out.println("Image not Found");
    Graphics2D a =(Graphics2D)tiles.getGraphics();
    a.drawImage(tiles, 20,20,20,20,TileCanvas);
    if the above function is called the image should be placed on canvas right?
    TileCanvas is a canvas, and tiles is BufferedImage.
    just in case I'll put my source code followed by this
    * MapEditor.java
    * Created on 2006�� 7�� 20�� (��), ���� 11:48
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.imageio.*;
    import java.io.*;
    * @author SeiKwon
    public class EditorComponent extends javax.swing.JFrame
    private java.awt.Button AddTile;
    private java.awt.Button DeleteTile;
    private javax.swing.JMenu FileMenu;
    private javax.swing.JMenuItem LoadFile;
    private javax.swing.JPanel ManageTilePanel;
    private java.awt.Canvas MapCanvas;
    private javax.swing.JMenuBar MenuBar;
    private javax.swing.JMenuItem SaveFile;
    private javax.swing.JScrollPane ShowMapScroll;
    private java.awt.Canvas TileCanvas;
    private javax.swing.JScrollPane TileScroll;
    private BufferedImage tiles;
    private int tilecount = 0;
    /** Creates new form MapEditor */
    public EditorComponent()
    initComponents();
    AddTile("test.jpg", 0, 0, 10, 10);
    private void initComponents()
    ManageTilePanel = new javax.swing.JPanel();
    TileScroll = new javax.swing.JScrollPane();
    TileCanvas = new java.awt.Canvas();
    AddTile = new java.awt.Button();
    DeleteTile = new java.awt.Button();
    ShowMapScroll = new javax.swing.JScrollPane();
    MapCanvas = new java.awt.Canvas();
    MenuBar = new javax.swing.JMenuBar();
    FileMenu = new javax.swing.JMenu();
    SaveFile = new javax.swing.JMenuItem();
    LoadFile = new javax.swing.JMenuItem();
    getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    ManageTilePanel.setLayout(null);
    ManageTilePanel.setBorder(new javax.swing.border.TitledBorder("Tiles"));
    TileCanvas.setBackground(new java.awt.Color(255, 255, 255));
    TileScroll.setViewportView(TileCanvas);
    ManageTilePanel.add(TileScroll);
    TileScroll.setBounds(10, 22, 100, 230);
    AddTile.setLabel("Add");
    ManageTilePanel.add(AddTile);
    AddTile.setBounds(10, 260, 50, 26);
    DeleteTile.setLabel("Delete");
    ManageTilePanel.add(DeleteTile);
    DeleteTile.setBounds(60, 260, 50, 26);
    getContentPane().add(ManageTilePanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 10, 119, 290));
    ManageTilePanel.getAccessibleContext().setAccessibleName("TilesPanel");
    MapCanvas.setBackground(new java.awt.Color(255, 255, 255));
    MapCanvas.addMouseListener(new java.awt.event.MouseAdapter()
    public void mouseEntered(java.awt.event.MouseEvent evt)
    MapCanvasMouseEntered(evt);
    ShowMapScroll.setViewportView(MapCanvas);
    getContentPane().add(ShowMapScroll, new org.netbeans.lib.awtextra.AbsoluteConstraints(12, 10, 290, 290));
    FileMenu.setText("File");
    FileMenu.setContentAreaFilled(false);
    SaveFile.setIcon(new javax.swing.ImageIcon("D:\\java\\MapEditor\\Image\\Save16.gif"));
    SaveFile.setText("Save");
    SaveFile.addActionListener(new java.awt.event.ActionListener()
    public void actionPerformed(java.awt.event.ActionEvent evt)
    SaveFileActionPerformed(evt);
    FileMenu.add(SaveFile);
    LoadFile.setIcon(new javax.swing.ImageIcon("D:\\java\\MapEditor\\Image\\Open16.gif"));
    LoadFile.setText("Load");
    LoadFile.addActionListener(new java.awt.event.ActionListener()
    public void actionPerformed(java.awt.event.ActionEvent evt)
    LoadFileActionPerformed(evt);
    FileMenu.add(LoadFile);
    MenuBar.add(FileMenu);
    setJMenuBar(MenuBar);
    pack();
    private void MapCanvasMouseEntered(java.awt.event.MouseEvent evt)
    Cursor cursorshape = MapCanvas.getCursor();
    MapCanvas.setCursor(cursorshape.getPredefinedCursor(CROSSHAIR_CURSOR));
    private void AddTile(String image, int startx, int starty, int endx, int endy)
    try{
    tiles = ImageIO.read(new File(image));
    catch(Exception e)
    System.out.println("Image not Found");
    Graphics2D a =(Graphics2D)tiles.getGraphics();
    a.drawImage(tiles, 20,20,20,20,TileCanvas);
    private void LoadFileActionPerformed(java.awt.event.ActionEvent evt)
    FileDialog fd = new FileDialog(this, "Open", FileDialog.LOAD);
    //fd.setFile("*.map");
    fd.setDirectory(".");
    fd.setVisible(true);
    String filename = fd.getFile();
    System.out.println(filename);
    private void SaveFileActionPerformed(java.awt.event.ActionEvent evt)
    FileDialog fd = new FileDialog(this, "Save", FileDialog.SAVE);
    //fd.setFile("*.map");
    //fd.setFilenameFilter("*.map"); // HOW TO USE?????????????
    fd.setDirectory(".");
    fd.setVisible(true);
    String filename = fd.getFile();
    System.out.println(filename);
    public static void main(String args[])
    java.awt.EventQueue.invokeLater(new Runnable()
    public void run()
    new EditorComponent().setVisible(true);
    }

    You have at least two problems.
    1) You are mixing AWT and Swing. Instead of using a Canvas you should use either a JComponent or a JPanel.
    2) In Swing, drawing such are you are doing should be done within the paintComponent(Graphics g) method using the Graphics provided as an argument to the method.
    P.S. I can't test you code because for some reason you feal the need to use a NetBeans specific layout manager.

  • Image Icon not showing in "get info" for OS 10.9.4

         I  now have PS CC 2014 and the image icons are showing the "generic" .jpg and .psd files in the "get info" finder window, but on my desktop the images are showing their
         proper image icon.
         I was previously using PS CS 5 and the icons are showing up in the "get info" window, but with PS CC 2014 these icons are showing up as generic.
         To be clear the images I saved using PS CS 5 are showing the icons vs. the images I saved in CC 2014 where the icons are not showing in the "get info" window.
         I've compared preference settings with PS 2014 and PS 5 but their basically about the same.
         I'm including 2 images so you can see what I'm explaining. IMG_1627 is a PS CC2014 created image and Arturo is a PS 5 image.
         I did read about other PS users having similar issues but it looked to be unresolved.
         You may think what's the big deal, but I use these image icons to label my folders. A "trick" I've doing for over decade which helps keep my folders visually on track for me.
         Is anyone out there able to solve this issue??  

    I do on occasion get jpgs and pngs that won't render a thumbnail or preview in MacOS.  I have 10.9.5
    I don't have this problem, although I just have CC and CC 2014 on my Macbook.
    I would open those up in Preview.app and try a Save As... and I would get the thumbnail and thumbnail preview back.
    Not really the best idea,but you can see if it helps.
    These  are my file saving options, perhaps there is something there you can try.
    Gene

Maybe you are looking for

  • Connecting ipad to HP Deskjet 2540 printer

    Is there any special no how required to connect printer to ipad?

  • ORA-6502, "PL/SQL numeric or value error"

    I am having the [ORA-6502, "PL/SQL numeric or value error"] error when I call this procedure in PRE-INSERT trigger. CREATE OR REPLACE PROCEDURE L_CHECK_BAL_AMOUNT(P_TXN_CODE IN VARCHAR2, P_ABAL_MAIN_ACNT_CODE IN VARCHAR2, P_TD_DOC_DRCR_FLAG IN VARCHA

  • File name sort

    Bridge sorts file names in what might be called "logical sorting." However I have many folders with numerical names (based on case numbers) and finding any particular one is like searching through a haystack. Is there any way to get Bridge to sort fi

  • Access to the DPS cn=monitor tree

    I'd like to be able to access the cn=monitor tree of DPS without having to bind as the proxy manager. Is there a possible DPS setup to achieve this like using a pool without data source or creating a data source that point to the proxy itself ?

  • Is my player spoilt? how to send for repair if no more warran

    <FONT face=Century color=#ff33ff><EM>Hi there,</EM> <EM><FONT face=Century color=#ff33ff></EM> <EM><FONT face=Century color=#ff33ff>I think my mp3 player muvo tx fm is spoilt. Some days ago, i tried to insert into the usb port of my pc, the computer