Help with image viewer

Would love some help with this one.. I am new so please bare with me. This app just reads contents of a txt file. What I am trying to add is the ability to display an image inside the program frame with scrolls bars.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class Viewer extends JFrame
   private JMenuBar menuBar;
   private JMenu fileMenu;
   private JMenu fontMenu;
   private JMenuItem newItem;
   private JMenuItem openItem;
   private JMenuItem saveItem;
   private JMenuItem saveAsItem;
   private JMenuItem exitItem;
   private JRadioButtonMenuItem monoItem;
   private JRadioButtonMenuItem serifItem;
   private JRadioButtonMenuItem sansSerifItem;
   private JCheckBoxMenuItem italicItem;
   private JCheckBoxMenuItem boldItem;
   private String filename;
   private JTextArea editorText;
     private JLabel label;
   private final int NUM_LINES = 20;
   private final int NUM_CHARS = 40;
   public Viewer()
      setTitle("Viewer");
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      editorText = new JTextArea(NUM_LINES, NUM_CHARS);
      editorText.setLineWrap(true);
      editorText.setWrapStyleWord(true);
      JScrollPane scrollPane = new JScrollPane(editorText);
      add(scrollPane);
      buildMenuBar();
      pack();
      setVisible(true);
   private void buildMenuBar()
      buildFileMenu();
      buildFontMenu();
      menuBar = new JMenuBar();
      menuBar.add(fileMenu);
      menuBar.add(fontMenu);
      setJMenuBar(menuBar);
   private void buildFileMenu()
      newItem = new JMenuItem("New");
      newItem.setMnemonic(KeyEvent.VK_N);
      newItem.addActionListener(new NewListener());
      openItem = new JMenuItem("Open");
      openItem.setMnemonic(KeyEvent.VK_O);
      openItem.addActionListener(new OpenListener());
      saveItem = new JMenuItem("Save");
      saveItem.setMnemonic(KeyEvent.VK_S);
      saveItem.addActionListener(new SaveListener());
      saveAsItem = new JMenuItem("Save As");
      saveAsItem.setMnemonic(KeyEvent.VK_A);
      saveAsItem.addActionListener(new SaveListener());
      exitItem = new JMenuItem("Exit");
      exitItem.setMnemonic(KeyEvent.VK_X);
      exitItem.addActionListener(new ExitListener());
      fileMenu = new JMenu("File");
      fileMenu.setMnemonic(KeyEvent.VK_F);
      fileMenu.add(newItem);
      fileMenu.add(openItem);
      fileMenu.addSeparator();
      fileMenu.add(saveItem);
      fileMenu.add(saveAsItem);
      fileMenu.addSeparator();
      fileMenu.add(exitItem);
   private void buildFontMenu()
      monoItem = new JRadioButtonMenuItem("Monospaced");
      monoItem.addActionListener(new FontListener());
      serifItem = new JRadioButtonMenuItem("Serif");
      serifItem.addActionListener(new FontListener());
      sansSerifItem =
              new JRadioButtonMenuItem("SansSerif", true);
      sansSerifItem.addActionListener(new FontListener());
      ButtonGroup group = new ButtonGroup();
      group.add(monoItem);
      group.add(serifItem);
      group.add(sansSerifItem);
      italicItem = new JCheckBoxMenuItem("Italic");
      italicItem.addActionListener(new FontListener());
      boldItem = new JCheckBoxMenuItem("Bold");
      boldItem.addActionListener(new FontListener());
      fontMenu = new JMenu("Font");
      fontMenu.setMnemonic(KeyEvent.VK_T);
      fontMenu.add(monoItem);
      fontMenu.add(serifItem);
      fontMenu.add(sansSerifItem);
      fontMenu.addSeparator();
      fontMenu.add(italicItem);
      fontMenu.add(boldItem);
   private class NewListener implements ActionListener
      public void actionPerformed(ActionEvent e)
         editorText.setText("");
         filename = null;
   private class OpenListener implements ActionListener
      public void actionPerformed(ActionEvent e)
         int chooserStatus;
         JFileChooser chooser = new JFileChooser();
         chooserStatus = chooser.showOpenDialog(null);
         if (chooserStatus == JFileChooser.APPROVE_OPTION)
            File selectedFile = chooser.getSelectedFile();
            filename = selectedFile.getPath();
            if (!openFile(filename))
               JOptionPane.showMessageDialog(null,
                                "Error reading " +
                                filename, "Error",
                                JOptionPane.ERROR_MESSAGE);
      private boolean openFile(String filename)
         boolean success;
         String inputLine, editorString = "";
         FileReader freader;
         BufferedReader inputFile;
               label = new JLabel();
                add(label);
         try
            freader = new FileReader(filename);
            inputFile = new BufferedReader(freader);
            inputLine = inputFile.readLine();
            while (inputLine != null)
               editorString = editorString +
                              inputLine + "\n";
               inputLine = inputFile.readLine();
            editorText.setText(editorString);
            inputFile.close(); 
            success = true;
         catch (IOException e)
            success = false;
         return success;
   private class SaveListener implements ActionListener
      public void actionPerformed(ActionEvent e)
         int chooserStatus;
         if (e.getActionCommand() == "Save As" ||
             filename == null)
            JFileChooser chooser = new JFileChooser();
            chooserStatus = chooser.showSaveDialog(null);
            if (chooserStatus == JFileChooser.APPROVE_OPTION)
               File selectedFile =
                             chooser.getSelectedFile();
               filename = selectedFile.getPath();
         if (!saveFile(filename))
            JOptionPane.showMessageDialog(null,
                               "Error saving " +
                               filename,
                               "Error",
                               JOptionPane.ERROR_MESSAGE);
      private boolean saveFile(String filename)
         boolean success;
         String editorString;
         FileWriter fwriter;
         PrintWriter outputFile;
         try
            fwriter = new FileWriter(filename);
            outputFile = new PrintWriter(fwriter);
            editorString = editorText.getText();
            outputFile.print(editorString);
            outputFile.close();
            success = true;
         catch (IOException e)
             success = false;
         return success;
   private class ExitListener implements ActionListener
      public void actionPerformed(ActionEvent e)
         System.exit(0);
   private class FontListener implements ActionListener
      public void actionPerformed(ActionEvent e)
         Font textFont = editorText.getFont();
         String fontName = textFont.getName();
         int fontSize = textFont.getSize();
         int fontStyle = Font.PLAIN;
         if (monoItem.isSelected())
            fontName = "Monospaced";
         else if (serifItem.isSelected())
            fontName = "Serif";
         else if (sansSerifItem.isSelected())
            fontName = "SansSerif";
         if (italicItem.isSelected())
            fontStyle += Font.ITALIC;
         if (boldItem.isSelected())
            fontStyle += Font.BOLD;
         editorText.setFont(new Font(fontName,
                                fontStyle, fontSize));
   public static void main(String[] args)
      Viewer ve = new Viewer();
}I tried using JLabel() but I cant seem to make it work. Whenever i browse and select a .jpg it displays "�������t���o\�[��+�p��B3�+�p��B3�"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

In the future, Swing related questions should be posted in the Swing forum.
Whenever i browse and select a .jpg it displays "�������t���o\�[��+�p��B3�+�p��B3�" You can read in a jpg file and treat it like a text file.
Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html]How to Use Icons for the proper way to read images.

Similar Messages

  • Help with image ready on ps3 extended

    I am pretty new to photo shop and have cs3 extended.
    I have a Yorkie website where I cut out my Yorkies and paste them to differnet backgrounds.... a lady that does the ANIMATED pictures  HAS DID A COUPLE FOR ME ....BUT I NEED TO LEARN TO DO THIS MYSELF.  She will not tell folks how to do:)
    The problem is once you work with a pic that is animated already then try to  add a dog.....by pasting....it removes the animation in the background pic.... and the picture no longer moves once the dog is added ?....She said she puts thru IMAGE READY...which I do not see anywhere on CS3 extended.  I will try to insert a pic she did for me and any help would be greatly appreciated....as I can do but then the picture is no longer animated once altered in my photoshop but she is doing somehow.....so has to be poss ?  If I were to do this pic it would stop moving once the dogs were added....plus not as good as her but practicing........could it be the fact she is doing in layers and I am doing copy and paste...I do know she puts thru Image ready and I do not know where this is located on cs3 extended or how to do?
    am

    well...........l when I try to open Gif with the import and chose the video frames to layers...am getting a message saying I need Quicktime 7.1 to be able to do??? and when selecting import that is the only option I have to open my animated picture?...YOU HAVE BEEN SO MUCH HELP!   THANK YOU SO MUCH...! 
       BLUE MONDAY EXCLUSIVES   
    Date: Sat, 17 Apr 2010 20:23:27 -0600
    From: [email protected]
    To: [email protected]
    Subject: Re: Help with image ready on ps3 extended
    I'm not sure anyone mentioned this but if not to open GIFs using the import you have to enter the GIF name as GIF isn't listed as one of the options.
    It sounds like you are viewing the images in a maximized screen mode. To view more than one document, press F to cycle through the screen modes. FYI, only the contents of the currently selected document can be viewed in the layers palette.
    I'll just talk about copy/paste so as not to confuse...
    If you are going to copy/paste, click the frame around the dog document to target it. Your layers palette will now contain the contents of the dog document. Click on the layer in the layers palette with the selected dog over transparency. With that layer highlighted in your layers palette, press Ctrl A; then Ctrl C. (Select<Select All; Edit<copy if you prefer using the menu.) This will copy that layer into your clipboard.
    Next, click the frame of the document containing the animation. Click the topmost layer in the layers palette because we want you dog to be in the top layer. Press Ctrl + V. (Edit<Paste if you prefer using the menu).
    Your dog is most likely going to be too big. Use Edit<Free Transform to size and move the dog to the desired location.
    At this point, your dog should be showing in each frame in the animation palette.
    Example:
    http://forums.adobe.com/servlet/JiveServlet/downloadImage/25315/with-palettes-open.jpg
    I'm using the older Image Ready me method. The highlighted place in the palette is where you switch methods between the old method and the new timeline. Notice, I have the layers and animation palette both in the workspace...and I'm not in a maximized mode. The red arrow shows the correlation between the frame and the layer represented by it in the layers palette.
    Image:second-image.jpg
    Here I have a second image to slip into my animation. I have the creature selected and on it's own layer with transparency around it. Notice that the the layer with the isolated creature is highlighted. At this stage, I'll press Ctrl + A; then Ctrl + C to select and save this image to my clipboard.
    Image:creature-added.jpg
    Here, I've pasted (Ctrl + V or Edit<Paste) in my creature and resized it (Ctrl + T or Edit<free transform) so he can be jumped. I also added a shadow under my creature which I added to a layer under my creature. Notice that when Frame on is selected in the animation palette that the eye is on both the creature and the shadow. If I click the eye to turn them (creature and shadow layer) off, they disappear from the entire animation. I can make them appear at any frame by clicking the desired frame in the animation then turning on the eye icon for the creature and shadow layer in the layers palette. I can also adjust opacity if desired.
    You could even more than the one image if you want the dog to appear to move. Use the eyeball visibility to determine which pose will be used for that frame.
    Example:
    Image:jump-creature-gif.gif
    Here, I used transform warp to adjust the pose of the creature for a few frames as he's jumping the creature...just for fun.
    >

  • Help with images in Spry menus

    I need help making this work: I want my menu buttons and
    submenu buttons to be images rather than text. I've been able to
    set it up to use different images for each of the main and
    sub-level buttons, but only for the active state. I cannot figure
    out how to use a different set of "hover images" for the hover
    state. Note-- Each button and submenu button in the entire menu are
    different images, so I suspect I need to use different ID's for
    each, but I am not sure how to set that up in the
    SpryMenuBarHorizontal.css file for each different button in, at
    least, the active and hover states. Can anyone offer some help with
    this?:

    V1 - Thank you for the suggestion, but this does not exactly
    solve my dilemma. In its simplest terms, this is what I want to do:
    Create a single drop-down menu where there is "Item 1" with
    submenus "Item 1.1", "Item 1.2", and "Item 1.3". But, I want to use
    different images for each item and subitem in their Active and
    Hover states. So, in this example, there would be 8 different
    images... An Active and a Hover image for each of Item 1, Item 1.1,
    Item 1.2 and Item 1.3.

  • Problem With Image View After Cropping

    Hi All,
    I have a problem when I try to crop an image in CS4.  The crop tool works perfectly, however sometime the cropped image has parts of the image “out of line”  I believe the problem is just with the view, not the actual file.  I have saved the image and opened it in MS Picture Viewer and the image is perfect. 
    I was using Windows XP without a problem.  I have only experienced this since I upgraded to windows 7 64 bit.
    Below is a screen shot of the problem, not the bottom right of the image.  Any suggestions please.
    Thanks  - Vicki

    No, it was me.  Feel free to review the thread history at this URL if you'd like:  http://forums.adobe.com/message/4206899
    Your display driver IS out of date.  You really don't want the one from Microsoft's WHQL
    If you would like to be able to use the OpenGL-specific features, listed on the page below, as well as not have display corruption, I recommend you update SPECIFICALLY to Catalyst 11.7 (which carries driver version 8.872).  Anything up to 11.12 is probably okay, but 12.1 has some very specific problems with Photoshop.  Several of us on the forum here have had particularly good, solid results from 11.7.
    http://kb2.adobe.com/cps/405/kb405745.html
    -Noel

  • [CS3][JS] Help with image resizing

    I'm still a newbie of ID scripting.
    I'm using js scripting in Indesign CS3 to make an auto-impaginator and I have a problem with images.
    I charged my contents from an xml set of tables, that I put into a fixed textFrame of the master page.
    Because of the table needs to fill multiple pages, I made a function that keep creating pages and link the textFrames so that the table continues in various pages.
    In this whole process I have some images too, that I need to resize them to fill the cell, because now they pass the parent cell.
    I found a method that looks at the bounds and resizes the image and the rectangle too, but it doesn't work always, because if a image is overflowing, it hasn't any bound and it fails, and this causes other problems in my process, so I would find another method.
    So:
    Is there another way to resize an image on-the-way while importing it? Some xml attribute or preference?
    Or some method that works also if the image is overflowing?

    These forums are pointless. Adobe must believe that other users will cut the mustard. Absolutely a waste of effort for everyone. Adobe should PAY at least a junior developer involved in the projects to monitor and help with these posts. FLEX rules yeah and thousands more do scripting than develop plug ins...
    Come on Adobe, step up your better than this. Customer Service can be free to the customers ... we are not talking about GET IT ALL FREE, talking about buy it and create a community and support it, but then again LAYERS and INDESIGN SECRETS have people who actually want to help users rather than rabbit hole everything.
    Please join hands and SING...

  • Urgent Help with Image Gallery

    Hi,
    I really need help with an image gallery i have created. Cannot think of a resolution
    So....I have a dynamic image gallery that pulls the pics into a movie clip and adds them to the container (slider)
    The issue i am having is that when i click on this i am essentially clicking on all the items collectively and i would like to be able to click on each image seperately...
    Please see code below
    var xml:XML;
    var images:Array = new Array();
    var totalImages:Number;
    var nbDisplayed:Number = 1;
    var imagesLoaded:int = 0;
    var slideTo:Number = 0;
    var imageWidth = 150;
    var titles:Array = new Array();
    var container_mc:MovieClip = new MovieClip();
    slider_mc.addChild(container_mc);
    container_mc.mask = slider_mc.mask_mc;
    function loadXML(file:String):void{
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest(file));
    xmlLoader.addEventListener(Event.COMPLETE, parseXML);
    function parseXML(e:Event):void{
    xml = new XML(e.target.data);
    totalImages = xml.children().length();
    loadImages();
    function loadImages():void{
    for(var i:int = 0; i<totalImages; i++){
      var loader:Loader = new Loader();
      loader.load(new URLRequest("images/"+String(xml.children()[i].@brand)));
      images.push(loader);
    //      loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
    function onComplete(e:Event):void{
    imagesLoaded++;
    if(imagesLoaded == totalImages){
      createImages();
    function createImages():void{
    for(var i:int = 0; i < images.length; i++){
      var bm:Bitmap = new Bitmap();
      bm = Bitmap(images[i].content);
      bm.smoothing = true;
      bm.x = i*170;
      container_mc.addChild(bm);
          var caption:textfile=new textfile();
          caption.x=i*170; // fix text positions (x,y) here
       caption.y=96;
          caption.tf.text=(xml.children()[i].@brandname)   
          container_mc.addChild(caption);

    yes, sorry i do wish to click on individual images but dont know how to code that
    as i mentioned i have 6 images that load into an array and then into a container and i think that maybe the problem is that i have the listener on the container so when i click on any image it gives the same results.
    what i would like is have code thats says
    if i click on image 1 then do this
    if i click on image 2 then do something different
    etc
    hope that makes sense
    thanks for you help!

  • Help with images.....pliiiizzzzzz

    Im new to java and need help inserting images on a GUI! Does anyone have any programs or snippets of code that've done this successfully - preferrably using the GridBagLayout as well as in swing? If you have anything that works well, feel free to send me the entire java file ([email protected]) or just post it!

    Just create a JLabel with an image icon and you are able to display any JPEG and GIF image. You might take a look at the following:
    http://java.sun.com/docs/books/tutorial/uiswing/components/label.html
    Hope this helps,
    Pierre

  • Need Help with Crystal viewer and ActiveX

    Hi !!
    I have a problem that i cant seem to be able to solve. I had alot of help from the forum but i think i got everything mixtup now...
    From my addon i can print with CrystalReport Viewer or i cant print a Crystal report directly to my default printer, so thats good and working well. The problem is with Crystal Viewer that drags on the SBO screen and stays on the task bar.
    It is strongly recommended to use an Activex to display my Crystal Viewer report. I tried so many differrent ways allways ending up with class id errors, or private class errors.
    My report is called c:\report.rpt
    My Working CrystalViewer form is called 'frmCRV'
    Can some one help me thru this last step...  I tried with the Activex sample in SDK but i think i dont have to use the Tree function ??? am i right ??
    I'm running on SBO 2005 SP1 PL3
    Crystal Report .net V10 and .net for code.
    Thanks you all for your patience.

    Hi Again !
    I can now open a form with an Activex part but i cant pass my CrystalViewer in it. Always says specified cast not valid.
    Thanks

  • Help with Live View - Links Not Working

    Hello,
    I am having a problem with Live View.  It had been working just fine, until recently.  Now, when I load a site stored locally, the page looks normal and links highlight when I cursor over them, but when I click them no navigation takes place.  I just remain on the index page.  The site does test fine in IE8, Chrome, Firefox and used to test fine in Live View.  The same happens with all my sites.  No changes have been made to my system.  Maybe I changed a setting unknowingly?  Is there some type of setting that I am missing perhaps?  Any help would be appreciated.
    Jason

    Did you close and restart DW to see if that helps?
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • Help with CR Viewer XI

    Post Author: Lee XI
    CA Forum: General
    Hello all. I'm currently using CR XI (not server) and downloaded the Viewer yesterday to test on a spare pc. Reason for this is I want others to be able to view and set parameters I designed in the report(s). However, when you open the Viewer, no parameters that I set up are showing. (IE: date, State, Customer, etc) When I am in CR XI and I hit refresh it brings up all the parameters that should be available to the end users to adjust the report manually.The reason I'm trying to go this route is that our company is small and running CR server is out of the budget. Should the viewer allow for prompted params for those using the CR Viewer or not? I do not want to waste time with this if the Viewer cannot or will not allow end users to select a date range or state, or other params I want them to? I do not want to purchase another CR XI version because I do not want these users to have design access to the reports. I simply want them to be able to select certain params that I have set up for them. Thanks in advance! Lee

    Post Author: DRCL
    CA Forum: General
    I have discovered another issue with the viewer also.
    If a report is designed/saved in LANDSCAPE mode, but the recipient opens in the viewer and the printer default is PORTRAIT, then it automatically prints in Portrait. It scales to fit to the page.
    If the user overrides the default and changes it to LANDSCAPE, it still prints in Portrait.
    Any ideas on this or the linked OLE issues would be much appreciated.

  • Help with Images Maps,

    Hi,
    I have an HTML page where an IMG is loaded:
    <img src="images/renders/Main_Image.jpeg" alt="Main Image" name="Main_IMG" width="800" height="600" border="0" usemap="#Main_MAP" id="Main_IMG" />
    Then I have 4 images maps laid on top of the image:
    <map name="Main_MAP" id="Main_MAP">
      <area shape="poly" coords="--some numbers--" href="Area1.html" target="_parent" alt="Area1 Button" />
      <area shape="poly" coords="--some numbers--" href="Area2.html" target="_parent" alt="Area2 Button"  />
      <area shape="poly" coords="--some numbers--" href="Area3.html" target="_parent" alt="Area3 Button" />
      <area shape="poly" coords="--some numbers" href="Area4.html" target="_parent" alt="Area4 Button"/>
    </map>
    See Example:
    Each area is essentially an invisible button. I want to make it so when the mouse hovers over the areas, I want the background image to display something different. On mouse out of the area, I want the image to go back. When the user clicks the Area, the user is moved to another part of the site.
    Area 1 should change Main_Image.jpeg to Main_Image1.jpeg
    Area 2 should change Main_Image.jpeg to Main_Image2.jpeg
    etc.
    I thought I could do this with Images Maps, but I can't figure out how. Is there an easier way? I have Dreamweaver CS4.
    Thank you in advance!

    Hey CF. Thank you very much for the reply! I thought I was losing my mind trying to figure out a way.
    I'll try out the slice and dice approach... where's a turtle when you need one.
    Cheers Dude.
    S

  • Need help with image gallery and preloader

    Here is my  portfolio site currently. WWW.PALMEI.COM. When you go into the the galleries you can view the images; the images load and it's all working fine. But if I was to go back on the page before the image was to load the image loads later which is then in the way of everything and cannot be deleted or removed. What would a solution be for solving this problem. Also, my preloader is not working at all as you can tell.
    Here is my code in frame 1 for the perloader:
    [AS]
    stop();
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreLoader);
    function updatePreLoader(evtObj:ProgressEvent):void
                        var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
                        preloader_txt.text = percent+"%";
                                  if (percent==100) {
                                            nextFrame ();
    [/AS]
    Thank you very much for your help. Have developed headache and need some new eyes on it.

    Thank you again Ned for your reponse as you helped me solve the image array problem last week or so ago.
    Here is the code:
    [AS]
    stop();
    import fl.transitions.Tween;
    import fl.transitions.easing.*
    import fl.transitions.TweenEvent;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    var sep3Tween4:Tween = new Tween(Sep2_mc, "y", Regular.easeOut,338 , 655, 1, true);
    var sepTween4:Tween = new Tween(Sep_mc, "y", Regular.easeOut,0 , -320, 1, true);
    BoyBack.addEventListener(MouseEvent.CLICK, Portfolioclick);
    function Portfolioclick(evtObj :MouseEvent) {
              gotoAndStop("Portfolio");
               removeChild(B);
    var BoyBackTween:Tween = new Tween(BoyBack, "y", Regular.easeOut,510,487,2, true);
    BoyBackTween.addEventListener(TweenEvent.MOTION_FINISH, onfinis);
    function onfinis(e:TweenEvent):void {
    BoyBackTween.yoyo();
    var arrayB:Array = [ B1, B2, B3, B4, B5, B6, B7, B8,B9, B10, B11, B12];
    var arrayImages:Array = ["ill_1.jpg","ill_2.jpg","ill_3.jpg","ill_4.jpg","ill_5.jpg","ill_6.jpg","ill_7.jpg","ill _8.jpg", "ill_9.jpg","ill_10.jpg","ill_11.jpg","ill_12.jpg"];
    var imgLoader:Loader = new Loader;
    var B:BlackBox = new BlackBox();
    B.addChild(imgLoader);
    for (var i:uint=0; i<arrayB.length; i++){
         arrayB[i].mouseChildren = false;
         arrayB[i].addEventListener( MouseEvent.MOUSE_OVER, onButtonOver);
         arrayB[i].addEventListener( MouseEvent.MOUSE_OUT, onButtonOut);
         arrayB[i].addEventListener( MouseEvent.CLICK, onButtonRemoveB);
               arrayB[i].addEventListener( MouseEvent.CLICK, onButtonClick);
               arrayB[i].imgNum = i;
                     imgLoader.y  = 100;
                          imgLoader.x =275;
                          B.y = -55;
                     B.x =-100;
    function onButtonOver( e:MouseEvent ):void {
         var B:MovieClip = MovieClip(e.target);
         if(B.tween){
           B.tween.stop();
         B.tween = new Tween( B, "y", Regular.easeOut,600, 591, .5, true );
    function onButtonOut( e:MouseEvent ):void {
         var B:MovieClip = MovieClip(e.target);
         if( B.tween ){
           B.tween.stop();
         B.tween = new Tween( B, "y", Regular.easeOut, 591, 600, 1, true );
    function onButtonRemoveB( e:MouseEvent ):void {
    removeChild(TwoDtxt);
    function onButtonClick( e:MouseEvent ):void {
       if(this.contains(B)){
           removeChild(B);
       imgLoader.load(new URLRequest(arrayImages[e.currentTarget.imgNum]));
       imgLoader.contentLoaderInfo.addEventListener( Event.COMPLETE , loaded);
    function loaded(event:Event):void {
         addChild(B);
          var targetLoader:Loader = Loader(event.target.loader);
    var AlphaTween1:Tween = new Tween(T1, "alpha", Strong.easeOut, 1, .20, 2.5, true);
    var AlphaTween2:Tween = new Tween(Bottom1, "alpha", Strong.easeOut, 1, .20, 2.5, true);
    [/AS]
    Before the image loads if you were to click on the boy with the balloon"the back button" the image would than load later on say the"portfolio" part of the site.

  • Help with Image & Blog Bugs

    Hello all -
    Been putting together a site for the past few weeks, and we thought we had it all down pat until we went live. The links on the blog page come up with 404 errors, and (even worse) it seems that my Windows friends get image problems on the home page (the page loads fine for Mac folks). Anyone have any solutions? The blog works fine when we publish to the desktop. Thanks for the help!
    Site:
    www.vantiki.com
    Powermac Dual 2 G5 loaded   Mac OS X (10.4.5)  

    You know, it's really sad that your wonderful site has problems being viewed by Windows. They are TRULY missing something. Have you tried Firefox on Windows to see if it looks any better (I don't have access to my Windows machine right now)?
    Just checked out one of your blog pages. iWeb is sending you to
    http://www.vantiki.com/VanTiki/studionotes/795F2D5F-4102-428D-A4F3-6241687AD593. html
    when your page is actually here
    http://www.vantiki.com/VanTiki/studionotes/795F2D5F-4102-428D-%234DADCD.html
    The first one is what it SHOULD be, I don't know why it's converting it to the second one... could be a server related issue regarding character sets that I don't quite understand yet but I'm learning!

  • Help with live view new camera options...

    Hey guys...I have recently bought a hahnel remote shutter release so that I can take pics on the top of a mast around seven metres up.
    I have a 5 inch monitor at ground level to view the pictures taken, using an av cable from the camera. Problem is, I cant get a continuous "live view" image on the monitor, as you need to hold down the * button whilst in live view to auto focus, so I have to put up with just the shot thats been taken showing up after each shot instead!
    Does anyone know of a canon that would offer a continuous live view image on my monitor, without having to press the * button to auto focus?
    Ideally it would be one from the list below, as they are the cameras that my new hahnel wireless remote supports!
    I hope someone can help! cheers!
    List of supported cameras...would any of these offer live view without the need to press * to autofocus and take a shot:
    Compatible Camera Models:
    EOS 1200D / 1100D / 1000D / 650D / 600D / 550D /500D / 450D / 400D / 350D / 300D /
    70D / 60D / 50D / 40D / 30D / 20D / 20Ds /
    10D / 7D / 6D / 5D / 5D Mark II / 5D Mark III
    1D / 1DX / 1DC / 1Ds Mark III / 1Ds Mark IV
    SX50HS
    Powershot G10 / G11 / G12 / G15 / G1X Mk II
    Pentax Pentax K-5 II / K-5 IIs / K-5 / K-7 / K10 / K20 / K50 / K100 /
    K200 / K500
    Samsung GX10 / GX20

    What camera are you using?  Most "modern" Canon SLRs allow you to set focus during live view.   You move a little rectangle around to select your focus area.   But you need more than a monitor, you'd either need a computer (like a small netbook) running EOS Utility, or a tablet with DSLR Remote or equivilent on it.  The 70D and 6D both have WiFi ability, so you can do it from a smart phone, tablet, or computer, no wires needed.

  • A little more help with image

    I have refered to this thread to help me create my background image.
    http://forum.java.sun.com/thread.jspa?threadID=599393&messageID=3196643
    However I am stuck mostly because of not really fully grasping all the objects and how they work yet.
    Basically right now I have a JFrame and then I have a container which I put all my objects in.
    First question:
    What exactly does the following line of code do?
    Container contentPane = getContentPane();
    Does the "getContentPane()" method get the JFrame, since this is the class this line of code is embedded in?
    It sets contentPane which is a container to the JFrame?
    Second question...
    So using the above link I created a class called BackgroundImage and it works ...sort of. I have two windows - one is my JFrame game and the other is this background frame.
    Now I knew this would happen and I realize what I am supposed to do but I have been unsuccessful. Basically I need to make this JPanel my contentPane right?
    But when I say something like
    JPanel contentPane = panel my JFrame has nothing in it...
    How do I take this seperate window and incorporate it into what I already have.
    I want to use the contentPane variable since this is the variable where everything gets added throughout the code? I can't seem to get the JPanel to work.
    Take a look at some code snippets:
    public class DungMast extends JFrame
        /** Creates a new instance of EventPress */
        public DungMast() {
            Animation_Complete=false;
            Current_Level = 1;
            Level_Complete = false;
            CreateUserInterface();
            JPanel panel = new JPanel()
            protected void paintComponent(Graphics g)
           //  Dispaly image at at full size
         g.drawImage(img_BG.getImage(), 0, 0, null);
         //  Scale image to size of component
    //                    Dimension d = getSize();
    //                    g.drawImage icon.getImage(), 0, 0, d.width, d.height, null);
                        //  Fix the image position in the scroll pane
    //                    Point p = scrollPane.getViewport().getViewPosition();
    //                    g.drawImage(icon.getImage(), p.x, p.y, null);
                        super.paintComponent(g);
             panel.setOpaque( false );
             panel.setPreferredSize( new Dimension(400, 400) );
             scrollPane = new JScrollPane( panel );
             getContentPane().add( scrollPane );
             JButton button = new JButton( "Hello" );
             panel.add( button );
        }  //end constructor for main JFrame
    //Then I have something like
    JPanel contentPane = panel;
    }

    What exactly does the following line of code do?
    Container contentPane = getContentPane();
    It gets the content pane for the JFrame and saves a reference to it for later use, viz,
    the reference "contentPane" can be used to call methods in the Container class.
    Lightweight (Swing) top&#8211;level containers have a content pane that holds the child
    components for the parent container. See the comments section of the JRootPane class api
    for a birds&#8211;eye view.
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class BackgroundImage {
        private JPanel getContent(BufferedImage image) {
            // Make up our own content pane with an image
            // in the background.
            ContentPanel cp = new ContentPanel(image);
            // Add some components.
            cp.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.weighty = 1.0;
            for(int j = 0; j < 10; j++) {
                gbc.gridwidth = (j+1)%3 == 0 ? gbc.REMAINDER : 1;
                cp.add(new JButton(String.valueOf(j+1)), gbc);
            return cp;
        public static void main(String[] args) throws IOException {
            BufferedImage image = ImageIO.read(new File("images/cougar.jpg"));
            BackgroundImage test = new BackgroundImage();
            JFrame f = new JFrame();
            System.out.println("Default contentPane = " +
                                f.getContentPane().getClass().getName());
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(test.getContent(image));
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ContentPanel extends JPanel {
        BufferedImage image;
        public ContentPanel(BufferedImage image) {
            this.image = image;
            // This is required for JComponents that are used
            // as content panes since the Ocean LookAndFeel
            // (which can have non-opaque panels) was introduced.
            // Content panes must be opaque so they can draw
            // themseves and their child components.
            setOpaque(true);
            System.out.println("Default layout manager = " +
                                getLayout().getClass().getName());
        protected void paintComponent(Graphics g) {
            // Fill background with opaque color.
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            int x = (w - image.getWidth())/2;
            int y = (h - image.getHeight())/2;
            g.drawImage(image, x, y, this);
    }

Maybe you are looking for