Display images in Design windows

I'm using images on a AIR project, I see them in the compiled file but they're not loaded inside the Design window of Flash Builder.
Is it possible to display that images directly inside Flash Builder, avoiding to compile the project everytime I have to make a check on the images?

Babu,
Do search the forum before putting the issues. This issue has been discussed many times.
--Shiv                                                                                                                                                                                                                       

Similar Messages

  • CS3 - Viewing HTML in code window, when selecting  a image in design window on split mode wont work .

    Does any 1 know how i can enable my split to be able to
    select a image from the design mode window with mouse, and have it
    highlight in the code veiw.
    I have just upgraded to CS3 and in DW MX2004 i could select
    HTML from the code view , and attribute would highlight in the
    design view, and visa versa with the design mode, ..
    But atm all i can do is highlight and right click the text
    or image in the design view window when in split mode, to find the
    HTML for that selected, and it wont allow me to view the selected
    text or image in the design window, when i highlight the HTML ... i
    could do it in MX2004 , and its annoying me that i can't do this in
    CS3 ..
    Any hints on how to fix this would be very much appreciated
    Thanks in Advance

    ChAoTiC,
    That works for me on WinXP. After selecting your image in
    Design View,
    try hitting Ctrl+` on Win or Cmd+` on Mac to switch focus to
    the Code
    Pane. Does that work?
    HTH,
    Randy
    > Does any 1 know how i can enable my split to be able to
    select a image from the
    > design mode window with mouse, and have it highlight in
    the code veiw.
    >
    > I have just upgraded to CS3 and in DW MX2004 i could
    select HTML from the
    > code view , and attribute would highlight in the design
    view, and visa versa
    > with the design mode, ..
    >
    > But atm all i can do is highlight and right click the
    text or image in the
    > design view window when in split mode, to find the HTML
    for that selected, and
    > it wont allow me to view the selected text or image in
    the design window, when
    > i highlight the HTML ... i could do it in MX2004 , and
    its annoying me that i
    > can't do this in CS3 ..

  • Display Image in New Window

    I'm using a tabular form. My image is displaying correctly. I just want it to display in a new window. The code I'm using to display the image is listed below:
    CASE WHEN nvl(dbms_lob.getlength(p.photo_name),0) = 0
    THEN 'No Photo Available'
    ELSE '<a href="#OWNER#.download_image?p_id='
             || ceah_image.lookup_picture_url(v('P112_PERSON_ID'))
    || ' height="'
    || 200
    || '" width="'
    || 200
    || '">View Photo<a/>'
    Thanks, Elizabeth

    Hello,
    In your a href you can specify target="_blank". That should open a new window for you.
    Hope that helps.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/
    REWARDS: Please remember to mark helpful or correct posts on the forum

  • Preview doesn't display images to fit window

    I'm running OSX 10.6.8 on a 27" iMac, and when I enlarge the Preview window to fit the screen (by dragging the corner), the images don't enlarge. They seem to be stuck at about 1920 pixels wide (at a guess) instead of 2560 wide. I can zoom in, but I want the images to exactly fit the window. Preferences > Scale large images to fit window doesn't work, neither does View > Zoom to fit (which is grayed).
    Any suggestions as to how I make images fit the window?

    Hi, Guy Burns,
    What is the resolution of the images you try to enlarge?
    My guess:
    If the resolution of your images is lower then 2560 wide (your screen resolution), the window will open with the exact size and resolution of the picture (for instance 1920 wide). i.e. One pixel on your screen equals one pixel of your picture.You can indeed enlarge the window and zoom in, but then you are enlarging pixels, the image will get less sharp.
    The "Scale large images to fit window" function, is meant for "large images" as the name implies, so images with a larger resolution then your screen resolution. With this function, you can reduce the size of images that would otherwise not fit entirely on your screen, to the necessary size to view the whole picture as big as possible. So this function does not work if the "scale" is 100% or more.
    In slideshow mode however, there's a function to automatically adapt the size of smaller images to "full screen", and also "quicklook" (spacebar) supports full screen mode.

  • How to fix load image from another window?

    I have set up a page with a button when clicked, it open 2 windows on top,
    the right one first then pop up the left onload.
    Left window works as a menu, when clicks the thumbnail image on the left window
    will display an enlarged image on the right window.
    When browser preference set to block popup window
    it will only popup the right window, won't popup the left window (menu) onLoad.
    I've try to set the behavoir to pop up both left and right window onClick,
    it open 2 window but lost the function of display image on right window.
    It display the large image on the window underneath instead (the button page)
    I know it sounds confusing but hope someone can help to solve the problem
    Thank you

    Where is the URL to your site?
    Gramps

  • How can i display image in RTF template when Oracle Apps running in Windows

    Can any body help how can i display image in RTF template when oracle apps running in Windows Server.
    Thanks
    Ravi

    Hi Ravi,
    You can add images into your rtf template using MS Word Insert Picture feature.
    Did you try this method?
    Thanks
    Ravi
    [email protected]

  • How to display an image in a window ?

    Hi all,
    Could someone point me to a document that explains (preferably with code samples) how I go about displaying a JPEG image in a window.
    What I'm eventually trying to create is a slideshow, but for now, I just want to add an image to a JFrame and have that display, and even this simple first step is beyond me. There seem to be quite a few different classes to deal with images, but I'm just looking for the simplest one.
    With a view to my future requirements, I will want to be able to dynamically shrink an image so that it fits in the window, as well as cropping images so that the full resolution is displayed, but anything that doesn't fit in the window is chopped off.

    hi,
    how to place an image in the cells of a grid and to drag and drop that image. i have the code to locate the postion of each cell on mouse click. now i want to place an image in particular cell and i want to drag and drop that particular image to other cells of grid.
    is it possible.
    pls give me a suggestion.
    here my code:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class Grid
    public Grid()
    GridPanel gridPanel = new GridPanel();
    CellSelector cellSelector = new CellSelector(gridPanel);
    gridPanel.addMouseListener(cellSelector);
    JFrame f = new JFrame();
    //ImageIcon ii= create ImageIcon("C:/Documents and Settings/sreehari.m/Desktop/new/java //pgm/new");
    //cellSelector.addImageIcon();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(gridPanel);
    f.setSize(400,400);
    f.setLocation(200,200);
    f.setVisible(true);
    public static void main(String[] args)
    new Grid();
    class GridPanel extends JPanel
    double xInc, yInc;
    final int
    GRID_SIZE = 4,
    DRAW = 0,
    FILL = 1,
    PAD = 20;
    int[][] cells;
    public GridPanel()
    initCells();
    protected void paintComponent(Graphics g)
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
    double w = getWidth();
    double h = getHeight();
    xInc = (w - 2*PAD)/GRID_SIZE;
    yInc = (h - 2*PAD)/GRID_SIZE;
    // row lines
    double x1 = PAD, y1 = PAD, x2 = w - PAD, y2 = h - PAD;
    for(int j = 0; j <= GRID_SIZE; j++)
    g2.draw(new Line2D.Double(x1, y1, x2, y1));
    y1 += yInc;
    // col lines
    y1 = PAD;
    for(int j = 0; j <= GRID_SIZE; j++)
    g2.draw(new Line2D.Double(x1, y1, x1, y2));
    x1 += xInc;
    // fill cells
    g2.setPaint(Color.red);
    for(int row = 0; row < cells.length; row++)
    for(int col = 0; col < cells[0].length; col++)
    if(cells[row][col] == FILL)
    x1 = PAD + col * xInc + 1;
    y1 = PAD + row * yInc + 1;
    g2.drawString("("+row+","+col+")" , (int) x1+50, (int)y1+50);
    //g2.drawString("("+Grid("+row+","+col+")+")" , (int) x1+50, (int)y1+50);
    // g2.drawString("("")" , (int) x1+50, (int)y1+50);
    // g2.fill(new Rectangle2D.Double(x1, y1, xInc - 1, yInc - 1));
    public void toggleCellColor(int row, int col)
    int mode = DRAW;
    if(cells[row][col] == DRAW)
    mode = FILL;
    cells[row][col] = mode;
    repaint();
    private void initCells()
    cells = new int[GRID_SIZE][GRID_SIZE];
    for(int row = 0; row < cells.length; row++)
    for(int col = 0; col < cells[0].length; col++)
    cells[row][col] = DRAW;
    class CellSelector extends MouseAdapter
    GridPanel gridPanel;
    public CellSelector(GridPanel gp)
    gridPanel = gp;
    public void mousePressed(MouseEvent e)
    Point p = e.getPoint();
    int col = 0, row = 0;
    double x = gridPanel.PAD + gridPanel.xInc;
    // find column
    for(int j = 0; j < gridPanel.GRID_SIZE; j++)
    if(p.x < x)
    col = j;
    break;
    x += gridPanel.xInc;
    // find row
    double y = gridPanel.PAD + gridPanel.yInc;
    for(int j = 0; j < gridPanel.GRID_SIZE; j++)
    if(p.y < y)
    row = j;
    break;
    y += gridPanel.yInc;
    gridPanel.toggleCellColor(row, col);
    }

  • Need sample code using windows BitBlt() function to display image in CVI

    Hello all,
    I need a sample code which uses windows BitBlt() function to display image in CVI
    Thank you.
    Bob.

    Hello Bob -
    I'm curious why you'd like to use BitBlt.  What functionality does it offer that you've not seen in the CVI canvas control?
    It's hard to say without knowing what transitions you're looking for, but the canvas is very capable of animating/transitioning.  The place it can fall a little short is if you require access to the alpha channel for transparency.
    I put together a short demo for you - maybe it will address some of what you're looking for.  The important functions are CanvasStartBatchDraw, CanvasEndBatchDraw, and CanvasDrawBitmap.  The animation/transition is driven by a simple UI timer.
    Let me know if you have any questions -
    NickB
    National Instruments
    Attachments:
    CanvasAnimation.zip ‏10 KB

  • How to display two different parts of one image in two windows?

    hi everyone:) i need to display two different parts of one image in two windows. i have problem with displaying :/ because after creating windows there aren't any images :( i supose my initialization code of creating windows is incomplete, maybe i miss something or maybe there is some inconistency. graphics in java is not my strong position. complete code is below. can anybody help me?
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    import java.util.*;
    class ImgFrame extends JFrame
           private BufferedImage img;
           ImgFrame(BufferedImage B_Img, int x, int y, int w, int h)
                   super("d");
                   img=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
                   img=B_Img.getSubimage(x, y, w, h);
           }//end ImgFrame construction
           public void paint(Graphics g)
                   Graphics2D g2D = (Graphics2D)g;
                   g.drawImage(img, 8, 8, null);
           }//end paint method
           public Dimension getPrefferedSize()
                   if(img==null)
                           return(new Dimension(100,100));
                   else
                           return(new Dimension(img.getWidth(null),img.getHeight(null)));
           }//end of GetPrefferedSize method
    }//end ImgFrame class
    public class TestGraph2D_03 extends Component
           static BufferedImage IMG;
           public static void Load()
                   try
                           IMG=ImageIO.read(new File("c:/test.bmp"));
                   catch(IOException ioe)
                           System.out.println("an exception: "+ioe);
                   }//end try catch
           }//end TestGraph2D_03 construction
           public static void main(String[] args)
                   Load();
                   ImgFrame F1 = new ImgFrame(IMG, 0, 0, 8, 8);
                   ImgFrame F2 = new ImgFrame(IMG, 8, 8, 8, 8);
                   F1.addWindowListener(new WindowAdapter()
                           public void windowClosing(WindowEvent e)
                                   System.exit(0);
                   F1.pack();
                   F1.setVisible(true);
                   F2.addWindowListener(new WindowAdapter()
                           public void windowClosing(WindowEvent e)
                                   System.exit(0);
                   F2.pack();
                   F2.setVisible(true);
           }//end of main method in TestGraph2D_01 class
    }//end of TestGraph2D_03 class

    Never override the paint(...) method of a Swing component.
    If you have a sub image then add the image to a JLabel and add the label to the GUI. No need for custom painting.

  • Design Window Not Displaying Correctly

    In MX 2004, I have a layout in which the column structure is
    set forth in CSS, but the columns then contain HTML-defined tables.
    Is this mixture problematic in MX 2004? If I hit F12 or upload, the
    result is fine, but in the Design window, the display is thoroughly
    broken. Elements are skewed left-right-up-down, or don't appear at
    all. I'm flying blind.
    Is this problem known in MX 2004? If so, is it one of the
    things that "expanded CSS support" of Dreamweaver 8 fixes? I'm
    loath to upgrade if all I get is the same limitation.
    Thanks in advance

    > Is this mixture problematic in MX 2004?
    No. Most likely your code is 'troubled', even if it looks OK
    in the
    browser. Can you post a link to the page? Does the page
    validate?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "anabasis37" <[email protected]> wrote in
    message
    news:evpi7j$b3i$[email protected]..
    > In MX 2004, I have a layout in which the column
    structure is set forth in
    > CSS,
    > but the columns then contain HTML-defined tables. Is
    this mixture
    > problematic
    > in MX 2004? If I hit F12 or upload, the result is fine,
    but in the Design
    > window, the display is thoroughly broken. Elements are
    skewed
    > left-right-up-down, or don't appear at all. I'm flying
    blind.
    >
    > Is this problem known in MX 2004? If so, is it one of
    the things that
    > "expanded CSS support" of Dreamweaver 8 fixes? I'm loath
    to upgrade if
    > all I
    > get is the same limitation.
    >
    > Thanks in advance
    >
    >

  • Application designer issue - Cannot display image preview

    Hi guys,
    When I attempt to use an image icon as the label for a pushbutton,
    I receive this message in App Designer:
    "Cannot display image preview.
    The ImgDisplay ActiveX control may not be properly registered. Use the
    Install Workstation functionality of Configuration Manager to register this control"
    Anyone has the same experience on it ?
    Thanks in advance.

    What OS is your workstation running on?
    Which PeopleTools version are you running?
    Are your an administrator on the workstation?
    Did you try Install Workstation from Configuration Manager as stated in the error?

  • Make image display in a scroll window...

    can anybody help me out with making an image display in a scroll window and flip to the next picture when the scroll button is clicked? I am trying to create a simple image manager Applet.
    i have tried to use a regular scroll bar but I can only get it to work with a textbox not an image, does anybody know how I can do this.
    thanks

    This is what I have but it is quite plain... I want it to do more like select different categories. and maybe do a slide show or something... any suggestions??
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class imgViewer extends Applet implements ActionListener {
       private Button show, next, prev;
       private Image pics[] = new Image[9];
       private String [] gifName = {"img4", "img2", "img3"};
       private int currentImage=1;
       Panel p1;
    public void init(){
          for (int i = 0; i < gifName.length; i++) pics = null;
          Panel p1 = new Panel();
          show = new Button("Show");
          p1.add(show);
          show.addActionListener(this);
          next = new Button("Next");
          p1.add(next);
          next.addActionListener(this);
          prev = new Button("Previous");
          p1.add(prev);
          prev.addActionListener(this);
          add(p1);
       public void update(Graphics g) {
          paint(g);
       public void paint(Graphics g){
          Image image = getImage(getCodeBase(),gifName[currentImage]+".jpg");
          g.drawImage(image, 40, 40,200,200 ,this);
       public void actionPerformed(ActionEvent event){
          if (event.getSource()== next) {
             currentImage++;
             if (currentImage>=gifName.length) currentImage=0;
          } else if (event.getSource()== prev) {
             currentImage--;
             if (currentImage<0) currentImage=gifName.length-1;
          repaint();
    }

  • How to make mouseover effect text show image in popup window or tooltip?

    I am trying to display a popup image in a new window when the mouse moves over some text. Or perhaps, the image could display in a tooltip when the mouse moves over some text.
    However, I have achieved the functionality of an image appearing above the text when the mouse moves over some text. This is how I did this:
    I put this code into the Page HTML Header:
    <script type="text/javascript">
    <!--
    function setFirstChildImgDisplay(el,vis) {
    if(!el || !el.getElementsByTagName) return;
    el.getElementsByTagName('img')[0].style.display=vis;
    // -->
    </script>
    I created a region and put this in the Region's Title field:
    {div onmouseover="setFirstChildImgDisplay(this,'inline')"  onmouseout="setFirstChildImgDisplay(this,'none')">Check out Page 1 here <img src="#WORKSPACE_IMAGES#DGNR Preview Page 1.bmp" alt="Page 1 Preview" style="display:none;">{/div}
    I am thinking that I should not have all of this code in the Region's Title field. But, I don't know where else to put it in APEX.
    So my questions are:
    1. how to get an image to display in a popup window or as a tooltip when the mouse is moved over some text?
    2. where should the {div} content be placed in APEX, if not in the Title field?
    Please note that I used '{' & '}' instead of '<' & '>' just so the div would display in this post.
    Also, I would like to give credit to this website because this is where I found out how to do what I have provided above.
    http://forums.devshed.com/web-design-help-2/mouseover-effect-text-shows-image-321876.html
    Thank you in advance,
    Maggie

    It's just an image map. Play with the settings. Here's a shape layer making a hole in the water and adding a bit of color.

  • Photoshop CC displays images 25% smaller than other apps?

    Why is Photoshop CC displaying images 25% smaller than my other applications? If I open a 72 ppi square pixel aspect image in Photoshop, I have to zoom to 125% for it to be the same size on screen as in my browser or any other image viewer. Photoshop reads the correct pixel sizes, but displays it smaller.
    I design and build websites and have been using Photoshop for over 15 years and haven't noticed this until CC. If I save the images and build out the site, or even just drag the image into a browser and then overlay that browser window above the Photoshop window to see both images side by side, I can clearly see a 25% difference in size.
    If I zoom in Photoshop to 125%, then the sizes match. So, the problem is when designing a website, everything looks smaller in photoshop. Then when I build it out, everything is way too big.
    My browsers are definitely at 100% zoom and I can open the image in any other image viewer at 100% and the affect is the same.
    Is there a setting that can be adjusted in Photoshop to correct this?

    I also have the same issue. I can reporoduce exactly what Roger2012Jr mentions above.
    I have Photoshop CC, Windows 8.1, screen resolution 1920 x 1080. Files look really sharp in Photoshop, but when the file is exported (for web or not) the image is blurry and about 125% the size it was in Photoshop. Also, when I bring an image from the web, tried with a random image it still looks perfectly sharp in Photoshop, just about 80% actual size. That same image exported still looks perfect in the browser, same as it was originally.
    So starting from scratch with an image, there's no way to guarantee the quality when exported and quality looks really blurry. I can't use the program with any sense of confidence.
    Can someone from Adobe shed any light on this?

  • Open and display image in MVC layout

    Hello!
    I cant figure out how I shall do this in an MVC layout:
    The program request user to open an image file that are then displayed in a JLabel
    My setup at the moment resolve in a nullpointerexeption because it dont get any actual image file, but I dont understand what I have missed.
    I can not post the whole code fo you to run because it is to big, so I post the part that are the most important. please have a look.
    PicturePanel
    //Import Java library
    import javax.swing.*;
    import java.awt.*;
    public class PicturePanel extends JPanel {
         //Variables
         private ImageIcon picture;
         //Method to get information of the selected file
         PicturePanel (String fileName) {
              picture = new ImageIcon (fileName); //Get the filename
              int w = picture.getIconWidth(); //Get the image with
              int h = picture.getIconHeight(); //Get the image height
              //Set preferable size for the image (Use the properties for the selected image)
              setPreferredSize(new Dimension(w, h));
              setMinimumSize(new Dimension(w, h));
              setMaximumSize(new Dimension(w, h));
         //Method to draw the selected image
         protected void paintComponent(Graphics g) {
              super.paintComponent(g); //We invoke super in order to: Paint the background, do custom painting.
              g.drawImage(picture.getImage(), 0, 0, this); //Draw the image at its natural state
    }From my model:
    //Local attributes
         boolean check = false; //Used to see if a statement is true or not
         PicturePanel pp;
         JFileChooser fc;
         int returnVal;
    //newFile in File menu
         public void newFile() {
              //Open a file dialog in users home catalog
              fc = new JFileChooser();
              //In response to a button click:
              returnVal = fc.showOpenDialog(pp);
              System.out.println("You pressed new in file menu");
         }From my controler:
    //User press "New" in File menu
              else if (user_action.equals("New")) {
                   //Call method in model class
                   model.newFile();
                   //Update changes
                   if (model.returnVal == JFileChooser.APPROVE_OPTION) {
                        System.out.println("Hello1");
                        File f = model.fc.getSelectedFile();
                        if (model.pp != null)     
                             model.pp = new PicturePanel(f.getAbsolutePath());
                        System.out.println("Hello2");
                        //Display image (Here is line 83)
                        view.setImage_DisplayArea(model.pp);
                        System.out.println("Hello3");
              }From my view:
    //Sets the image to be displayed on the image_display area (Here is line 302)
         public void setImage_DisplayArea(PicturePanel pp) {
              image_display.add(pp);
         }The complet error:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at java.awt.Container.addImpl(Container.java:1015)You pressed new in file menu
    Hello1
    Hello2
         at java.awt.Container.add(Container.java:351)
         at View_Inlupp2.setImage_DisplayArea(View_Inlupp2.java:302)
         at Control_Inlupp2.actionPerformed(Control_Inlupp2.java:83)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050)
         at apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091)
         at java.awt.Component.processMouseEvent(Component.java:5602)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3129)
         at java.awt.Component.processEvent(Component.java:5367)
         at java.awt.Container.processEvent(Container.java:2010)
         at java.awt.Component.dispatchEventImpl(Component.java:4068)
         at java.awt.Container.dispatchEventImpl(Container.java:2068)
         at java.awt.Component.dispatchEvent(Component.java:3903)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
         at java.awt.Container.dispatchEventImpl(Container.java:2054)
         at java.awt.Window.dispatchEventImpl(Window.java:1801)
         at java.awt.Component.dispatchEvent(Component.java:3903)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)Edited by: onslow77 on Dec 16, 2009 5:00 PM
    Edited by: onslow77 on Dec 16, 2009 5:04 PM

    Hello again!
    Anyone that can help me figure out how to implement this in an MVC layout, I feel stuck.
    I post a little program that open and display an image file so that you better can understand what I whant to do.
    ShowImage
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    import javax.swing.filechooser.*;
    public class ShowImage extends JFrame{
         //Variables
         JFileChooser fc = new JFileChooser();
         PicturePanel pp = null;
         ShowImage () {
              super("Show"); //Title
              //Create the GUI
              JPanel top = new JPanel();
              add(top, BorderLayout.NORTH);
              JButton openBtn = new JButton("Open");
              top.add(openBtn);
              openBtn.addActionListener(new Listner());
              //Settings for the GUI
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setVisible(true);
         class Listner implements ActionListener {
              public void actionPerformed(ActionEvent ave) {
                   int answer = fc.showOpenDialog(ShowImage.this);
                   if (answer == JFileChooser.APPROVE_OPTION){
                        File f = fc.getSelectedFile();
                        //Check
                        System.out.println(f);
                        System.out.println(pp);
                        if (pp != null)
                             remove(pp); //Clean so that we can open another image
                        //Check
                        System.out.println(pp);
                        //Set the PicturePanel
                        pp = new PicturePanel(f.getAbsolutePath());
                        //Check
                        System.out.println(pp);
                        //Add PicturePanel to frame
                        add(pp, BorderLayout.CENTER);
                        validate();
                        pack();
                        repaint();
         //Main
         public static void main(String[] args) {
              new ShowImage();
    }PicturePanel
    //Import Java library
    import javax.swing.*;
    import java.awt.*;
    public class PicturePanel extends JPanel {
         //Variables
         private ImageIcon picture;
         //Method to get information of the selected file
         PicturePanel (String fileName) {
              picture = new ImageIcon (fileName); //Get the filename
              int w = picture.getIconWidth(); //Get the image with
              int h = picture.getIconHeight(); //Get the image height
              //Set preferable size for the image (Use the properties for the selected image)
              setPreferredSize(new Dimension(w, h));
              setMinimumSize(new Dimension(w, h));
              setMaximumSize(new Dimension(w, h));
         //Method to draw the selected image
         protected void paintComponent(Graphics g) {
              super.paintComponent(g); //We invoke super in order to: Paint the background, do custom painting.
              g.drawImage(picture.getImage(), 0, 0, this); //Draw the image at its natural state
    }//The endEdited by: onslow77 on Dec 16, 2009 7:30 PM

Maybe you are looking for

  • Converting Schema attributes to elements

    I have trouble registering a schema into Oracle. The problem seems to be that the schema defines Attributes and Oracle does not like Attributes. Does someone have a XSL to convert schema attributes into elements? I am able to convert the attributes i

  • Displaying pdf report in pop page by command button.

    Hi I am jdev 10.1.3.3 .I am displaying an pdf report on click of command button like this. FacesContext.getCurrentInstance().getExternalContext().redirect("http://www.acme.com/someCustomPath/myFantasticReport.pdf"); But problem is this.It is displayi

  • Iphoto and Mini Mac

    My mini mac came installed with a version of Iphoto but it is not compatible with the version of Iphoto I have `i can't find a version of iphot that will run with it.  `i have imported my iPhoto library from a mac air which has the newer versi

  • Lost bookmarks saving in older versions

    When using Acrobat 9, PDF Optimizer, to save to Acrobat 5.0 or 4.0 formats I lose bookmarks. They are retained if I save to Acrobat 6.0 format.

  • Solstice enterprise agent and Sun Mgmt Center

    Is anyone familiar with a way to convert a sub-agent developed with Solstice Enterprise Agent and APIs into a Sun Management Center sub-agent? I have a MIB as well as source code for the stubbed code generated by mibcodegen. ... Not sure if this is t