Trying to get an image to display

Using the following query. I'm able to pull information from two tables and it's working
<cfparam name="PageNum_rsGetProducts" default="1">
<cfquery name="rsGetProducts" datasource="laurie">
SELECT product_ID, product_MerchantProductID, product_Name, product_Description, product_ShortDescription, prdctImage_ProductID, prdctImage_FileName
FROM dbo.tbl_products, dbo.tbl_prdtImages
WHERE product_ID = prdctImage_ProductID
ORDER BY product_Name
</cfquery>
<cfset MaxRows_rsGetProducts=10>
<cfset StartRow_rsGetProducts=Min((PageNum_rsGetProducts-1)*MaxRows_rsGetProducts+1,Max(rsGetPro ducts.RecordCount,1))>
<cfset EndRow_rsGetProducts=Min(StartRow_rsGetProducts+MaxRows_rsGetProducts-1,rsGetProducts.Rec ordCount)>
<cfset TotalPages_rsGetProducts=Ceiling(rsGetProducts.RecordCount/MaxRows_rsGetProducts)>
This is the HTML
<body>
<table border="1">
  <tr>
    <td>product_ID</td>
    <td>product_MerchantProductID</td>
    <td>product_Name</td>
    <td>product_Description</td>
    <td>product_ShortDescription</td>
    <td>pic </td>
  </tr>
  <cfoutput query="rsGetProducts" startRow="#StartRow_rsGetProducts#" maxRows="#MaxRows_rsGetProducts#">
    <tr>
      <td>#rsGetProducts.product_ID#</td>
      <td>#rsGetProducts.product_MerchantProductID#</td>
      <td>#rsGetProducts.product_Name#</td>
      <td>#rsGetProducts.product_Description#</td>
      <td>#rsGetProducts.product_ShortDescription#</td>
      <td><img src="#rsGetProducts.prdctImage_FileName#" /></td>
    </tr>
  </cfoutput>
</table>
</body>
</html>
However, the iamge doesn't display. All I get is the x. I went into DW and bound it to img.src and it's still not working - how can I get this to work

Some things for you to check:
does the image exist in the location referred to by the retrieved link?
was the image created as RGB rather than CYMK?
In general, you'll want all your images in a specific directory.

Similar Messages

  • How do i get an image to display????

    this is some code that i have developed to try to get an image to display. i realize that the arrays for images and sources aren't needed but i want to provide room for when i animate things. but i need to get them to display first. what am i doing wrong?
    import java.awt.*;
    import javax.swing.*;
    public class animate extends JFrame implements Runnable {
    Thread runner;
    int current;
    Image img[] = new Image[1];
    String[] source = {"thing.gif"};
         public animate() {
              super("animate");
              setSize(210,210);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel pane = new JPanel();
              pane.setBackground(Color.white);
              show();
              Toolkit kit = Toolkit.getDefaultToolkit();
              for(int i = 0; i < img.length; i++) {
                   img[i] = kit.getImage(source);
         if(runner == null) {
              runner = new Thread(this);
              runner.start();
         public void run() {
              while(true) {
              current = 1;
         public static void main(String Args[]) {
              new animate();
         public void paintComponent(Graphics comp) {
              Graphics2D com = (Graphics2D)comp;
              if(img[current] != null)
                   com.drawImage(img[current],0,0,this);
    com.drawString("hello",0,0);

    Is that the exact code you're trying to run?
    It won't work for several reasons but I'll limit my response to just answering your question. Don't use paintComponent, use paint.
    public paint( Graphics g )

  • After i reading bytes ,how do i get the image to display?

    After i reading bytes ,how do i get the image to display?
    i m lost after tis step:
    Image img=Toolkit.getDefaultToolkit().createImage(data1);

    You can create and use a Canvas. (and define the Paint method)
    Canvas c = new Canvas(){
            public void paint(Graphics g){
                g.drawImage(img,0,0,this);
    frame.add(c);

  • Trying to get a movieclip to display on top of an externally loaded swf

    I am trying to ensure that a movieclip named "Incorrect"
    displays on top of a swf file that loads with the following:
    loadMovieNum("map.swf",1);
    I'm sure it's pretty simple, but I couldn't find any good
    reference to a movieclip loading on top of an external swf. I tried
    loading the map.swf into a placeholder movieclip and doing a
    swapDepth, but then the code within the map.swf would no longer
    function properly.
    thanks.

    you must load that movieclip into a _level greater than 1.
    there is no work-around if you load map.swf into _level1.
    you could load map.swf into a target movieclip and then use
    the swapDepths() method of movieclips to control the apparent depth
    of map.swf and your movieclip.

  • Getting an image path & display an image  in JSp

    hi
    How to get image & particular image path stored in Database .in Jsp [ Image stored in anther drive ( D:\images) ]
    & my webroot dir in c:\apachetomcat\webapps....
    Any Help will be Appriciated
    [email protected]

    Crossposted in 10 forums.

  • Getting an image path & display an image  in JSp--webserver

    hi
    How to get image & particular image path stored in Database .in Jsp [ Image stored in anther drive ( D:\images) ]
    & my webroot dir in c:\apachetomcat\webapps....
    Any Help will be Appriciated
    [email protected]

    Crossposted in 10 forums.

  • Can't get background images to display on page

    I've been trying to add a background image/watermark to a document. Following the instructions in "Help" I put the image where I want it, and select the command "Move objects to section master." Instantly the image becomes invisible. Even with the opacity slider set at 100% the image is just not to be seen. I can still select it move it back to the document, but of course that's not what I'm trying to accomplish.

    And what color is the background of the Table?
    I am guessing not None.
    Peter

  • Trying to get 2d images on my GUI interface

    thanx for clicking the button, now if you can help me I would be eternally grateful
    I am having trouble representing my 2d images on a cardlayout. I want my buttons in my main class to be linked to a card described in another class which shows images on different JPanels, I can get my program to compile and run but I can't get the different cards to show up!!! any ideas??

    I have put my images on a JPanel, and I got them to come up on a JPanel.So there are images within the Panel. But when I try to apply CardLayout to that JPanel it all goes wrong, and I can't understand why. Heres the code see if you can make anything from it; at the moment the program compiles and runs but none of the images from the library class are shown on the library JPanel.
    here is the code that I have in a sub class (the main class is below)
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    import java.awt.geom.GeneralPath;
    import javax.swing.event.*;
    public class library extends JPanel {
    public library()
    cards = new Panel();
    layout = new CardLayout();
    cards.setLayout(layout);
    cards.add("Head", new contents());
    cards.add("Body", new bodies());
    add("Center", cards);
    public static void main(String[] args)
         library application = new library();
    application.setSize( 425, 160 );
    application.setVisible( true );
    public Panel cards;
    public CardLayout layout;
    class contents extends JPanel
    {  int level = 0;
    contents()
    public void paint( Graphics g )
    // call superclass' paint method
    super.paint( g );
    // get Graphics 2D by casting g to Graphics2D
    Graphics2D graphics2D = ( Graphics2D ) g;
    // draw Head1 filled with blue-yellow gradient
    graphics2D.setPaint( new GradientPaint
    ( 5, 30, Color.blue, 35, 100, Color.yellow, true ) );
    graphics2D.fill( new Ellipse2D.Double( 5, 30, 65, 100 ) );
    // draw Head2 filled with red gradient
    graphics2D.setPaint( Color.red );
    graphics2D.fill( new Ellipse2D.Double( 80, 30, 65, 100 ) );
    // draw Head3 filled with yellow gradient
    graphics2D.setPaint( Color.yellow );
    graphics2D.fill( new Ellipse2D.Double( 160, 30, 65, 100 ) );
    // draw Head4 filled with blue gradient
    graphics2D.setPaint( Color.blue );
    graphics2D.fill( new Ellipse2D.Double( 240, 30, 65, 100 ) );
    // draw Head5 filled with green gradient
    graphics2D.setPaint( Color.green );
    graphics2D.fill( new Ellipse2D.Double( 320, 30, 65, 100 ) );
    // draw Head6 filled with green gradient
    graphics2D.setPaint( Color.black );
    graphics2D.fill( new Ellipse2D.Double( 5, 130, 65, 100 ) );
    // draw Head7 filled with green gradient
    graphics2D.setPaint( Color.orange );
    graphics2D.fill( new Ellipse2D.Double( 80, 130, 65, 100 ) );
    // draw Head8 filled with green gradient
    graphics2D.setPaint( Color.pink );
    graphics2D.fill( new Ellipse2D.Double( 160, 130, 65, 100 ) );
    // draw Head9 filled with green gradient
    graphics2D.setPaint( Color.white );
    graphics2D.fill( new Ellipse2D.Double( 240, 130, 65, 100 ) );
    // draw Head10 filled with green gradient
    graphics2D.setPaint( Color.cyan );
    graphics2D.fill( new Ellipse2D.Double( 320, 130, 65, 100 ) );
    class bodies extends contents
    bodies()
    public void paint( Graphics g )
    // call superclass' paint method
    super.paint( g );
    // get Graphics 2D by casting g to Graphics2D
    Graphics2D graphics2D = ( Graphics2D ) g;
    // draw Head1 filled with blue-yellow gradient
    graphics2D.setPaint( new GradientPaint
    ( 5, 30, Color.blue, 35, 100, Color.yellow, true ) );
    graphics2D.fill( new Ellipse2D.Double( 5, 30, 65, 100 ) );
    here is the main class
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.GeneralPath;
    public class CharacterEditor2 extends JFrame implements ActionListener
         private Container pane;
         public JPanel sidebar = new JPanel();
         public JPanel library = new JPanel();
         public JPanel interface1 = new JPanel();
    private JPanel interface2 = new JPanel();
    private JPanel frameface = new JPanel();
    public JPanel cards = new JPanel();
         public CardLayout layout = new CardLayout();
         public JButton headb = new JButton ("Head");
         public JButton bodyb = new JButton ("Body");
         private JButton legsb = new JButton ("Legs");
         private JButton handsb = new JButton ("Hands");
         private JButton freeHandb = new JButton ("Free Hand");
         private JButton eyesb = new JButton ("Eyes");
         private JButton mouthb = new JButton ("Mouth");
         private JButton earsb = new JButton ("Ears");
         private JButton noseb = new JButton ("Nose");
         private JButton hairb = new JButton ("Hair");
         private JButton scene1b = new JButton ("scene 1");
         private JButton scene2b = new JButton ("scene 2");
         private JButton scene3b = new JButton ("scene 3");
         private JButton scene4b = new JButton ("scene 4");
         private JButton scene5b = new JButton ("scene 5");
              public CharacterEditor2()
         {addWindowListener(
              new WindowAdapter()
              { public void windowClosing(WindowEvent e)
              { System.exit(0);}
         pane = getContentPane();
    setTitle("JHH");
    library = new library();
    interface2.setBackground(Color.red);
    interface1.setBackground(Color.green);
    repaint();
    frameface.setLayout(new GridLayout(0,1));
    addButton(frameface, scene1b);
         addButton(frameface, scene2b);
    addButton(frameface, scene3b);
    addButton(frameface, scene4b);
    addButton(frameface, scene5b);
    repaint();
    Panel p1 = new Panel();
    p1.setLayout(new GridLayout(2,0));
    sidebar.setLayout(new GridLayout(3,0));
    addButton(sidebar, headb);
         addButton(sidebar, bodyb);
         addButton(sidebar, legsb);
         addButton(sidebar, handsb);
         addButton(sidebar, freeHandb);
         addButton(sidebar, eyesb);
         addButton(sidebar, mouthb);
         addButton(sidebar, earsb);
         addButton(sidebar, noseb);
         addButton(sidebar, hairb);
    p1.add(sidebar);
    p1.add(interface1);
    p1.add(interface2);
    p1.add(library);
         pane.add(p1, BorderLayout.CENTER);
    pane.add(frameface, BorderLayout.EAST);
    JMenuBar menuBar = new JMenuBar();
         this.setJMenuBar(menuBar);
         //Build the first menu.
         JMenu fileMenu = new JMenu("File");
         menuBar.add(fileMenu);
         //a group of JMenuItems under the "File" option:
         JMenuItem openMI = new JMenuItem("Open");
         openMI.addActionListener(this);
         fileMenu.add(openMI);
         JMenuItem saveMI = new JMenuItem("Save");
         saveMI.addActionListener(this);
         fileMenu.add(saveMI);
         JMenuItem closeMI = new JMenuItem("Close");
         closeMI.addActionListener(this);
         fileMenu.add(closeMI);
         //Separator
         fileMenu.addSeparator();
         JMenuItem exitMI = new JMenuItem("Exit");
         exitMI.addActionListener(this);
         fileMenu.add(exitMI);
         //Build second menu in the menu bar.
         JMenu createMenu = new JMenu("Create");
         menuBar.add(createMenu);
         //a group of JMenuItems for Create
         JMenuItem entryMI = new JMenuItem("Entry");
         entryMI.addActionListener(this);
         createMenu.add(entryMI);
         /* Search menu: */
         JMenu searchMenu = new JMenu("Search");
         menuBar.add(searchMenu);
         JMenuItem searchCharacterMI = new JMenuItem("Search by Character");
         searchCharacterMI.addActionListener(this);
         searchMenu.add(searchCharacterMI);
         JMenuItem searchBackgroundMI = new JMenuItem("Search by Background");
         searchBackgroundMI.addActionListener(this);
         searchMenu.add(searchBackgroundMI);
         JMenuItem searchMovieMI = new JMenuItem("Search by Movie.");
         searchMovieMI.addActionListener(this);
         searchMenu.add(searchMovieMI);
    } /* End of constructor */
    private void addButton (Container c, JButton b)
    { b.addActionListener(this);
    c.add(b);
    public void actionPerformed(java.awt.event.ActionEvent
    evt)
         layout.show(cards, evt.getActionCommand());
    public static void main(String[] args) {
         CharacterEditor2 window = new CharacterEditor2();
         window.setTitle("Character Editor");
         window.setSize(900, 700);
         window.setVisible(true);
    }

  • I'm trying to get the image to print correct size.  i've tried center image, fit to media image,  and they all come out the same size...smaller than the size in "image size".  is this an Epson problem or Photoshop problem.  Thanks!

    I just got a new printer...Epson R3000...but have had this problem before.  It's probably a simple fix, but I can't figure it out.  I'm asking for printing on 8.5 x 11 and the image comes out 6.5 x 9.5 every time.  Help please!  And thanks!

    The Epson site stated that the R3000 printer can print borderless however the quality will suffer in the expanded print area. Borderless is not supported on some heavy paper.  To me the means your better off limiting you images size to the standard print area. There will be magins about 1/8" on the four  sides so the print area on 8.5"x11" paper is 8.26" x 10.76"....
    Take note of the print size set by the epson driver it may change depending on the paper type set. Note my first epson 4800 setup where I set 8.5" x 11" sheet paper from tray into the printer setting the driver set a smaller size for the paper which was reflected into the Photoshop Print preview. It shows paper is 8.499" x 10.999 with a small unprintable area across the top....
    Paper
    Use paper under normal conditions:
    Temperature: 59 to 77 °F (15 to 25 °C)
    Humidity: 40 to 60% RH
    Note:
    Since the quality of any particular brand or type of paper may be changed by the manufacturer at any time, Epson cannot guarantee the quality of any non-Epson brand or type of paper. Always test a sample of paper stock before purchasing large quantities or printing large jobs.
    Single-sheets
    Size
    A4 (8.3 × 11.7 inches)
    A6 (4.1 × 5.8 inches)
    Letter (8.5 × 11 inches)
    Legal (8.5 × 14 inches)
    4 × 6 inches
    5 × 7 inches
    8 × 10 inches
    11 × 14 inches
    12 × 12 inches
    Half Letter (5.5 × 8.5 inches)
    B (11 × 17 inches)
    A3 (11.7 × 16.5 inches)
    Super B (13 × 19 inches)
    Paper types
    Plain paper
    Special papers distributed by Epson
    Thickness
    0.003 to 0.004 inch (0.08 to 0.11 mm) in the sheet feeder
    0.012 to 0.051 inch (0.3 to 1.3 mm) in the manual feed tray
    Weight
    17 lb (64 g/m2) to 24 lb (90 g/m2)
    Printable Area
    Note:
    When printing borderless, quality may decline in the expanded printable area. Borderless printing is not supported with poster board.
    Sheets
    Top: 0.12 inch (3 mm) minimum
    Left: 0.12 inch (3 mm) minimum
    Right: 0.12 inch (3 mm) minimum
    Bottom: 0.12 inch (3 mm) minimum
    Roll Paper
    Standard margins
    Borderless printing margins
    CD/DVDs
    Caution:
    Avoid printing in the clear plastic areas of your discs to prevent staining the disc with ink.

  • How do I get gallery images to display properly in...

    Any pictures that are in portrait mode are shown with the top and bottom cut off

    OK, I found what seems to work. That is to open the actual ppt version of the download (not the one that had already been opened & saved in Keynote) in Open Office. So I had to open Open Office & then navigate to the file to open it so that it didn't open in Keynote.
    At a One to One training on Keynote where I asked for help with this today he noted that it showed that the presentation had been created in an older version of PowerPoint--apparently 2003 for Windows which could explain some of the issues.
    Opening it in Open office it displayed mostly ok.  There were 2 or 3 or so slides where I had to tweak horizontal lines between bullet points that had crept up so some where through the text rather than under it. So I just selected the lines & nudged them into position.
    Its not perfect & for some reason, some of the lines seem a hair thicker than others (which I guess I could go back & figure out how to use the line thickness tool to adjust, but think I will leave well enough alone for now).
    As near as I can tell, this seems to work about equally well doing this on the Mac side or in Parallels in Windows 7. So will stick with the Mac side.
    This allows me to run the slide show with me controlling when the different bullet points, etc display. It didn't have any exotic animations or transitions--just rather plain vanilla ones.

  • Trying to get Row numbes to display in a DefaultTableCellRenderer

    Hello all.
    I have extended the defaultablecellrenderer and have got my JTanle to use it. Howeve, i want to represent the rows of the tables as well as the colums...so far i have managed to colour each row (by colour the first colum of the JTable) is there a wat to number these values, give the number of rows as an arguement? Many thanks, Rupesh.
    I call the renderer by
    _renderer = new MyTableCellRenderer();
    myTable.setDefaultRenderer(Object.class, _renderer );
    Btw - when i enter data into my table, it just disappears as soon as i click on another cell..is this because i havent implemented a setValue method in the renderer yet?
    import javax.swing.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.border.*;
    import java.awt.Component;
    import java.awt.Color;
    import java.awt.Rectangle;
    import java.util.*;
    import java.awt.*;
    public class MyTableCellRenderer extends DefaultTableCellRenderer{
         private Font cellFont;
         public MyTableCellRenderer() {
              super();
         private boolean isHeaderCell(int row, int column){return column == 0;}
         public Component getTableCellRendererComponent (JTable myTable, Object value, boolean isSelected, boolean hasFocus, int row, int column){
              if (isSelected && !(isHeaderCell(row,column))){
                   super.setForeground(myTable.getSelectionForeground());
                   super.setBackground(myTable.getSelectionBackground());
              else{
                   if (isHeaderCell (row, column)){
                        super.setBackground(Color.lightGray);
                        super.setForeground(myTable.getForeground());
                   else {
                   super.setForeground(myTable.getForeground());
                   super.setBackground(myTable.getBackground());
         cellFont = new Font("Times", Font.PLAIN, 20);
         setFont(cellFont);
         if (hasFocus) {
              setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
              if (myTable.isCellEditable(row,column)) {
                   super.setForeground(UIManager.getColor("Table.focusCellForeground"));
                   super.setBackground(UIManager.getColor("Tale.focusCellBackground"));
         else {setBorder(noFocusBorder);}
         Color bDis = getBackground();
         boolean colourEquals = (bDis != null) && (bDis.equals(myTable.getBackground()) ) & myTable.isOpaque();
         setOpaque (!colourEquals);
         return this;
    }

    Maybe this is what you are looking for. This code adds a line number for each row in the table:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class LineNumberTable extends JTable
        protected JTable mainTable;
        public LineNumberTable(JTable table)
            super();
            mainTable = table;
            setModel(new RowNumberTableModel());
            setPreferredScrollableViewportSize(getPreferredSize());
            getColumnModel().getColumn(0).setPreferredWidth(50);
            getColumnModel().getColumn(0).setCellRenderer( mainTable.getTableHeader().getDefaultRenderer() );
        public int getRowHeight(int row)
            return mainTable.getRowHeight();
        class RowNumberTableModel extends AbstractTableModel
            public int getRowCount()
                 return mainTable.getModel().getRowCount();
            public int getColumnCount()
                return 1;
            public Object getValueAt(int row, int column)
                return new Integer(row + 1);
        public static void main(String[] args)
            Object[][] data = { {"1", "A"}, {"2", "B"}, {"3", "C"} };
            String[] columnNames = {"Number","Letter"};
            DefaultTableModel model = new DefaultTableModel(data, columnNames);
            JTable table = new JTable(model);
            JScrollPane scrollPane = new JScrollPane( table );
            JTable lineTable = new LineNumberTable( table );
            scrollPane.setRowHeaderView( lineTable );
            JFrame frame = new JFrame( "Line Number Table" );
            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
            frame.setSize(400, 300);
            frame.setVisible(true);
    }

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • Getting an image from a file

    I am trying to get an image from a file
    is there a way to convert a BufferedImage into an Image?
    or otherwise get an Image directly from a file?
    my searches turn up nothing
    TIA

    okay, so here's the new code:
    //  image_tracer.java
    //  image tracer
    //  Created by Erik Schmidt on 8/21/06.
    //  Copyright (c) 2006 __MyCompanyName__. All rights reserved.
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.io.*;
    import java.awt.image.*;
    import java.util.ArrayList;
    import java.awt.Graphics;
    import java.net.*;
    import java.applet.*;
    //FILE class, deals with File IO (note: does not possess the full method count of the java.io class File, this class only supports IO)
    class FILE {
         private static String fname=new String();
         //class constructor, takes a String as an argument, returns nothing
         public FILE(String fName){
              fname=fName;
         }//end constructor
         //gets filename, takes no argument, returns a String
         public static String getFilename(){ return fname; }
         //Reads in a file, takes no arguments, returns a String-either the contents of the file, or an error message
         public static String readFile() throws FileNotFoundException,IOException {
              String ret=new String();
              String tempstr=new String();
              File tFile=new File(fname);
              BufferedReader inFile=new BufferedReader(new FileReader(new File(fname)));
              if(tFile.exists()){
                   while((tempstr=inFile.readLine())!=null) ret+=tempstr+"\n";
                   ret=ret.substring(0,ret.length()-1);
              }else{
                   return null;
              }//end if
              return ret;
         }//end readFile
         //Writes to a file, takes a String as an argument, returns true for sucess; false for IOException
         public static boolean writeFile(String str) throws IOException{
              PrintWriter prnt=new PrintWriter(new FileWriter(fname,false),true);
              try{
                   prnt.println(str);
                   return true;
              }catch(Exception ioe){
                   return false;
              }//end try/catch
         }//end writeFile
         //Appends text to a file, returns true on completion; false on IOException
         public static boolean appendFile(String str) throws IOException{
              PrintWriter prnt=new PrintWriter(new FileWriter(fname,true),true);
              try{
                   prnt.println(str);
                   return true;
              }catch(Exception ioe){
                   return false;
              }//end try/catch
         }//end appendFile
         //Tells if file exists.  Takes no arguments, returns true if it exists, false if not
         public static boolean exists(){
              File tf=new File(fname);
              if(tf.exists()) return true;
              else return false;
         }//end exists
    }//end FILE class
    class MyPanel extends JPanel {
         Graphics save;
         Image blank;
         Image face;
         ArrayList x;
         ArrayList y;
         ImageObserver ob;
         private class MListen implements MouseMotionListener {
              public void mouseDragged(MouseEvent e){
                   x.add(new Integer(e.getX()));
                   y.add(new Integer(e.getY()));
                   repaint();
              public void mouseMoved(MouseEvent e){
                   //do nothing
         public MyPanel(Image f){
              x=new ArrayList();
              y=new ArrayList();
              blank=Toolkit.getDefaultToolkit().createImage("~/sites/blank.jpg");
              //save=createImage(500,500).getGraphics();
              face=f;
              addMouseMotionListener(new MListen());
              x.add(new Integer(-30));
              y.add(new Integer(-30));
         public void paintComponent(Graphics g){
              g.drawImage(face,0,0,ob);
              //save.drawImage(blank,0,0,ob);
              g.setColor(Color.black);
              //save.setColor(Color.black);
              for(int i=0;i<x.size();i++){
                   //save.fillOval(((Integer)x.get(i)).intValue(),((Integer)y.get(i)).intValue(),20,20);
                   g.fillOval(((Integer)x.get(i)).intValue(),((Integer)y.get(i)).intValue(),20,20);
    class WListen extends WindowAdapter {
         public void WindowClosed(WindowEvent e){
              System.exit(0);
    class MainFrame extends JFrame {
         MyPanel panel;
         JButton submit;
         JPanel main;
         public MainFrame(Image face){
              super("Image Tracer");
              setSize(750,750);
              panel=new MyPanel(face);
              submit=new JButton("Save");
              main=new JPanel(new BorderLayout());
              main.add(panel,BorderLayout.CENTER);
              main.add(submit,BorderLayout.SOUTH);
              setContentPane(main);
    class IMAGE {
         public Image run(String filename){
              return Toolkit.getDefaultToolkit().createImage(filename);
    public class image_tracer {
        public static void main (String args[]) {
              IMAGE image=new IMAGE();
              MainFrame frame=new MainFrame(image.run("~/sites/face.jpg"));
              frame.addWindowListener(new WListen());
              frame.show();
    }ignore the file stuff, that's for later
    why does MainFrame not display the MyPanel object?

  • Problem with Adobe BRIDGE getting Photoshop/Image Processor menu

    When I open my drop-down or fly-out menu under TOOLS in Bridge (CS3 version), the entire portion of the menu which is supposed to appear next underneath the Cache line option is missing (i.e., Photoshop, Illustrator, InDesign, Start Meeting..., Photoshop services).
    What gives?
    I'm trying to get to Image Processor under the Photoshop menu option (which is supposed to appear in the Tools drop-down menu).
    Please tell me what's wrong. Thanks in advance.

    Thanks, but there IS no Photoshop subheading in my Tools menu.
    That exactly describes the problem I'm having!

  • I cant get a panel to display

    Im trying to get a panel to display with a text area, but it wont work.
    Here is the code:
    public ApplicationTest()
              frame.setContentPane(this);
              frame.setLocation(FRAME_UPPER_LEFT_X_COORD,FRAME_UPPER_LEFT_Y_COORD);
              frame.setSize(new Dimension(FRAME_WIDTH,FRAME_HEIGHT));
              frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              frame.setTitle(WINDOW_TITLE);
              frame.setResizable(false);
              addMouseListener(this);
              addMouseMotionListener(this);
              addKeyListener(this);
              setFocusable(true);
              scrollPane = new JScrollPane(this);
              GridLayout glayout=new GridLayout();
              setLayout(glayout);
              gbc=new GridBagConstraints();
              /*Creating the Menu Bar*/
              MenuBar=new JMenuBar();
              FileMenu=new JMenu("File");
              EditMenu=new JMenu("Edit");
              HelpMenu=new JMenu("Help");
              NewItem=new JMenuItem("New...");
              OpenItem=new JMenuItem("Open");
              SaveItem=new JMenuItem("Save");
              SaveAsItem=new JMenuItem("Save as...");
              ExitItem=new JMenuItem("Exit");
              MenuBar.add(FileMenu);
              MenuBar.add(EditMenu);
              MenuBar.add(HelpMenu);
              FileMenu.add(NewItem);
              FileMenu.add(OpenItem);
              FileMenu.add(SaveItem);
              FileMenu.add(SaveAsItem);
              FileMenu.add(ExitItem);
              frame.setJMenuBar(MenuBar);
              gbc.weightx=0.5;
              gbc.gridx=0;
              gbc.gridy=0;
              add(TopPanel(),gbc);
              frame.setVisible(true);
         }//End ApplicationTest()
           public JPanel TopPanel()
                JPanel temppanel=new JPanel();
                TextArea=new JTextArea(20,20);
                temppanel.add(TextArea);
                return temppanel;
           }//End TopPanel()If you have any ideas please let me know
    thanks
    Mike

    What IS your ApplicationTest class?
    Post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and see
    http://riters.com/JINX/index.cgi/Suggestions_20for_20Asking_20Questions_20on_20Newsgroups

Maybe you are looking for

  • OBIEE 11g Grand total issue

    Hello, I have one requirement where I want to show the data as follows Type          Metric          Values Type1          units          100           Days          50           % Calc     10% Type2           units          100           Days       

  • MessageBody.txt file instead of actual message body when attachment="true"

    Hi guys, Using XMLP 5.6.3 with EBS (with patch 5968876 applied) Trying to send out a PDF report via email using the bursting engine. We need the report to be attached but the message body to show in the actual message body window of the client. Right

  • Forwarding no longer puts the sender's name/number

    I think this may be due to a recent upgrade but undetected until now, but when I used to forward a text message it would say John(sender) said: blabla msg... now it only forwards the message, how come?

  • Chnage in Consignee address in Sales Order.

    Hi, After creating the standard process of sales .i.e SO, DN & Invoice.In VA02 I have change the consignee address in the header partner & save the document. When I check the DN & invoice header partners, there the changes are not reflected. So pleas

  • Duplicate folders in photos - the solution

    Starting with iOS 5 I was frustrated that I had what appears to be duplicate folders in Photos. The iPhone one, Photo Library, and the one that I sync from on my computer. Both had the same pictures Problem solved.... It turns out that if you add a s