Help with ImageIcon

Hi,
I'm giving Java another try and I'm working through the short courses and Magercises. I'm having a problem with the code below.
<pre>
package examples.myapps.test;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class FirstSwing extends JFrame {
// The initial width and height of the frame
public static int WIDTH = 300;
public static int HEIGHT = 300;
// images for buttons
public Icon bee = new ImageIcon("bee.gif");
public Icon dog = new ImageIcon("dog.gif");
public FirstSwing(String lab) {
super(lab);
JButton top = new JButton("A bee", bee);
top.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("bee");
JButton bottom = new JButton("and a dog", dog);
bottom.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("dog");
top.setMnemonic (KeyEvent.VK_B);
bottom.setMnemonic (KeyEvent.VK_D);
Container content = getContentPane();
content.setLayout(new GridLayout(2,1));
content.add(top);
content.add(bottom);
public static void main(String args[]) {
FirstSwing frame = new FirstSwing("First Swing Stuff");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
frame.setSize(WIDTH, HEIGHT);
frame.setVisible(true);
</pre>
The problem is that the icons don't appear. The image files (bee.gif and dog.gif) are in the same directory as the source file. I get no errors, the images just do not appear in the button like they are supposed to according to the example. What am I doing wrong?
Thanks,
Mike

I had the same problem with ONE STUDIO 4 trying the example below ... the image is in the same directory as the class is and it�s ok ... it only work fine if I set the full absolute path, but not with a relative one ....
But I tryed the same example in the same dir with Jbuider 3 ... and it works fine and the ImageIcon appears .... I think it�s something related to Filesystems in the Studio One ....
Jo�o Carlos
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class LabelTest extends JFrame {
private JLabel label1, label2, label3;
public LabelTest()
super( "Testing JLabel" );
Container c = getContentPane();
c.setLayout( new GridLayout(3,1) );
// JLabel constructor with a string argument
label1 = new JLabel( "Label with text" );
label1.setToolTipText( "This is label1" );
c.add( label1 );
// JLabel constructor with string, Icon and
// alignment arguments
//Icon bug = new ImageIcon( "C:\\Documents and Settings\\Administrador\\examples\\ch12\\fig12_04\\bug1.GIF" );
Icon bug = new ImageIcon( "bug1.GIF" );
label2 = new JLabel( "Label with text and icon",
bug, SwingConstants.LEFT );
label2.setToolTipText( "This is label2" );
c.add( label2 );
// JLabel constructor no arguments
label3 = new JLabel();
label3.setText( "Label with icon and text at bottom" );
label3.setIcon( bug );
label3.setHorizontalTextPosition(
SwingConstants.CENTER );
label3.setVerticalTextPosition(
SwingConstants.BOTTOM );
label3.setToolTipText( "This is label3" );
c.add( label3 );
setSize( 275, 170 );
show();
public static void main( String args[] )
LabelTest app = new LabelTest();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
System.exit( 0 );
if your source is in
C:\foo\examples\myapps\test
put the gifs in
C:\fooThanks, but this isn't working either. My source is
in:
c:\java-ide\sampledir\examples\myapps\test.
I've placed the gifs in c:\java-ide,
c:\java-ide\sampledir, c:\java-ide\sampledir\examples,
etc. (all directories) and nothing shows the gifs in
the buttons. Any ideas?

Similar Messages

  • Help with placing the JComponents at a particular location in JPanel

    Hello All,
    I think it is simple in placing JLabel with an icon or just just text at a particular location in the JPanel. But it is notworking. I know it is very simple but i think i am missing something. Here is code please help with this code.
    Thanks
    Smithaimport java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.LayoutManager;
    import javax.swing.*;
    public class DocumentGraphicalRepresentation {
         public void buildDocumentation() {
              JFrame frame = new JFrame("Graphical Representation");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setBounds(0, 0, 475, 265);
              JPanel panel = new JPanel();          
              panel.setBounds(0, 0, 475, 265);
              panel.setBackground(Color.lightGray);
              //panel.setLayout(new BorderLayout());          
              JLabel label0 = new JLabel(new ImageIcon("c:/arrow.gif"));
              label0.setLocation(61, 68);
              label0.setOpaque(false);
              panel.add(label0);
              JLabel label1 = new JLabel(new ImageIcon("c:/bulb.gif"));
              label1.setLocation(338, 139);
              label1.setOpaque(false);
              panel.add(label1);
              frame.getContentPane().add(panel);
              frame.setVisible(true);          
         public static void main(String args[]) {
              DocumentGraphicalRepresentation document = new DocumentGraphicalRepresentation();
              document.buildDocumentation();
    }

    When adding components to a null layout you must set both a location and size for them to show up.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.LayoutManager;
    import javax.swing.*;
    public class DGR {
         public void buildDocumentation() {
              JFrame frame = new JFrame("Graphical Representation");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setBounds(0, 0, 475, 265);
              JPanel panel = new JPanel();          
              panel.setBounds(0, 0, 475, 265);
              panel.setBackground(Color.lightGray);
              //panel.setLayout(new BorderLayout());          
              JLabel label0 = new JLabel(new ImageIcon(//"c:/arrow.gif"));
                                         "images/geek/geek-----.gif"));
                    Dimension d = label0.getPreferredSize();
                    label0.setSize(d);
              label0.setLocation(61, 68);
    //          label0.setOpaque(false);
              panel.add(label0);
              JLabel label1 = new JLabel(new ImageIcon(//"c:/bulb.gif"));
                                         "images/hawk.jpg"));
                    d = label1.getPreferredSize();
                    label1.setBounds(338,139,d.width,d.height);
    //          label1.setLocation(338, 139);
              System.out.println("label1.isOpaque = " + label1.isOpaque());
    //          label1.setOpaque(false);
              panel.add(label1);
              frame.getContentPane().add(new JScrollPane(panel));
              frame.setVisible(true);          
         public static void main(String args[]) {
              new DGR().buildDocumentation();
    }

  • Need Help With D&D Program

    Hi, I'm not sure if I'm allowed to post questions on this forum but I can't find anywhere to talk to helpful people about programming.
    I'm making a dnd interface for JComponents. So far I've made a simple program that has a Component that can be lifted from a container and braught to the glass pane then later moved to anywhere on the screen and dropped into the container below it. Here's where my problems come:
    1) Rite now my 'Movable Component' is a JPanel which is just colored in. I want to either take a Graphic2d from a JComponent/Component and draw it on the JPanel or change the JPanel to the component I want to paint and disable the component.
    The problem with getting the Graphics2d is that if the component isn't on the screen it doesn't make a graphic object. I tried messing with the ui delicate and overriding parental methods for paintComponent, repaint, and that repaintChildren(forget name) but I haven't had luck getting a good graphics object. I was thinking of, at the beginning of running the program, putting 1 of each component onto the screen for a second then removing it but I'd rather not. I'd also like to change the graphics dynamicly if someone stretches the component there dropping and what not.
    The problem with disabling is that it changes some of the visual features of Components. I want to be able to update the Component myself to change how it looks and I don't want disabling to gray out components.
    I mainly just dont want the components to do any of there normal fuctions. This is for a page builder, by the way.
    Another problem I'm having is that mouseMotionListener is allowing me to select 2 components that are on top of one another when there edges are near each other. I don't know if theres a fix to this other than changing the Java Class.
    My next problem is a drop layout manager, but I'm doing pretty good with that rite now. It'll problem just move components out of the way of the falling component.
    One last thing I need help with is that I don't want the object that's being carried to go across the menu bar and certain areas. When I'm having the object being carried I have it braught up to the glass pane which allows it to move anywhere. Does anyone have any idea how I could prevent the component from being over the menu bars and other objects? I might have to make 1 panel is the movable area that can then be broken down into the 'component bank', 'building page' and whatever else I'm gonna need.
    This is all just test code to get together for when I make the real program but I need to make sure it'll be possible without a lot of hacking of code.
    Sorry for the length. Thanks for any help you can give.

    The trick to making viewable components that have no behaviour, is to render them onto an image of some sort (eg a BufferedImage). You can then display the Image on a JLabel that can be dragged around the desktop.
    Here is a piece of code that does the component rendering for you. This particular example uses a fixed component size, but you can modify that as you choose of course...public class JComponentImage
         private static GraphicsConfiguration gConfig;
         private static Dimension compSize = new Dimension(80, 22);
         private static Image image = null;
         public static Image getImage(Class objectClass)
              if (gConfig == null)
                   GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
                   GraphicsDevice gDevice = gEnv.getDefaultScreenDevice();
                   gConfig = gDevice.getDefaultConfiguration();
              image = gConfig.createCompatibleImage(compSize.width, compSize.height);
              JComponent jc = (JComponent) ObjectFactory.instantiate(objectClass);
              jc.setSize(compSize);
              Graphics g = image.getGraphics();
              g.setColor(Color.LIGHT_GRAY);
              g.fillRect(0, 0, compSize.width, compSize.height);
              g.setColor(Color.BLACK);
              jc.paint(g);
              return image;
    }And here is the class that makes the dragable JLabel using the class above...public class Dragable extends JLabel
         private static DragSource dragSource = DragSource.getDefaultDragSource();
         private static DragGestureListener dgl = new DragMoveGestureListener();
         private static TransferHandler th = new ObjectTransferHandler();
         private Class compClass;
         private Image image;
         Dragable(Class compClass)
              this.compClass = compClass;
              image = JComponentImage.getImage(compClass);
              setIcon(new ImageIcon(image));
              setTransferHandler(th);
              dragSource.createDefaultDragGestureRecognizer(this,
                                                          DnDConstants.ACTION_COPY,
                                                          dgl);
         public Class getCompClass()
              return compClass;
    }Oh and here is ObjectFactory which simply instantiates Objects of a given class and sets their text to their classname (very crudely)...public class ObjectFactory
         public static Object instantiate(Class objectClass)
              Object o = null;
              try
                   o = objectClass.newInstance();
              catch (Exception e)
                   System.out.println("ObjectFactory#instantiate: " + e);
              String name = objectClass.getName();
              int lastDot = name.lastIndexOf('.');
              name = name.substring(lastDot + 1);
              if (o instanceof JLabel)
                   ((JLabel)o).setText(name);
              if (o instanceof JButton)
                   ((JButton)o).setText(name);
              if (o instanceof JTextComponent)
                   ((JTextComponent)o).setText(name);
              return o;
    }Two more classes required by this codepublic class ObjectTransferHandler extends TransferHandler {
         private static DataFlavor df;
          * Constructor for ObjectTransferHandler.
         public ObjectTransferHandler() {
              super();
              try {
                   df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
              } catch (ClassNotFoundException e) {
                   Debug.trace(e.toString());
         public Transferable createTransferable(JComponent jC) {
              Transferable t = null;
              try {
                   t = new ObjectTransferable(((Dragable) jC).getCompClass());
              } catch (Exception e) {
                   Debug.trace(e.toString());
              return t;
         public int getSourceActions(JComponent c) {
              return DnDConstants.ACTION_MOVE;
         public boolean canImport(JComponent comp, DataFlavor[] flavors) {
              if (!(comp instanceof Dragable) && flavors[0].equals(df))
                   return true;
              return false;
         public boolean importData(JComponent comp, Transferable t) {
              JComponent c = null;
              try {
                   c = (JComponent) t.getTransferData(df);
              } catch (Exception e) {
                   Debug.trace(e.toString());
              comp.add(c);
              comp.validate();
              return true;
    public class ObjectTransferable implements Transferable {
         private static DataFlavor df = null;
         private Class objectClass;
         ObjectTransferable(Class objectClass) {
              try {
                   df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
              } catch (ClassNotFoundException e) {
                   System.out.println("ObjectTransferable: " + e);
              this.objectClass = objectClass;
          * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
         public DataFlavor[] getTransferDataFlavors() {
              return new DataFlavor[] { df };
          * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(DataFlavor)
         public boolean isDataFlavorSupported(DataFlavor testDF) {
              return testDF.equals(df);
          * @see java.awt.datatransfer.Transferable#getTransferData(DataFlavor)
         public Object getTransferData(DataFlavor arg0)
              throws UnsupportedFlavorException, IOException {
              return ObjectFactory.instantiate(objectClass);
    }And of course the test class:public class DragAndDropTest extends JFrame
         JPanel leftPanel = new JPanel();
         JPanel rightPanel = new JPanel();
         Container contentPane = getContentPane();
         Dragable dragableJLabel;
         Dragable dragableJButton;
         Dragable dragableJTextField;
         Dragable dragableJTextArea;
          * Constructor DragAndDropTest.
          * @param title
         public DragAndDropTest(String title)
              super(title);
              dragableJLabel = new Dragable(JLabel.class);
              dragableJButton = new Dragable(JButton.class);
              dragableJTextField = new Dragable(JTextField.class);
              dragableJTextArea = new Dragable(JTextArea.class);
              leftPanel.setBorder(new EtchedBorder());
              BoxLayout boxLay = new BoxLayout(leftPanel, BoxLayout.Y_AXIS);
              leftPanel.setLayout(boxLay);
              leftPanel.add(dragableJLabel);
              leftPanel.add(dragableJButton);
              leftPanel.add(dragableJTextField);
              leftPanel.add(dragableJTextArea);
              rightPanel.setPreferredSize(new Dimension(500,500));
              rightPanel.setBorder(new EtchedBorder());
              rightPanel.setTransferHandler(new ObjectTransferHandler());
              contentPane.setLayout(new BorderLayout());
              contentPane.add(leftPanel, "West");
              contentPane.add(rightPanel, "Center");
         public static void main(String[] args)
              JFrame frame = new DragAndDropTest("Drag and Drop Test");
              frame.pack();
              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              frame.setVisible(true);
    }I wrote this code some time ago, so it won't be perfect but hopefully will give you some good ideas.
    Regards,
    Tim

  • Help with double buffer

    I have a series of images that I display on a jLabel using imageIcon that get loaded depending on the mouse position on the label. I would like to preload these images somehow so that there is no wait time for the user when these images are called up. It seems that the doublebuffer object might help with this but I am not sure how....Any help appreciated..
    Jacques

    Well you can create an array of Image Icons and put you images there ...
    ImageIcon[] myImages = new ImageIcon[number_Of_Images]; -MaxxDmg
    - ' He who never sleeps...'

  • Need Help with Listener on JInternalFrame

    Below is the code as it is currently.
    public class addCustomer extends JInternalFrame implements ActionListener{
    //Variable declarations here
    private JPanel panel = new JPanel();
    private JLabel label1,label2,label3,label4,label5,label6,label7,label8,label9,icon1;
    private JTextField CustNum,CFName,CSName,Address1,Address2,City,PostCode,Tel,Cell;
    private JButton Cancel, Add;
    private ImageIcon pic,FrmPic;
    addCustomer() {
    super ("Add New Customer",true,true,true,true);
    setSize(350,370);
    setResizable(false);
    On the Frame I have a textfield that I would like to add a listener to. When text is typed into the textfield it should enable a JButton on the frame. My problem is that as soon as I implement KeyListener or EventListener on the above code I get an error of the class is not defined as abstract. If I define it as abstract my main declaration that looks like this gives me an error :
    public static void main(String args[]){
    new Video().show();
    Can anyone help me with a work around.
    Alexander

    Still have an error in the code. I don't know what I am doing wrong. this is the code so far.
    //This class will create the the Panel for Adding new Customers
    package VideoShop;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.io.*;
    import javax.swing.event.*;
    public class addCustomer extends JInternalFrame implements ActionListener{
    //Variable declarations here
    private JPanel panel = new JPanel();
    private JLabel label1,label2,label3,label4,label5,label6,label7,label8,label9,icon1;
    private JTextField CustNum,CFName,CSName,Address1,Address2,City,PostCode,Tel,Cell;
    private JButton Cancel, Add;
    private ImageIcon pic,FrmPic;
    addCustomer() {
    super ("Add New Customer",true,true,true,true);
    setSize(350,370);
    setResizable(false);
    //Sets the layout for the panel
    panel.setLayout(null);
    //Creates the labels
    label1 = new JLabel("Customer Nr");
    label2 = new JLabel("First Name");
    label3 = new JLabel("Surname");
    label4 = new JLabel("Address");
    label5 = new JLabel("Address");
    label6 = new JLabel("City");
    label7 = new JLabel("Postcode");
    label8 = new JLabel("Tel Nr");
    label9 = new JLabel("Cell Nr");
    //Creates the Textfields
    CustNum = new JTextField();
    CustNum.setEditable(false);
    CFName = new JTextField();
    CSName = new JTextField();
    Address1 = new JTextField();
    Address2 = new JTextField();
    City = new JTextField();
    PostCode = new JTextField();
    Tel = new JTextField();
    Cell = new JTextField();
    //Creates the buttons
    Cancel = new JButton("Cancel");
    Add = new JButton("Add");
    //Sets the alignment of the label controls
    label1.setBounds(20, 20, 90, 20);
    label2.setBounds(20, 50, 90, 20);
    label3.setBounds(20, 80, 90, 20);
    label4.setBounds(20, 110, 90, 20);
    label5.setBounds(20, 140, 90, 20);
    label6.setBounds(20, 170, 90, 20);
    label7.setBounds(20, 200, 90, 20);
    label8.setBounds(20, 230, 90, 20);
    label9.setBounds(20,260,90,20);
    //Sets the alignment of the Textfield controls
    CustNum.setBounds(100,20,90,20);
    CFName.setBounds(100, 50, 90, 20);
    CSName.setBounds(100, 80, 90, 20);
    Address1.setBounds(100, 110, 130, 20);
    Address2.setBounds(100, 140, 130, 20);
    City.setBounds(100, 170, 100, 20);
    PostCode.setBounds(100, 200, 65, 20);
    Tel.setBounds(100,230, 90,20);
    Cell.setBounds(100, 260, 90, 20);
    //Sets the alignment of the Button controls
    Add.setBounds(200, 310, 90, 20);
    Cancel.setBounds(85,310,90,20);
    //Creates an icon on the panel
    pic = new ImageIcon("/VideoShop/NotePad.gif");
    icon1 = new JLabel(pic);
    icon1.setBounds(280,10,50,50);
    //Adds Mnemonics
    Cancel.setMnemonic('c');
    Add.setMnemonic('a');
    //Adds listener to the Cell TextField to help with validation
    Cell.getDocument().addDocumentListener(new DocumentListener(){
    public void changeUpdate(DocumentEvent e){
    public void removeUpdate (DocumentEvent e){    
    adjust(e);
    public void insertUpdate(DocumentEvent e){      //ERROR////////////
    adjust(e);
    //Adds listeners to the buttons on the panel
    Cancel.addActionListener(this);
    Add.addActionListener(this);
    //Adds the controls to the panel
    panel.add(label1);
    panel.add(label2);
    panel.add(label3);
    panel.add(label4);
    panel.add(label5);
    panel.add(label6);
    panel.add(label7);
    panel.add(label8);
    panel.add(label9);
    panel.add(CustNum);
    panel.add(CFName);
    panel.add(CSName);
    panel.add(Address1);
    panel.add(Address2);
    panel.add(City);
    panel.add(PostCode);
    panel.add(Tel);
    panel.add(Cell);
    panel.add(Cancel);
    panel.add(Add);
    panel.add(icon1);
    //Gets the next customer number from the database
    //Variables for the database
    String dbuser = "";
    String dbpasswd = "";
    String DriverPrefix = "jdbc:odbc:";
    String DataSource = "Video";
    //Holds the value from the database
    String val1;
    //SQL String for writing data to database
    String SQLstring = "SELECT CustNum FROM Customers";
    //Loads the driver for the database
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null,"Error Loading driver\n"+e,"Driver Load Error",JOptionPane.WARNING_MESSAGE);
    Statement stmt = null;
    Connection con = null;
    //Create a connection to the database.
    try {
    con = DriverManager.getConnection(DriverPrefix+DataSource,dbuser, dbpasswd);
    stmt = con.createStatement();
    }catch (Exception e) {
    JOptionPane.showMessageDialog(null,"Cannot connect to Database\n"+e,"Connection Error",JOptionPane.WARNING_MESSAGE);
    ResultSet rs = null;
    //Gets data from the database
    try {
    rs = stmt.executeQuery(SQLstring);
    while (rs.next()){
    val1 = rs.getString(1);
    int val2 = Integer.parseInt(val1);
    val2++;
    CustNum.setText(String.valueOf(val2));
    } catch (Exception e){
    JOptionPane.showMessageDialog(null,"Cannot connect to database\n"+e,"Communication Error",JOptionPane.WARNING_MESSAGE);
    try {
    con.close();
    } catch (Exception e){
    JOptionPane.showMessageDialog(null,"Cannot close database\n"+e,"Error",JOptionPane.WARNING_MESSAGE);
    //Adds the panel to the InternalFrame and display it
    getContentPane().add(panel);
    show();
    //Here all action events are processed
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() == Cancel){
    dispose();
    if (e.getSource() == Add){
    ToDatabase();
    //Here the document event is processed
    public void adjust(DocumentEvent e){
    Cell.setEnabled(e.getDocument().getLength()>0);
    //Here the data will be sent to the database
    public void ToDatabase() {
    //Variables for the database
    String dbuser = "";
    String dbpasswd = "";
    String DriverPrefix = "jdbc:odbc:";
    String DataSource = "Video";
    //SQL String for writing data to database
    String SQLstring ="INSERT INTO Customers VALUES('"+CustNum.getText()+"', '"+CFName.getText()+"','"+CSName.getText()+"','"+Address1.getText()+"','"+Address2.getText()+"','"+City.getText()+"','"+PostCode.getText()+"','"+Tel.getText()+"','"+Cell.getText()+"')";
    //Loads the driver for the database
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null,"Error Loading driver\n"+e,"Driver Load Error",JOptionPane.WARNING_MESSAGE);
    Statement stmt = null;
    Connection con = null;
    //Create a connection to the database.
    try {
    con = DriverManager.getConnection(DriverPrefix+DataSource,dbuser, dbpasswd);
    stmt = con.createStatement();
    }catch (Exception e) {
    JOptionPane.showMessageDialog(null,"Cannot connect to Database\n"+e,"Connection Error",JOptionPane.WARNING_MESSAGE);
    //Transfer data to database
    try {
    stmt.executeUpdate(SQLstring);
    con.close();
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null,"Cannot update database\n"+e,"Communication Error",JOptionPane.WARNING_MESSAGE);
    dispose();
    The error that I receive is this:
    VideoShop/addCustomer.java [98:1] <anonymous VideoShop.addCustomer$1> is not abstract and does not override abstract method changedUpdate(javax.swing.event.DocumentEvent) in javax.swing.event.DocumentListener
    public void insertUpdate(DocumentEvent e){      //ERROR////////////
    ^
    1 error
    Errors compiling addCustomer.
    Is there a way around this or should I rewrite the whole class.
    Thanks
    Alexander

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • I need help with Sunbird Calendar, how can I transfer it from one computer to the other and to my iphone?

    I installed Sunbird in one computer and my calendar has all my infos, events, and task that i would like to see on another computer that i just downloaded Sunbird into. Also, is it possible I can access Sunbird on my iphone?
    Thank you in advance,

    Try the forum here - http://forums.mozillazine.org/viewforum.php?f=46 - for help with Sunbird, this forum is for Firefox support.

  • Hoping for some help with a very frustrating issue!   I have been syncing my iPhone 5s and Outlook 2007 calendar and contacts with iCloud on my PC running Vista. All was well until the events I entered on the phone were showing up in Outlook, but not

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

    Hoping for some help with a very frustrating issue!
    I have been syncing calendar and contacts on my iPhone 5 and Outlook 2007 using iCloud  2.1.3 (my PC is running Vista). All was well until the events I entered on the phone were showing up in Outlook, but not the other way around. I’ve tried the usual recommended steps: deselecting calendar and contacts in the iCloud control panel and then re-selecting, signing out of the panel and back in, and repairing the Outlook installation in control panel.  I even uninstalled iCloud on the PC and downloaded it again (same version). 
    The furthest I’ve gotten is step 2 (and once, step 3) of 7 while performing “Outlook Setup For iCloud.” At that point I get, “Your setup couldn’t be started because of an unexpected error.”  After the first attempt at all this, all my calendar events disappeared from Outlook, although they are still in iCloud calendar and on my phone.
    Sound familiar?  Any ideas on how to solve this iCloud/Outlook issue?  Thanks much in advance!

  • Help with HP Laser Printer 1200se

    HP Support Line,
    Really need your assistance.  I have tried both contacting HP by phone (told they no longer support our printer via phone help), the tech told me that I needed to contact HP by e-mail for assistance.   I then sent an e-mail for assistance and got that reply today, the reply is as follows  "Randall, unfortunately, HP does not offer support via e-mail for your product.  However many resources are available on the HP web site that may provide the answer to your inquiry.  Support is also available via telephone.  A list of technical support numbers can be round at the following URL........."  The phone numbers listed are the ones I called and the ones that told me I needed to contact the e-mail support for help.
    So here I am looking for your help with my issue.
    We just bought a new HP Pavillion Slimline Desk Top PC (as our 6 year old HP Pavillion PC died on us).  We have 2 HP printers, one (an all-in-one type printer, used maily for copying and printing color, when needed) is connected and it is working fine with the exception of the scanning option (not supported by Windows 7).  However we use our Laser Printer for all of our regular prining needs.  This is the HP LaserPrinter 1200se, which is about 6 years old but works really well.  For this printer we currently only have a parallel connection type cord and there is not a parallel port on the Slimline HP PC.  The printer also has the option to connedt a USB cable (we do not currently have this type of cable).
    We posed the following two questions:
    1.  Is the Laser Jet 1200se compatible with Windows 7?
    and if this is the case
    2.  Can we purchase either a) a USC connection cord (generic or do we need a printer specific cord)? or b) is there there a printer cable converter adapater to attach to our parallel cable to convert to a USB connection?
    We do not want to purchase the USB cable if Windows 7 will not accept the connection, or if doing this will harm the PC.
    We really would appreciate any assitance that you might give us.
    Thank you,
    Randy and Leslie Gibson

    Sorry, both cannot be enabled by design.  That said, devices on a network do not care how others are connected.  You can print from a wireless connection to a wired (Ethernet) printer and v/v.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Going to Australia and need help with Power converters

    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  

    godzillafan868 wrote:
    Facts:
    US uses 110v on 60hz
    Australia 220v on 50hz
    Making sure I understood that correctly.  Devices I plan on bringing that will use power are PS3 Slim, MacBook Pro 2008 model, and WD 1TB External HDD.  My DS, and Cell are charging via USB to save trouble of other cables.
    Ideas I've had or thought of:
    1.  Get a power converter for a US Powerstrip, and then plug in my US items into the strip and then the strip into an AUS Converter into Australian outlet.  Not sure if this fixes the voltage/frequency change.
    2.  Get power converters for all my devices.  But, not sure if my devices needs ways of lowering the voltage/increasing frequency or something to help with the adjustment.
    3.  Buy a universal powerstrip, which is extremely costly and I wouldn't be able to have here in time (I leave Thursday).  Unless Best Buy carrys one.  
    Check the specs on input voltage/frequency of your power supplies.
    Many laptop power supplies are "universal/global" and are specced something like 80-265 volts AC 50/60 Hz, but not all.  These will just need a connector adapter.
    Unsure about the PS3 Slim - if it isn't universal it could be difficult as you'll need a 110/220 transformer, one big enough (power-handling wise) for the PS3 will be very bulky.
    For the external WD HDD, if it doesn't have a universal supply, you're probably best off just finding a new wallwart for it that is capable of running on 220/50.
    *disclaimer* I am not now, nor have I ever been, an employee of Best Buy, Geek Squad, nor of any of their affiliate, parent, or subsidiary companies.

  • Creation of context sensitive help with pure FM 12 usage doesn't work

    Hi,
    I hope somebody is able to help me with a good hint or tip.
    I am trying to create a context-sensitive Microsoft Help with FM12 only using the abilities of FM (no RoboHelp). For some reasons, my assigned ID's are not used in the generated chm file and therefore the help does not work context-sensitively.
    What did I do?
    - I created my FM files and assigned topic aliases to the headers. I did this two ways: a) using the "Special" menue and assigning a CSH marker and/or b) setting a new marker of type "Topic Alias" and typing the ID. I used only numeric IDs like "2000" or "4200",
    - I created a .h file (projectname.h) - based on the format of the file projectname_!Generated!.h (I read this in some instructions). So the .h file (text file) looks like this:
    #define 2000 2000 /* 4 Anwendungsoberfläche */
    #define 2022 2022 /* 4.1.1 Menü Datei */
    #define 2030 2030 /* 4.1.3 Menü Parametersatz */
    #define 2180 2180 /* 6.6.7 Objektdialog Q-Regler */
    #define 2354 2354 /* 6.9.2 Objektdialog Extran Parameter */
    #define 2560 2560 /* 6.9.5 Objektdialog Extran2D Parametersatz */
    - I published the Microsoft HTML Help. A projectname_!Generated!.h has been created. My IDs were not used in this file:
    #define 2000    1
    #define 2022    2
    #define 2030    3
    #define 2180    4
    #define 2354    5
    #define 2560    6
    - When I open the .chm file and look in the source code, the ID even is totally different. It is not the one, I assigned in FM, it is not the one which I assigned in the projectname.h file and it even is not the one, which was put in the projectname_!Generated!.h file. It is a generated name starting with CSH_1 ...n in a consecutive way numbered.
    Example:
    <p class="FM_Heading1"><a name="XREF_72066_13_Glossar"></a>Gloss<a name="CSH_1"></a>ar</p>
    What goes wrong? Why does FM not take my assigned IDs? I need to use these IDs since our programmers are using those already - I had to re-create the whole online help but the programs stay untouched.
    Please help!
    Many thanks
    Mohi

    Hi Jeff,
    thanks for your note!
    The text in my marker is just a number like "2000" or "4200". As said, I created manually a my.h file and used this marker there. E.g.
    #define 2000 2000.
    Whereby the first 2000 (in my opinion) is the marker text and the second 2000 is the context ID which the programmers are using for the context sensitive call of the help. My definitions in the my.h file were translated to #define 2000 1 (in the my_!Generated!.h file). The source code "translates" the context ID into CSH_8.
    I am still confused :-/
    Thanks
    Mohi

  • Need help with Boot Camp and Win 7

    I have iMac 27" (iMac11,1) 2.8 GHz, quad core, 8MB of L3, 8GB of Memory, Boot ROM Version IM111.0034.B02 and SMC Version 1.54f36 and can't get this machine to run Windows 7 using Boot Camp.  I have successfully loaded Win 7 but when it claims to be starting I only get a black screen after initial start up.
    I have checked and rechecked my software updates and have read and reread the instructions, however, I can't update my Boot Camp to 3.1 (my machine says i'm running 3.0.4) and I need 3.1 but can't load 3.1 because it is an exe file that has to be loaded into Windows after I load Windows but can't open Windows because I can't load Boot Camp 3.1.  That's my excuse anyway, so I'm missing something I just can't figure out what it is....this is where you come in!
    Thanks.
    Mike

    Mike,
    I'm not going to be much help with Boot Camp however I can direct you to the Boot Camp forum where there are more people that know how to troubleshoot it and Windoze 7. You can find it at:
    https://discussions.apple.com/community/windows_software/boot_camp
    Roger

  • Can some help with CR2 files ,Ican`t see CR2 files in adobe bridge

    can some help with CR2 files ,I can`t see CR2 files in adobe bridge when I open Adobe Photoshop cs5- help- about plugins- no camera raw plugins. When i go Edit- preference and click on camera raw  shows message that Adobe camera raw plugin cannot be found

    That's strage. Seems that the Camera Raw.8bi file has been moved to different location or has gone corrupt. By any chance did you try to move the camera raw plugin to a custom location?
    Go To "C:\Program Files (x86)\Common Files\Adobe\Plug-Ins\CS5\File Formats" and look for Camera Raw.8bi file.
    If you have that file there, try to download the updated camera raw plugin from the below location.
    http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5371&fileID=5001
    In case  you ae not able to locate the Camera Raw.8bi file on the above location, then i think you need to re-install PS CS5.
    [Moving the discussion to Photoshop General Discussions Forum]

  • Be grateful for your help with Photoshop Elements which I have been using for several years.

    Be grateful for your help with Photoshop Elements which I have been using for several years.  Does Elements need to have access to ‘My Pictures’ on Windows as when I remove Photos from ‘My Pictures’, Elements later, when backing up, gives a message that it is unable to ‘reconnect’ to the same picture on elements.  On other occasions when removing a photo from Elements catalogue I also get a similar message when backing up saying ‘unable to reconnect’.  1. Is there a relationship between Elements and My Pictures and is Elements dependant on    the Windows ‘My Pictures’? 2. Why does some photos in Elements in some cases cause them to multiply e.g. double; triple; quadruple; and on occasions even more?  Is there something I need to do to stop this or an easy way I can remove the multiples without spending hours doing it manually one by one?  Am I doing something wrong? My O/S is Windows XP SP2 and windows Vista on my Laptop.  I have been using Elements 5 and have just purchased Photoshop Elements 8.0. (Upgrade) and about to install it. Be grateful for any advice as I do enjoy using the program if only I can resolve this issue.  I am not a PC wiz and mainly use Elements to catalogue photos from which I compile collections and from them slide shows with music.  Any advice appreciated Sonny.t PS Have tried to post this previously but without success so hoping to see message appear and a +response

    The organizer doesn't care where you send your photos when you download them via the downloader or where they happen to be when you first bring them in if you use the Get Photos command, but once your pics are in the Organizer, you *must* move them from within organizer or it can't find them. You don't have to use My Pictures at all if you don't want to, but regardless of the folder where you put your photos, if you want them someplace else, you use organizer to do it.

  • Query Help with Parent, Child, Child's Child

    Hi all,
    Need some help with a query.  I'm trying to create a stored procedure that is sort of like a Customer, Order, Order, Details.  In my situation the tables are different but nevertheless, I want to grab all the fields from the  Parent, Child,
    and Childs' Child, where the Parent.ParentID = @Parameter.  I tried this:
    CREATE PROCEDURE [dbo].[spGetCompleteProjectXML]
    @ProjectID int = 0
    AS
    SELECT *,
    (SELECT *,
    (SELECT *
    FROM PageControls
    WHERE (PageControls.ProjectPageID = ProjectPages.ProjectPageID))
    FROM ProjectPages
    WHERE (ProjectPages.ProjectID = @ProjectID))
    FROM Projects
    WHERE (ProjectID = @ProjectID)
    FOR XML AUTO, ELEMENTS
    RETURN 0
    I think I'm close, but it was my best effort.  Could someone help?
    thanks in advance

    Hi TPolo,
    Regarding your description, are you looking for a sample like below?
    CREATE TABLE customer(customerID INT, name VARCHAR(99))
    INSERT INTO customer VALUES(1,'Eric')
    INSERT INTO customer VALUES(2,'Nelson')
    CREATE TABLE orders(orderID INT,customerID INT)
    INSERT INTO orders VALUES(1,1);
    INSERT INTO orders VALUES(2,1)
    INSERT INTO orders VALUES(3,2)
    INSERT INTO orders VALUES(4,2)
    CREATE TABLE orderDetails(orderID INT,item VARCHAR(99))
    INSERT INTO orderDetails VALUES(1,'APPLE1')
    INSERT INTO orderDetails VALUES(1,'BANANA1')
    INSERT INTO orderDetails VALUES(2,'APPLE2')
    INSERT INTO orderDetails VALUES(2,'BANANA2')
    INSERT INTO orderDetails VALUES(3,'APPLE3')
    INSERT INTO orderDetails VALUES(3,'BANANA3')
    INSERT INTO orderDetails VALUES(4,'APPLE4')
    INSERT INTO orderDetails VALUES(4,'BANANA5')
    SELECT customer.customerID,customer.name,
    (SELECT orderId,
    SELECT item FROM orderDetails WHERE orderID=orders.orderID FOR XML AUTO,TYPE,ELEMENTS
    FROM orders Where customerID=customer.customerID FOR XML AUTO,TYPE,ELEMENTS)
    FROM customer WHERE customerID=1
    FOR XML AUTO,ELEMENTS
    DROP TABLE customer,orderDetails,orders
    If you have any feedback on our support, please click
    here.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for