Code example of the day: StandardPrint

It's been a few years since I posted StandardPrint, so I figured I post it again
You are welcome to use and modify this class, but please don't change the package or erase the attribution, especially if you are in school
package tjacobs.print;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.awt.print.*;
import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import tjacobs.ui.menus.FileMenu;
import tjacobs.ui.util.WindowUtilities;
* This implements the Printable and Pageable java.awt.print interfaces
* Allows you to very easily and quickly generate a printout from a component or a SpecialPrint.
* @author Tom Jacobs
public class StandardPrint implements Printable, Pageable {
     //standard print variables
     Component c;
    SpecialPrint sp;
    PageFormat mFormat;
     boolean mScale = false;
     boolean mMaintainRatio = true;
     //page number print
    public static final int LEFT = 0;
    public static final int RIGHT = 1;
    public static final int CENTER = 4;
    public static final int TOP = 2;
    public static final int BOTTOM = 3;
    private boolean mPrintPageNumber = false;
    private Font mPageNumberFont;
    private int hAlign = CENTER;
    private int vAlign = BOTTOM;
    //title vars     
    private String mTitle;
    private Font mTitleFont;
    public StandardPrint(Component c) {
        this.c = c;
        if (c instanceof SpecialPrint) {
            sp = (SpecialPrint)c;
    public StandardPrint(SpecialPrint sp) {
        this.sp = sp;
    public void setNumberFont(Font f) {
        mPageNumberFont = f;
    public Font getNumberFont () {
        return mPageNumberFont;
    public int getPageNumberHAlignment () {
        return hAlign;
    public int getPageNumberVAlignment() {
        return vAlign;
    public void setPageNumberHAlignment(int num) {
        hAlign = num;
    public void setPageNumberVAlignment(int num) {
        vAlign = num;
    public void setPrintPageNumber(boolean b) {
         mPrintPageNumber = b;
    public boolean getPrintPageNumber() {
         return mPrintPageNumber;
    protected void printPageNumber(Graphics g, PageFormat format, int pageNo) {
         if (!getPrintPageNumber()) return;
         Shape clip = g.getClip();
        g.setClip(null);
        if (mPageNumberFont != null) {
            g.setFont(mPageNumberFont);
        FontMetrics fm = g.getFontMetrics();
        int height = fm.getHeight();
        String pageStr = "" + (pageNo + 1);
        int width = fm.stringWidth(pageStr);
        int xspot = (int) (format.getWidth() - width) / 2;
        if (getPageNumberHAlignment() == LEFT) {
            xspot = (int) format.getImageableX();
        } else if (getPageNumberHAlignment() == RIGHT) {
            xspot = (int) (format.getWidth() - format.getImageableX() - format.getImageableWidth());
        int yspot = (int) (format.getImageableY() + format.getImageableHeight() + 2 * height);
        if (getPageNumberVAlignment() == TOP) {
            yspot = (int) format.getImageableY() / 2 - height;
            //yspot = (int) (format.getImageableY() + format.getImageableHeight() + 2 * height);
        g.drawString(pageStr, xspot, yspot);
        g.setClip(clip);
    public String getTitle() {
        return mTitle;
    public Font getTitleFont () {
        return mTitleFont;
    public void setTitleFont(Font f) {
        mTitleFont = f;
    public void setTitle(String s) {
        mTitle = s;
    protected void printTitle(Graphics g, PageFormat format) {
        if (mTitle == null) return;
         Shape clip = g.getClip();
        g.setClip(null);
        if (mTitleFont != null) {
            g.setFont(mTitleFont);
        FontMetrics fm = g.getFontMetrics();
        int height = fm.getHeight();
        int width = fm.stringWidth(mTitle);
        int xspot = (int) (format.getWidth() - width) / 2;
        int yspot = (int) format.getImageableY() / 2 + height;
        g.drawString(mTitle, xspot, yspot);
        g.setClip(clip);
     public boolean isPrintScaled () {
          return mScale;
     public void setPrintScaled(boolean b) {
          mScale = b;
     public boolean getMaintainsAspect() {
          return mMaintainRatio;
     public void setMaintainsAspect(boolean b) {
          mMaintainRatio = b;
    public void start() throws PrinterException {
        PrinterJob job = PrinterJob.getPrinterJob();
        if (mFormat == null) {
            mFormat = job.defaultPage();
        job.setPageable(this);
        if (job.printDialog()) {
            job.print();
    public void setPageFormat (PageFormat pf) {
        mFormat = pf;
    public static void printStandardComponent (Pageable p) throws PrinterException {
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPageable(p);
        job.print();
    private Dimension getJobSize() {
        if (sp != null) {
            return sp.getPrintSize();
        else {
            return c.getSize();
    public static Image preview (int width, int height, Printable sp, PageFormat pf, int pageNo) {
        BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        return preview (im, sp, pf, pageNo);
    public static Image preview (Image im, Printable sp, PageFormat pf, int pageNo) {
         return preview(im, sp, pf, pageNo, true);
    public static Image preview (Image im, Printable sp, PageFormat pf, int pageNo, boolean doClipping) {
        Graphics2D g = (Graphics2D) im.getGraphics();
        int width = im.getWidth(null);
        int height = im.getHeight(null);
        double hratio = height / pf.getHeight();
        double wratio = width / pf.getWidth();
        if (doClipping) {
             Rectangle rect = new Rectangle();
             rect.x = (int) (pf.getImageableX() * (wratio));
             rect.y = (int) (pf.getImageableY() * (hratio));
             rect.width = (int) (pf.getImageableWidth() * (wratio));
             rect.height = (int) (pf.getImageableHeight() * (hratio));
             g.setColor(Color.GRAY);
             g.fillRect(0, 0, width, height);
             g.setClip(rect);
        g.scale(wratio, hratio);
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, (int) (width * 1 / wratio), (int) (height * 1 / hratio));
        //g.fillRect(0, 0, (int) (width * wratio), (int) (height * hratio));
        try {
               sp.print(g, pf, pageNo);
          catch(PrinterException pe) {
               pe.printStackTrace();
        g.dispose();
        return im;
    public int print(Graphics gr, PageFormat format, int pageNo) {
        mFormat = format;
        if (pageNo > getNumberOfPages()) {
            return Printable.NO_SUCH_PAGE;
        Graphics2D g = (Graphics2D) gr;
          //wha?? don't know what this was doing in the code
        //g.drawRect(0, 0, (int)format.getWidth(), (int)format.getHeight());
        if (getTitle() != null) {
               printTitle(g, format);
          if (getPrintPageNumber()) {
               printPageNumber(g, format, pageNo);
        g.translate((int)format.getImageableX(), (int)format.getImageableY());
        //Dimension size = getJobSize();
          if (!isPrintScaled()) {
             int horizontal = getNumHorizontalPages();
             //don't need this I don't think
             //int vertical = getNumVerticalPages();
             int horizontalOffset = (int) ((pageNo % horizontal) * format.getImageableWidth());
             int verticalOffset = (int) ((pageNo / horizontal) * format.getImageableHeight());
             double ratio = getScreenRatio();
             g.scale(1 / ratio, 1 / ratio);
             g.translate(-horizontalOffset, -verticalOffset);
             if (sp != null) {
                 sp.printerPaint(g);
             else {
                 c.paint(g);
             g.translate(horizontalOffset, verticalOffset);
             g.scale(ratio, ratio);
          else {
             double ratio = getScreenRatio();
             g.scale(1 / ratio, 1 / ratio);
               double xScale = 1.0;
               double yScale = 1.0;
               double wid;
               double ht;
               if (sp != null) {
                    wid = sp.getPrintSize().width;
                    ht = sp.getPrintSize().height;
               else {
                    wid = c.getWidth();
                    ht = c.getHeight();
               xScale = format.getImageableWidth() / wid;
               yScale = format.getImageableHeight() / ht;
               if (getMaintainsAspect()) {
                    xScale = yScale = Math.min(xScale, yScale);
               g.scale(xScale, yScale);
               if (sp != null) {
                    sp.printerPaint(g);
               else {
                    c.paint(g);
               g.scale(1 / xScale, 1 / yScale);
               g.scale(ratio, ratio);
         g.translate((int)-format.getImageableX(), (int)-format.getImageableY());     
        return Printable.PAGE_EXISTS;
    public int getNumHorizontalPages() {
        Dimension size = getJobSize();
        if (mFormat == null) mFormat = getPageFormat(0);
        int imWidth = (int)mFormat.getImageableWidth();
        int pWidth = 1 + (int)(size.width / getScreenRatio() / imWidth) - (imWidth / getScreenRatio() == size.width ? 1 : 0);
        return pWidth;
    private double getScreenRatio () {
        double res = Toolkit.getDefaultToolkit().getScreenResolution();
        double ratio = res / 72.0;
        return ratio;
    public int getNumVerticalPages() {
        Dimension size = getJobSize();
        int imHeight = (int)mFormat.getImageableHeight();
        int pHeight = (int) (1 + (size.height / getScreenRatio() / imHeight)) - (imHeight == size.height ? 1 : 0);
        return pHeight;
    public int getNumberOfPages() {
          if (isPrintScaled()) return 1;
        return getNumHorizontalPages() * getNumVerticalPages();
    public Printable getPrintable(int i) {
        return this;
    public PageFormat getPageFormat(int page) {
        if (mFormat == null) {
            PrinterJob job = PrinterJob.getPrinterJob();
            mFormat = job.defaultPage();
        return mFormat;
    public static void main(String args[]) {
         //final GradientPane gp = new GradientPane(400,400);
         //JFrame jf = new JFrame("Standard Print Test");
         //jf.add(gp);
         JFrame jf = new JFrame("StandardPrint Test");
         final JTextArea area = new JTextArea();
         area.append("hello\n");
         for (int i = 0; i < 50; i++) {
              area.append("\n");
         area.append("world\n");
         JScrollPane sp = new JScrollPane(area);
         jf.add(sp);
         JMenuBar bar = new JMenuBar();
         FileMenu fm = new FileMenu() {
               private static final long serialVersionUID = 1L;
               public void load(File f) {}
              public void save(File f) {}
              public Pageable getPageable() {
                   //return new StandardPrint(gp);
                   return new StandardPrint(area);
         JMenu printMenu = new JMenu("Print");
         JMenuItem print = new JMenuItem("Print");
         printMenu.add(print);
         ActionListener al = new ActionListener() {
              public void actionPerformed(ActionEvent ae) {
                   StandardPrint sp = new StandardPrint(area);
                   sp.setTitle("Hello World");
                   sp.setPrintPageNumber(true);
                   sp.setPageNumberVAlignment(BOTTOM);
                   sp.setPageNumberHAlignment(CENTER);
                   System.out.println(sp.getNumberOfPages());
                   Image im1 = preview(300,300, sp, sp.getPageFormat(0), 0);
                   Image im2 = preview(300,300, sp, sp.getPageFormat(1), 1);
                   JLabel l = new JLabel(new ImageIcon(im1));
                   WindowUtilities.visualize(l, false);
                   l = new JLabel(new ImageIcon(im2));
                   WindowUtilities.visualize(l, false);
         print.addActionListener(al);
         jf.setJMenuBar(bar);
         bar.add(fm);
         bar.add(printMenu);
         jf.setBounds(100,100,400,400);
         jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         jf.setVisible(true);
     * Interface for using StandardPrint with something other than a Component or something
     * that needs special printing
    public static interface SpecialPrint {
        public Dimension getPrintSize();
        public void printerPaint(Graphics g);
}

And SpecialPrint
* Interface for using StandardPrint with something other than a Component or something
* that needs special printing
* @author tjacobs
public interface SpecialPrint {
public Dimension getPrintSize();
public void printerPaint(Graphics g);
}

Similar Messages

  • Code example of the day, want your advice

    Update: I have removed the setRunnable method and all the synchronization stuff, which takes care of question a. Now, on part B, can anyone suggest a better name for this class?
    I am posting my class ThreadForMultipleAnytimeRuns, plus my Eyes class which was actually the reason I created it.
    ThreadForMultipleAnytimeRuns offers the following:
    (a) you can run a runnable outside of the GUI thread - important in this case, because if you try to run an animation in the drawing thread you're not going to see anything
    (b) It will queue the blinks so they don't all happen at once.
    Questions:
    1. Is what I've done thread-safe? I added a method to swap the runnable into the class. I have it so that it waits until the job queue (semaphore) is empty before it swaps in the new runnable. Is this safe now? I would love to hear your thoughts
    2. I am unsatisfied with the name of this class. Can anyone think of a better name?
    BTW, unfortunately this code isn't compilable as posted. To get it to compile, you need to remove the references to MathUtils - all this takes is replacing distance with the euclidean distance formula, and angle with java.lang.Math.atan2, and references to WindowUtilities, which means replacing WindowUtilities.visualize and just building a JFrame and sticking the eyes in it
    Thanks for any comments about how I could make this better!
    You are welcome to use and modify this code, but please don't change the package or take credit for it as your own code.
    package tjacobs.thread;
    import java.awt.Dimension;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.util.concurrent.Semaphore;
    import javax.swing.JFrame;
    import tjacobs.ui.Eyes;
    import tjacobs.ui.WindowUtilities;
    public class ThreadForMultipleAnytimeRuns extends Thread {
         private Runnable mRunnable;
         private Semaphore mSemaphore;
         public ThreadForMultipleAnytimeRuns(Runnable arg0) {
              super();
              init(arg0);
         private void init(Runnable r) {
              mRunnable = r;
              mSemaphore = new Semaphore(0);
              setDaemon(true);
         public ThreadForMultipleAnytimeRuns(Runnable arg0, String arg1) {
              super(arg1);
              init(arg0);
         public ThreadForMultipleAnytimeRuns(ThreadGroup arg0, Runnable arg1, String arg2) {
              super(arg0, arg2);
              init(arg1);
         public void run () {
              try {
                   while (!isInterrupted()) {
                        // make a local copy so if mRunnable changes
                        // we have the fresh one
                        mSemaphore.acquire();
                        if (getSemaphoreCount() == 0) {
                             Runnable r = mRunnable;
                             synchronized (this) {
                                  notifyAll();
                             r.run();
                        mRunnable.run();
              catch (InterruptedException ex) {}
         public void runAgain() {
              mSemaphore.release();
         public void runAgain(int numTimes) {
              mSemaphore.release(numTimes);
         public void stopThread() {
              interrupt();
         public int getSemaphoreCount() {
              return mSemaphore.availablePermits();
         public Runnable getRunnable() {
              return mRunnable;
         public synchronized void setRunnable(Runnable r) {
              if (getSemaphoreCount() > 0) {
                   try {
                        wait();
                   catch (InterruptedException ex) {
                        return;
              mRunnable = r;
         public static void main(String[] args) {
              final Eyes eyes = new Eyes(true);
              //eyes.addMouseMotionListener(eyes);
              Runnable r = new Runnable() {
                   public void run() {
                        eyes.blink();
                        try {
                             Thread.sleep(100);
                        catch(InterruptedException ex) {}
              final ThreadForMultipleAnytimeRuns ar = new ThreadForMultipleAnytimeRuns(r);
              ar.start();
              eyes.addMouseListener(new MouseAdapter() {
                   public void mouseClicked(MouseEvent me) {
                        ar.runAgain();
              eyes.setPreferredSize(new Dimension(60,20));
              WindowUtilities.visualize(eyes);
    //          JFrame jf = new JFrame();
    //          jf.add(eyes);
    //          jf.pack();
    //          jf.setLocation(100,100);
    //          jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //          jf.setVisible(true);
    ================================================
    tjacobs.ui.Eyes
    ============
    package tjacobs.ui;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.util.Timer;
    import java.util.TimerTask;
    import javax.swing.JComponent;
    import javax.swing.SwingUtilities;
    import tjacobs.MathUtils;
    public class Eyes extends JComponent implements MouseMotionListener {
         private int mEyeGap = 0;
         private double mEyeDir1 = Double.NaN, mEyeDir2 = Double.NaN;
         private double mEyeRatio = .6;
         private int mBlinkEyesState = 0;
         private Timer mEyeBlinker;
         private long mTimeBetweenBlinks;
         private long mBlinkAnimationSpeed = 100;
         public Eyes() {
              //setBackground(Color.BLACK);
              this(false);
         public Eyes(boolean watchOnEyes) {
              setBackground(Color.PINK);
              setForeground(Color.BLUE);
              if (watchOnEyes) addMouseMotionListener(this);          
         public void setBatAnimationSpeed(long speed) {
              mBlinkAnimationSpeed = speed;
         public long getBatAnimationSpeed() {
              return mBlinkAnimationSpeed;
         public void mouseMoved(MouseEvent me) {
              Point p = SwingUtilities.convertPoint(me.getComponent(), me.getPoint(), this);
              int height = getHeight();
              mEyeDir1 = MathUtils.angle(height / 2, height / 2, p.x, p.y);
              mEyeDir2 = MathUtils.angle((3 * height) / 2 + mEyeGap, height / 2, p.x, p.y);
              repaint();
         public void mouseDragged(MouseEvent me) {
              mouseMoved(me);
         public int getEyeGap() {
              return mEyeGap;
         public void setEyeGap(int gap) {
              mEyeGap = gap;
         public void setBlinkEyes(long timeBetweenBlinks) {
              mTimeBetweenBlinks = timeBetweenBlinks;
              if (mEyeBlinker != null) {
                   mEyeBlinker.cancel();
                   mEyeBlinker = null;
              if (timeBetweenBlinks < mBlinkAnimationSpeed * 8) {
                   return;
              else {
                   mEyeBlinker = new Timer(true); //allow it to be a daemon thread
                   mEyeBlinker.scheduleAtFixedRate(new BlinkEyesTask(), mTimeBetweenBlinks, mTimeBetweenBlinks);
                   //Thread t = new Thread(mEyeBlinkter);
                   //t.start();
          * makes the eyes blink
          * this method will not function correctly if it is run in the
          * GUI painter thread, as it handles the whole process and calls
          * repaint() sleep() in between steps.
         public void blink() {
              try {
                   //System.out.println("bat");
                   Thread t = Thread.currentThread();
                   mBlinkEyesState = 1;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 2;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 3;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 4;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 3;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 2;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 1;
                   repaint();
                   t.sleep(mBlinkAnimationSpeed);
                   mBlinkEyesState = 0;
                   repaint();
              catch (InterruptedException ex) {
                   if (mBlinkEyesState != 0) {
                        mBlinkEyesState = 0;
                        repaint();
         private class BlinkEyesTask extends TimerTask {
              public void run() {
                   blink();
          * @param angle Either Double.NaN for center, or a value between 0 and 2 PI
         public void setEye1Direction(double angle) {
              mEyeDir1 = angle;
         public double getEye1Direction() {
              return mEyeDir1;
          * @param angle Either Double.NaN for center, or a value between 0 and 2 PI
         public void setEye2Direction(double angle) {
              mEyeDir1 = angle;
         public double getEye2Direction() {
              return mEyeDir2;
         public void paintComponent(Graphics g) {
              int height = getHeight();
              int r = height / 2;
              g.setColor(Color.WHITE);
              g.fillOval(0, 0, height, height);
              g.fillOval(height + mEyeGap + 0, 0, height, height);
              g.setColor(Color.BLACK);
              g.drawOval(0, 0, height, height);
              g.drawOval(height + mEyeGap + 0, 0, height, height);
              g.setColor(getForeground());
              int irisR = (int) (r * mEyeRatio);
              if (Double.isNaN(mEyeDir1)) {
                   int x1 = (r - irisR);
                   int y1 = x1;
                   g.fillOval(x1, y1, irisR * 2, irisR * 2);
              } else {
                   int x1 = (r - irisR);
                   int y1 = x1;
                   x1 -= Math.cos(mEyeDir1) * (r - irisR);
                   y1 -= Math.sin(mEyeDir1) * (r - irisR);
                   g.fillOval(x1, y1, irisR * 2, irisR * 2);
              if (Double.isNaN(mEyeDir2)) {
                   int x1 = (r - irisR) + height + mEyeGap;
                   int y1 = (r - irisR);
                   g.fillOval(x1, y1, irisR * 2 , irisR * 2);               
              } else {
                   int x1 = (r - irisR) + height + mEyeGap;
                   int y1 = r - irisR;
                   x1 -= Math.cos(mEyeDir2) * (r - irisR);
                   y1 -= Math.sin(mEyeDir2) * (r - irisR);
                   g.fillOval(x1, y1, irisR * 2, irisR * 2);
    //          OLD
    //          if (Double.isNaN(mEyeDir1)) {
    //               int x1 = (r - irisR);
    //               int y1 = x1;
    //               g.fillOval(x1, y1, irisR * 2, irisR * 2);
    //               x1 += height + mEyeGap;
    //               g.fillOval(x1, y1, irisR * 2 , irisR * 2);               
    //          } else {
    //               int x1 = (r - irisR);
    //               int y1 = x1;
    //               x1 -= Math.cos(mEyeDir1) * (r - irisR);
    //               y1 -= Math.sin(mEyeDir1) * (r - irisR);
    //               g.fillOval(x1, y1, irisR * 2, irisR * 2);
    //               x1 = (r - irisR) + height + mEyeGap;
    //               y1 = r - irisR;
    //               x1 -= Math.cos(mEyeDir2) * (r - irisR);
    //               y1 -= Math.sin(mEyeDir2) * (r - irisR);
    //               g.fillOval(x1, y1, irisR * 2, irisR * 2);
              //Eye Blinking
              if (mBlinkEyesState != 0) {
                   Rectangle rect = new Rectangle(0,0,getWidth(), getHeight() * mBlinkEyesState / 4);
                   g.setClip(rect);
                   g.setColor(getBackground());
                   g.fillOval(0, 0, height, height);
                   g.fillOval(height + mEyeGap + 0, 0, height, height);
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Eyes eyes = new Eyes(true);
              eyes.setBlinkEyes(10000);
              eyes.setPreferredSize(new Dimension(60,25));
              eyes.setEyeGap(5);
              WindowUtilities.visualize(eyes);
    }Message was edited by:
    tjacobs01

    So, if you shake the panel long enough, do the
    contents disappear? :Dno but they get a big headache

  • Code example of the day: ProgressBarForStream.java

    ----ps you can make this even sweeter if you grab my ColorGradient class (http://www.java-index.com/java-technologies-archive/519/cryptography-5196334.shtm) and plug that into the paintComponent method.
    This is a generic way to visualize the progress of the reading from a stream.
    You will need the InfoFetcher
    http://forum.java.sun.com/thread.jspa?threadID=5280590&messageID=10178338
    FetcherListener should be there, but if it's not the two methods that start with fetched in ProgressBarForStream (and which are also common in InfoFetcher) should let you reproduce it. There are also references to WindowUtilities and IOUtils... You can probably find those too searching the web, but otherwise it shouldn't be to hard to modify the code to just instantiate InfoFetcher with a stream directly, and windowUtilities.visualize(..) is just a helper method... create a jframe container and you're good to go
    BTW... If you actually want to USE the data that ProgressBarForStream is loading, add another FetcherListener to the bar's InfoFetcher
    You are welcome to use + modify all of this code (ProgressBarForStream + the other classses like InfoFetcher that I reference) but please don't change the package or take credit for it as your own work (except where you have made changes)
    ProgressBarForStream
    =================
    package tjacobs.ui.ex;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PipedInputStream;
    import java.io.PipedOutputStream;
    import java.io.PrintStream;
    import java.net.URL;
    import javax.swing.BoundedRangeModel;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import tjacobs.io.FetcherListener;
    import tjacobs.io.IOUtils;
    import tjacobs.io.InfoFetcher;
    import tjacobs.ui.util.WindowUtilities;
    public class ProgressBarForStream extends JProgressBar implements Runnable, FetcherListener{
         boolean bounded = false, increasing = true;
         private static final int MIN = 0;
         private static final int UNBOUNDED_MAX = 10;
         private InfoFetcher fetcher;
         public ProgressBarForStream() {
              super();
         public ProgressBarForStream(InputStream in, int max) {
              super(0, max);
              bounded = true;
              init(in);
         public ProgressBarForStream(InputStream in) {
              super(0, UNBOUNDED_MAX);
              bounded = false;
              init(in);
              // TODO Auto-generated constructor stub
         public void setStream(InputStream in, int max) {
              if (fetcher != null) {
                   try {
                        fetcher.in.close();
                   catch (IOException iox) {
                        iox.printStackTrace();
              super.setMaximum(max);
              bounded = true;
              init(in);
         public void setStream(InputStream in) {
              if (fetcher != null) {
                   try {
                        fetcher.in.close();
                   catch (IOException iox) {
                        iox.printStackTrace();
              bounded = false;
              setMaximum(UNBOUNDED_MAX);
              init(in);          
         private void init(InputStream in) {
              fetcher = IOUtils.loadData(in);
              fetcher.addFetcherListener(this);
         public void fetchedMore(byte[] buf, int start, int end) {
              if (bounded) {
                   super.setValue(end);
              else {
                   if ((increasing && getValue() == getMaximum()) || (!increasing && getValue() == getMinimum())) {
                        increasing = !increasing;
                   setValue(getValue() + (increasing ? 1 : -1));
              repaint();
         public void fetchedAll(byte[] buf) {
              setValue(super.getMaximum());
         private InfoFetcher getInfoFetcher() {
              return fetcher;
         public void run() {
              fetcher.run();
          * @param args
         public static void main(String[] args) {
              JPanel p = new JPanel();
              final ProgressBarForStream bar = new ProgressBarForStream();
              p.setLayout(new BorderLayout());
              final JButton b = new JButton("Select File");
              final JButton b2 = new JButton("Select URL");
              final JButton b3 = new JButton("Test");
              JPanel jp = new JPanel();
              jp.add(b2);
              jp.add(b3);
              p.add(b, BorderLayout.WEST);
              p.add(bar, BorderLayout.CENTER);
              p.add(jp, BorderLayout.EAST);
              ActionListener al = new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        if (ae.getSource() == b) {
                             JFileChooser jf = new JFileChooser();
                             int approve = jf.showOpenDialog(b);
                             if (approve != jf.CANCEL_OPTION) {
                                  File f = jf.getSelectedFile();
                                  try {
                                       bar.setStream(new FileInputStream(f), (int) f.length());
                                       Thread t = new Thread(bar);
                                       t.start();
                                  catch (IOException iox) {
                                       iox.printStackTrace();
                        else if (ae.getSource() == b2) {
                             String urlstr = JOptionPane.showInputDialog("URL");
                             if (urlstr != null) {
                                  try {
                                       URL url = new URL(urlstr);
                                       InputStream stream = url.openStream();
                                       bar.setStream(stream);
                                       Thread t = new Thread(bar);
                                       t.start();
                                  catch (Exception ex) {
                                       ex.printStackTrace();
                        else {
                             try {
                                  final PipedOutputStream pos = new PipedOutputStream();
                                  final PipedInputStream pin = new PipedInputStream(pos);
                                  final PrintStream ps = new PrintStream(pos,true);
                                  bar.setStream(pin);
                                  Thread t = new Thread(bar);
                                  t.start();
                                  Thread thr = new Thread() {
                                       public void run() {
                                            try {
                                                 for (int i = 0; i < 6; i++) {
                                                      for (char c = 'a'; c <= 'z'; c++) {
                                                           Thread.sleep(100);
                                                           ps.println(c);
                                                           ps.flush();
                                                 pos.close();
                                            catch (Exception iox) {
                                                 iox.printStackTrace();
                                  thr.start();
                             catch (IOException iox) {
                                  iox.printStackTrace();
              b.addActionListener(al);
              b2.addActionListener(al);
              b3.addActionListener(al);
              WindowUtilities.visualize(p);
    }Edited by: tjacobs01 on Apr 26, 2008 12:01 PM

    So, if you shake the panel long enough, do the
    contents disappear? :Dno but they get a big headache

  • A code example

    Hi,
    I'm quite new at Java (and at programming on the whole). Can someone explain this to me (saw it in an code example on the internet):
    final private char PI_NAME = 0xFF01;
    /M

    Hi,
    a char is a variable that is supposed to contain a
    character. However, not all characters exist on the
    keyboard, so you define them using their hex value.
    final private char PI_NAME = 0xFF01;final = no one can change it
    private = no one can see it
    char = see above
    PI_NAME = the name of the variable
    0xFF01 = the value of the variable in hexadecimal
    Generally, in Java you can define any number using
    octal, decimal or hexadecimal numbers
    Octals (based on the number 8, which means it has
    digits from 0 to 7) ALWAYS start with a leading 0,
    decimals are entered as you know them (for example
    17) and hexadecimal numbers are entered with a
    leading 0x.
    So in this case 0x means "hexadecimal number ahead",
    FF01 is its value.
    To know its value in decimal, do the following:
    1 x 1 (value of last digit)
    0 x 16 (value of second from last)
    15 x 16 x 16 (F in hex represents the decimal 15)
    15 x 16 x 16
    All in all, this results in the decimal number
    65281.

  • How to find the Day on a Week for any given Date

    Hi..... I need your help to find out the Day on a Week for any given Date .
    Say if the Date is 31/12/2009 , what would be the Day on a Week for this Date.
    Are there any fucntions available to determine the same?
    Please let me know....Thanks in Advance
    Regards
    Smita

    Hi ,
    You can using the following peice of code to get the Day of a Week for the given date :
    Calendar now = Calendar.getInstance();   
    System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1)  
         + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR));
    //create an array of days  
    //Day_OF_WEEK starts from 1 while array index starts from 0        
    String[] strDays = new String[]{"Sunday",  "Monday", "Tuesday", "Wednesday",  "Thusday",   "Friday",  "Saturday" };   
    String day_of_week = strDays[now.get(Calendar.DAY_OF_WEEK) - 1];     
    System.out.println("Current day is : " + strDays[now.get(Calendar.DAY_OF_WEEK) - 1]  );
    Edited by: Ritushree Saha on Jun 4, 2009 1:09 PM

  • Useful Code of the Day:  Splash Screen & Busy Application

    So you are making an Swing application. So what are two common things to do in it?
    1) Display a splash screen.
    2) Block user input when busy.
    Enter AppFrame! It's a JFrame subclass which has a glass pane overlay option to block input (setBusy()). While "busy", it displays the system wait cursor.
    It also supports display of a splash screen. There's a default splash screen if you don't provide a component to be the splash screen, and an initializer runner which takes a Runnable object. The Runnable object can then modify the splash screen component, for example to update a progress bar or text. See the main method for example usage.
    It also has a method to center a component on another component (useful for dialogs) or center the component on the screen.
    NOTE on setBusy: I do recall issues with the setBusy option to block input. I recall it having a problem on some Unix systems, but I can't remember the details offhand (sorry).
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    * <CODE>AppFrame</CODE> is a <CODE>javax.swing.JFrame</CODE> subclass that
    * provides some convenient methods for applications.  This class implements
    * all the same constructors as <CODE>JFrame</CODE>, plus a few others. 
    * Methods exist to show the frame centered on the screen, display a splash
    * screen, run an initializer thread and set the frame as "busy" to block 
    * user input. 
    public class AppFrame extends JFrame implements KeyListener, MouseListener {
          * The splash screen window. 
         private JWindow splash = null;
          * The busy state of the frame. 
         private boolean busy = false;
          * The glass pane used when busy. 
         private Component glassPane = null;
          * The original glass pane, which is reset when not busy. 
         private Component defaultGlassPane = null;
          * Creates a new <CODE>AppFrame</CODE>. 
         public AppFrame() {
              super();
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified
          * <CODE>GraphicsConfiguration</CODE>. 
          * @param  gc  the GraphicsConfiguration of a screen device
         public AppFrame(GraphicsConfiguration gc) {
              super(gc);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title. 
          * @param  title  the title
         public AppFrame(String title) {
              super(title);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title and
          * <CODE>GraphicsConfiguration</CODE>. 
          * @param  title  the title
          * @param  gc     the GraphicsConfiguration of a screen device
         public AppFrame(String title, GraphicsConfiguration gc) {
              super(title, gc);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title and
          * icon image. 
          * @param  title  the title
          * @param  icon   the image icon
         public AppFrame(String title, Image icon) {
              super(title);
              setIconImage(icon);
              init();
          * Creates a new <CODE>AppFrame</CODE> with the specified title and
          * icon image. 
          * @param  title  the title
          * @param  icon  the image icon
         public AppFrame(String title, ImageIcon icon) {
              this(title, icon.getImage());
          * Initializes internal frame settings. 
         protected void init() {
              // set default close operation (which will likely be changed later)
              setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              // set up the glass pane
              glassPane = new JPanel();
              ((JPanel)glassPane).setOpaque(false);
              glassPane.addKeyListener(this);
              glassPane.addMouseListener(this);
          * Displays a new <CODE>JWindow</CODE> as a splash screen using the
          * specified component as the content.  The default size of the
          * component will be used to size the splash screen.  See the
          * <CODE>showSplash(Component, int, int)</CODE> method description for
          * more details. 
          * @param  c  the splash screen contents
          * @return  the window object
          * @see  #showSplash(Component, int, int)
          * @see  #hideSplash()
         public JWindow showSplash(Component c) {
              return showSplash(c, -1, -1);
          * Displays a new <CODE>JWindow</CODE> as a splash screen using the
          * specified component as the content.  The component should have all
          * the content it needs to display, like borders, images, text, etc. 
          * The splash screen is centered on monitor.  If width and height are
          * <CODE><= 0</CODE>, the default size of the component will be used
          * to size the splash screen. 
          * <P>
          * The window object is returned to allow the application to manipulate
          * it, (such as move it or resize it, etc.).  However, <B>do not</B>
          * dispose the window directly.  Instead, use <CODE>hideSplash()</CODE>
          * to allow internal cleanup. 
          * <P>
          * If the component is <CODE>null</CODE>, a default component with the
          * frame title and icon will be created. 
          * <P>
          * The splash screen window will be passed the same
          * <CODE>GraphicsConfiguration</CODE> as this frame uses. 
          * @param  c  the splash screen contents
          * @param  w  the splash screen width
          * @param  h  the splash screen height
          * @return  the window object
          * @see  #showSplash(Component)
          * @see  #hideSplash()
         public JWindow showSplash(Component c, int w, int h) {
              // if a splash window was already created...
              if(splash != null) {
                   // if it's showing, leave it; else null it
                   if(splash.isShowing()) {
                        return splash;
                   } else {
                        splash = null;
              // if the component is null, then create a generic splash screen
              // based on the frame title and icon
              if(c == null) {
                   JPanel p = new JPanel();
                   p.setBorder(BorderFactory.createCompoundBorder(
                        BorderFactory.createRaisedBevelBorder(),
                        BorderFactory.createEmptyBorder(10, 10, 10, 10)
                   JLabel l = new JLabel("Loading application...");
                   if(getTitle() != null) {
                        l.setText("Loading " + getTitle() + "...");
                   if(getIconImage() != null) {
                        l.setIcon(new ImageIcon(getIconImage()));
                   p.add(l);
                   c = p;
              splash = new JWindow(this, getGraphicsConfiguration());
              splash.getContentPane().add(c);
              splash.pack();
              // set the splash screen size
              if(w > 0 && h > 0) {
                   splash.setSize(w, h);
              } else {
                   splash.setSize(c.getPreferredSize().width, c.getPreferredSize().height);
              centerComponent(splash);
              splash.show();
              return splash;
          * Disposes the splash window. 
          * @see  #showSplash(Component, int, int)
          * @see  #showSplash(Component)
         public void hideSplash() {
              if(splash != null) {
                   splash.dispose();
                   splash = null;
          * Runs an initializer <CODE>Runnable</CODE> object in a new thread. 
          * The initializer object should handle application initialization
          * steps.  A typical use would be:
          * <OL>
          *   <LI>Create the frame.
          *   <LI>Create the splash screen component.
          *   <LI>Call <CODE>showSplash()</CODE> to display splash screen.
          *   <LI>Run the initializer, in which: 
          *   <UL>
          *     <LI>Build the UI contents of the frame.
          *     <LI>Perform other initialization (load settings, data, etc.).
          *     <LI>Pack and show the frame.
          *     <LI>Call <CODE>hideSplash()</CODE>.
          *   </UL>
          * </OL>
          * <P>
          * <B>NOTE:</B>  Since this will be done in a new thread that is
          * external to the event thread, any updates to the splash screen that
          * might be done should be triggered through with
          * <CODE>SwingUtilities.invokeAndWait(Runnable)</CODE>. 
          * @param  r  the <CODE>Runnable</CODE> initializer
         public void runInitializer(Runnable r) {
              Thread t = new Thread(r);
              t.start();
          * Shows the frame centered on the screen. 
         public void showCentered() {
              centerComponent(this);
              this.show();
          * Checks the busy state.
          * @return  <CODE>true</CODE> if the frame is disabled;
          *          <CODE>false</CODE> if the frame is enabled
          * @see  #setBusy(boolean)
         public boolean isBusy() {
              return this.busy;
          * Sets the busy state.  When busy, the glasspane is shown which will
          * consume all mouse and keyboard events, and a wait cursor is
          * set for the frame. 
          * @param  busy  if <CODE>true</CODE>, disables frame;
          *               if <CODE>false</CODE>, enables frame
          * @see  #getBusy()
         public void setBusy(boolean busy) {
              // only set if changing
              if(this.busy != busy) {
                   this.busy = busy;
                   // If busy, keep current glass pane to put back when not
                   // busy.  This is done in case the application is using
                   // it's own glass pane for something special. 
                   if(busy) {
                        defaultGlassPane = getGlassPane();
                        setGlassPane(glassPane);
                   } else {
                        setGlassPane(defaultGlassPane);
                        defaultGlassPane = null;
                   glassPane.setVisible(busy);
                   glassPane.setCursor(busy ?
                        Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) :
                        Cursor.getDefaultCursor()
                   setCursor(glassPane.getCursor());
          * Handle key typed events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  ke  the key event
         public void keyTyped(KeyEvent ke) {
              ke.consume();
          * Handle key released events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  ke  the key event
         public void keyReleased(KeyEvent ke) {
              ke.consume();
          * Handle key pressed events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  ke  the key event
         public void keyPressed(KeyEvent ke) {
              ke.consume();
          * Handle mouse clicked events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseClicked(MouseEvent me) {
              me.consume();
          * Handle mouse entered events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseEntered(MouseEvent me) {
              me.consume();
          * Handle mouse exited events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseExited(MouseEvent me) {
              me.consume();
          * Handle mouse pressed events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mousePressed(MouseEvent me) {
              me.consume();
          * Handle mouse released events.  Consumes the event for the glasspane
          * when the frame is busy. 
          * @param  me  the mouse event
         public void mouseReleased(MouseEvent me) {
              me.consume();
          * Centers the component <CODE>c</CODE> on the screen. 
          * @param  c  the component to center
          * @see  #centerComponent(Component, Component)
         public static void centerComponent(Component c) {
              centerComponent(c, null);
          * Centers the component <CODE>c</CODE> on component <CODE>p</CODE>. 
          * If <CODE>p</CODE> is null, the component <CODE>c</CODE> will be
          * centered on the screen. 
          * @param  c  the component to center
          * @param  p  the parent component to center on or null for screen
          * @see  #centerComponent(Component)
         public static void centerComponent(Component c, Component p) {
              if(c != null) {
                   Dimension d = (p != null ? p.getSize() :
                        Toolkit.getDefaultToolkit().getScreenSize()
                   c.setLocation(
                        Math.max(0, (d.getSize().width/2)  - (c.getSize().width/2)),
                        Math.max(0, (d.getSize().height/2) - (c.getSize().height/2))
          * Main method.  Used for testing.
          * @param  args  the arguments
         public static void main(String[] args) {
              final AppFrame f = new AppFrame("Test Application",
                   new ImageIcon("center.gif"));
              f.showSplash(null);
              f.runInitializer(new Runnable() {
                   public void run() {
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        f.getContentPane().add(new JButton("this is a frame"));
                        f.pack();
                        f.setSize(300, 400);
                        try {
                             Thread.currentThread().sleep(3000);
                        } catch(Exception e) {}
                        f.showCentered();
                        f.setBusy(true);
                        try {
                             Thread.currentThread().sleep(100);
                        } catch(Exception e) {}
                        f.hideSplash();
                        try {
                             Thread.currentThread().sleep(3000);
                        } catch(Exception e) {}
                        f.setBusy(false);
    "Useful Code of the Day" is supplied by the person who posted this message. This code is not guaranteed by any warranty whatsoever. The code is free to use and modify as you see fit. The code was tested and worked for the author. If anyone else has some useful code, feel free to post it under this heading.

    Hi
    Thanks fo this piece of code. This one really help me
    Deepa

  • Beginner Question | The use of modulus in this simple code example.

    Hello everyone,
    I am just beginning to learn Java and have started reading "Java Programming for the absolute beginner". It is quite a old book but seems to be doing the trick, mainly.
    There is a code example which I follow mostly but the use of the modulus operator in the switch condition doesn't make sense to me, why is it used? Could someone shed some light on this for me?
    import java.util.Random;
    public class FortuneTeller {
      public static void main(String args[]) {
        Random randini = new Random();
        int fortuneIndex;
        String day;
        String[] fortunes = { "The world is going to end :-(.",
          "You will have a HORRIBLE day!",
          "You will stub your toe.",
          "You will find a shiny new nickel.",
          "You will talk to someone who has bad breath.",
          "You will get a hug from someone you love.",
          "You will remember that day for the rest of your life!",
          "You will get an unexpected phone call.",
          "Nothing significant will happen.",
          "You will bump into someone you haven't seen in a while.",
          "You will be publicly humiliated.",
          "You will find forty dollars.",
          "The stars will appear in the sky.",
          "The proper authorities will discover your secret.",
          "You will be mistaken for a god by a small country.",
          "You will win the lottery!",
          "You will change your name to \"Bob\" and move to Alaska.",
          "You will discover first hand that Bigfoot is real.",
          "You will succeed at everything you do.",
          "You will learn something new.",
          "Your friends will treat you to lunch.",
          "You will meet someone famous.",
          "You will be very bored.",
          "You will hear your new favorite song.",
          "Tomorrow... is too difficult to predict" };
        System.out.println("\nYou have awakened the Great Randini...");
        fortuneIndex = randini.nextInt(fortunes.length);
        switch (randini.nextInt(7) % 7) {   
          case 0:
            day = "Sunday";
            break;
          case 1:
            day = "Monday";
            break;
          case 2:
            day = "Tuesday";
            break;
          case 3:
            day = "Wednesday";
            break;
          case 4:
            day = "Thursday";
            break;
          case 5:
            day = "Friday";
            break;
          case 6:
            day = "Saturday";
            break;
          default:
            day = "Tomorrow";
        System.out.println("I, the Great Randini, know all!");
        System.out.println("I see that on " + day);
        System.out.println("\n" + fortunes[fortuneIndex]);
        System.out.println("\nNow, I must sleep...");
    }

    randini.nextInt(7) % 7randini.nextInt(7) returns a value in the range 0 <= x < 7, right? (Check the API!) And:
    0 % 7 == 0
    1 % 7 == 1
    2 % 7 == 2
    3 % 7 == 3
    4 % 7 == 4
    5 % 7 == 5
    6 % 7 == 6Looks like superfluous code to me. Maybe originally they wrote:
    randini.nextInt() % 7Note this code has problems, because, for example -1 % 7 == -1

  • When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet. Example- MIME-Version: 1.0 X-Document-Type: Workbook Content-Type: multipart/related; boundary="====Boundary===="

    I have a Macbook Air. I have MS office installed and work in Excel often with no issues. But When I download an excel spread sheet from a Ford web site I seem to be getting code and not the work sheet.
    Example-
    MIME-Version: 1.0
    X-Document-Type: Workbook
    Content-Type: multipart/related; boundary="====Boundary===="
    --====Boundary====
    Content-Location: file:///C:/HOLD.XHT
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="utf-8"
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
    <HEAD>
    <meta name="Excel Workbook Frameset">
    <xml>
    <x:ExcelWorkbook>
      <x:ExcelWorksheets>
       <x:ExcelWorksheet>
        <x:Name>BTB</x:Name>
        <x:WorksheetSource HRef="./IBIT0001.xht"/>
       </x:ExcelWorksheet>
       <x:ExcelWorksheet>
        <x:Name>GSM</x:Name>
        <x:WorksheetSource HRef="./IBIT0002.xht"/>
       </x:ExcelWorksheet>
       <x:ExcelWorksheet>
        <x:Name>RODetail</x:Name>
        <x:WorksheetSource HRef="./IBIT0003.xht"/>
       </x:ExcelWorksheet>
      </x:ExcelWorksheets>
    </x:ExcelWorkbook>
    </xml>
    </HEAD>
    </HTML>
    --====Boundary====
    Content-Location: file:///C:/IBIT0001.xht
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="utf-8"
    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">
    <HEAD>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <style>
    <!--table
            {mso-displayed-decimal-separator:"\.";
            mso-displayed-thousand-separator:"\,";}
    @page
            {margin:1.0in .75in 1.0in .75in;
            mso-header-margin:.5in;
            mso-footer-margin:.5in;
            mso-page-orientation:landscape;}
    tr
            {mso-height-source:auto;}
    col
            {mso-width-source:auto;}
    br
            {mso-data-placement:same-cell;}
    .style21
            {color:blue;
            font-size:10.0pt;
            font-weight:400;
            font-style:normal;
            text-decoration:underline;
            text-underline-style:single;
            font-family:Arial;

    Try search/ask in the forum devoted entirely to Excel issues:
    http://answers.microsoft.com/en-us/mac/forum/macexcel

  • Is there a LabView example in the use of user defined error codes?

    Specifically, I have a VI that tests four arrays of data against various high/low limits. I have pass/fail outputs for 18 tests. I'd like to combine these into an 'error out' cluster with appropriate error codes and messages, for which I've created an x-errors.txt file.
    My first question must be trival - how do I just set the 'status' bit of the error stream to let the general error handler then look up the error desription from the file?
    Secondly - I can't find an example of this in the technical resourses, amI missing something?
    Thanks,
    Mike
    Mike Evans
    TRW Conekt
    N.I. Alliance Member, UK
    http://www.Conekt.net

    There is no example program. There is extensive help on how to do this. Here's the basics.
    1) There are two ways to define user error codes in LV6.1. If you are using LV6.0 or earlier, only one method is possible.
    2) The 6.0 method involves wiring arrays of error codes and arrays of error code strings to the General Error Handler.vi. These codes will be used to explain any error code which is undefined in LV's internal error code database. Error codes reserved for users which are guaranteed not to be used by NI are from 5000 to 9999.
    3) The 6.1 method allows you to create a specially formatted error code file on disk that will be merged with the LV error code database each time LabVIEW launches. For help on this, go to LV's online help, and in t
    he Index tab, type
    "user-defined error codes, in text files"
    (without the quote marks)
    4) If you want to set an error into the error cluster, use the General Error Handler.vi again. Wire your error code value to the Error Code terminal (the leftmost-topmost corner terminal). Wire the name of your VI to the Error Source terminal, and wire "No Dialog" to the Type of Dialog terminal (left-side, near the bottom). The error code cluster that comes out of this VI will either be the error in (if one was set) or a new error code cluster with your error and the status bit set to TRUE.
    5) The attached demo is written in LV6.0.
    Attachments:
    Error_Demo.vi ‏37 KB

  • Useful Code of the Day:  Multipart Form File Upload

    So, you want to upload files to your web server, do ya? Well, I've seen this topic posted a few times in the last month or so and many of the response I've seen here haven't included definitive answers. Of course, the actual problems vary, but ultimately, a bunch of people want to do file upload from an applet or application to an existing file upload script (CGI, PHP, JSP, etc.) on a web server. And invariably, there are problems with formatting the HTTP request to get things working.
    Well, I had a need to do the same thing. I realize there are other solutions out there, such as some sample code that comes with Jakarta Commons Upload. But since we all like reusable code, and we also all seem to like reinventing wheels, here's my go at it: MultiPartFormOutputStream!
    MultiPartFormOutputStream is a specialized OutputStream-like class. You create your URLConnection to the server (a static method included can do this for a URL for you, as some of the settings, doInput and doOutput specifically, seem to confuse people). Then get the OutputStream from it and create a boundary string (a static method to create one is provided as well) and pass them to the constructor. Now you have a MultiPartFormOutputStream which you can use to write form fields like text fields, checkboxes, etc., as well as write file data (from Files, InputStreams or raw bytes).
    There are some convenience methods for writing primative type values as well as strings, but any higher level objects (aside from Files or InputStreams) aren't supported. (You can always serialize and pass the raw bytes.)
    Sample usage code is below. Also, any recommendations for improvement are requested. The code was tested with the Jakarta Struts.
    import java.io.*;
    import java.net.*;
    * <code>MultiPartFormOutputStream</code> is used to write
    * "multipart/form-data" to a <code>java.net.URLConnection</code> for
    * POSTing.  This is primarily for file uploading to HTTP servers. 
    * @since  JDK1.3
    public class MultiPartFormOutputStream {
          * The line end characters. 
         private static final String NEWLINE = "\r\n";
          * The boundary prefix. 
         private static final String PREFIX = "--";
          * The output stream to write to. 
         private DataOutputStream out = null;
          * The multipart boundary string. 
         private String boundary = null;
          * Creates a new <code>MultiPartFormOutputStream</code> object using
          * the specified output stream and boundary.  The boundary is required
          * to be created before using this method, as described in the
          * description for the <code>getContentType(String)</code> method. 
          * The boundary is only checked for <code>null</code> or empty string,
          * but it is recommended to be at least 6 characters.  (Or use the
          * static createBoundary() method to create one.)
          * @param  os        the output stream
          * @param  boundary  the boundary
          * @see  #createBoundary()
          * @see  #getContentType(String)
         public MultiPartFormOutputStream(OutputStream os, String boundary) {
              if(os == null) {
                   throw new IllegalArgumentException("Output stream is required.");
              if(boundary == null || boundary.length() == 0) {
                   throw new IllegalArgumentException("Boundary stream is required.");
              this.out = new DataOutputStream(os);
              this.boundary = boundary;
          * Writes an boolean field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, boolean value)
                   throws java.io.IOException {
              writeField(name, new Boolean(value).toString());
          * Writes an double field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, double value)
                   throws java.io.IOException {
              writeField(name, Double.toString(value));
          * Writes an float field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, float value)
                   throws java.io.IOException {
              writeField(name, Float.toString(value));
          * Writes an long field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, long value)
                   throws java.io.IOException {
              writeField(name, Long.toString(value));
          * Writes an int field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, int value)
                   throws java.io.IOException {
              writeField(name, Integer.toString(value));
          * Writes an short field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, short value)
                   throws java.io.IOException {
              writeField(name, Short.toString(value));
          * Writes an char field value. 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, char value)
                   throws java.io.IOException {
              writeField(name, new Character(value).toString());
          * Writes an string field value.  If the value is null, an empty string
          * is sent (""). 
          * @param  name   the field name (required)
          * @param  value  the field value
          * @throws  java.io.IOException  on input/output errors
         public void writeField(String name, String value)
                   throws java.io.IOException {
              if(name == null) {
                   throw new IllegalArgumentException("Name cannot be null or empty.");
              if(value == null) {
                   value = "";
              --boundary\r\n
              Content-Disposition: form-data; name="<fieldName>"\r\n
              \r\n
              <value>\r\n
              // write boundary
              out.writeBytes(PREFIX);
              out.writeBytes(boundary);
              out.writeBytes(NEWLINE);
              // write content header
              out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"");
              out.writeBytes(NEWLINE);
              out.writeBytes(NEWLINE);
              // write content
              out.writeBytes(value);
              out.writeBytes(NEWLINE);
              out.flush();
          * Writes a file's contents.  If the file is null, does not exists, or
          * is a directory, a <code>java.lang.IllegalArgumentException</code>
          * will be thrown. 
          * @param  name      the field name
          * @param  mimeType  the file content type (optional, recommended)
          * @param  file      the file (the file must exist)
          * @throws  java.io.IOException  on input/output errors
         public void writeFile(String name, String mimeType, File file)
                   throws java.io.IOException {
              if(file == null) {
                   throw new IllegalArgumentException("File cannot be null.");
              if(!file.exists()) {
                   throw new IllegalArgumentException("File does not exist.");
              if(file.isDirectory()) {
                   throw new IllegalArgumentException("File cannot be a directory.");
              writeFile(name, mimeType, file.getCanonicalPath(), new FileInputStream(file));
          * Writes a input stream's contents.  If the input stream is null, a
          * <code>java.lang.IllegalArgumentException</code> will be thrown. 
          * @param  name      the field name
          * @param  mimeType  the file content type (optional, recommended)
          * @param  fileName  the file name (required)
          * @param  is        the input stream
          * @throws  java.io.IOException  on input/output errors
         public void writeFile(String name, String mimeType,
                   String fileName, InputStream is)
                   throws java.io.IOException {
              if(is == null) {
                   throw new IllegalArgumentException("Input stream cannot be null.");
              if(fileName == null || fileName.length() == 0) {
                   throw new IllegalArgumentException("File name cannot be null or empty.");
              --boundary\r\n
              Content-Disposition: form-data; name="<fieldName>"; filename="<filename>"\r\n
              Content-Type: <mime-type>\r\n
              \r\n
              <file-data>\r\n
              // write boundary
              out.writeBytes(PREFIX);
              out.writeBytes(boundary);
              out.writeBytes(NEWLINE);
              // write content header
              out.writeBytes("Content-Disposition: form-data; name=\"" + name +
                   "\"; filename=\"" + fileName + "\"");
              out.writeBytes(NEWLINE);
              if(mimeType != null) {
                   out.writeBytes("Content-Type: " + mimeType);
                   out.writeBytes(NEWLINE);
              out.writeBytes(NEWLINE);
              // write content
              byte[] data = new byte[1024];
              int r = 0;
              while((r = is.read(data, 0, data.length)) != -1) {
                   out.write(data, 0, r);
              // close input stream, but ignore any possible exception for it
              try {
                   is.close();
              } catch(Exception e) {}
              out.writeBytes(NEWLINE);
              out.flush();
          * Writes the given bytes.  The bytes are assumed to be the contents
          * of a file, and will be sent as such.  If the data is null, a
          * <code>java.lang.IllegalArgumentException</code> will be thrown. 
          * @param  name      the field name
          * @param  mimeType  the file content type (optional, recommended)
          * @param  fileName  the file name (required)
          * @param  data      the file data
          * @throws  java.io.IOException  on input/output errors
         public void writeFile(String name, String mimeType,
                   String fileName, byte[] data)
                   throws java.io.IOException {
              if(data == null) {
                   throw new IllegalArgumentException("Data cannot be null.");
              if(fileName == null || fileName.length() == 0) {
                   throw new IllegalArgumentException("File name cannot be null or empty.");
              --boundary\r\n
              Content-Disposition: form-data; name="<fieldName>"; filename="<filename>"\r\n
              Content-Type: <mime-type>\r\n
              \r\n
              <file-data>\r\n
              // write boundary
              out.writeBytes(PREFIX);
              out.writeBytes(boundary);
              out.writeBytes(NEWLINE);
              // write content header
              out.writeBytes("Content-Disposition: form-data; name=\"" + name +
                   "\"; filename=\"" + fileName + "\"");
              out.writeBytes(NEWLINE);
              if(mimeType != null) {
                   out.writeBytes("Content-Type: " + mimeType);
                   out.writeBytes(NEWLINE);
              out.writeBytes(NEWLINE);
              // write content
              out.write(data, 0, data.length);
              out.writeBytes(NEWLINE);
              out.flush();
          * Flushes the stream.  Actually, this method does nothing, as the only
          * write methods are highly specialized and automatically flush. 
          * @throws  java.io.IOException  on input/output errors
         public void flush() throws java.io.IOException {
              // out.flush();
          * Closes the stream.  <br />
          * <br />
          * <b>NOTE:</b> This method <b>MUST</b> be called to finalize the
          * multipart stream.
          * @throws  java.io.IOException  on input/output errors
         public void close() throws java.io.IOException {
              // write final boundary
              out.writeBytes(PREFIX);
              out.writeBytes(boundary);
              out.writeBytes(PREFIX);
              out.writeBytes(NEWLINE);
              out.flush();
              out.close();
          * Gets the multipart boundary string being used by this stream. 
          * @return  the boundary
         public String getBoundary() {
              return this.boundary;
          * Creates a new <code>java.net.URLConnection</code> object from the
          * specified <code>java.net.URL</code>.  This is a convenience method
          * which will set the <code>doInput</code>, <code>doOutput</code>,
          * <code>useCaches</code> and <code>defaultUseCaches</code> fields to
          * the appropriate settings in the correct order. 
          * @return  a <code>java.net.URLConnection</code> object for the URL
          * @throws  java.io.IOException  on input/output errors
         public static URLConnection createConnection(URL url)
                   throws java.io.IOException {
              URLConnection urlConn = url.openConnection();
              if(urlConn instanceof HttpURLConnection) {
                   HttpURLConnection httpConn = (HttpURLConnection)urlConn;
                   httpConn.setRequestMethod("POST");
              urlConn.setDoInput(true);
              urlConn.setDoOutput(true);
              urlConn.setUseCaches(false);
              urlConn.setDefaultUseCaches(false);
              return urlConn;
          * Creates a multipart boundary string by concatenating 20 hyphens (-)
          * and the hexadecimal (base-16) representation of the current time in
          * milliseconds. 
          * @return  a multipart boundary string
          * @see  #getContentType(String)
         public static String createBoundary() {
              return "--------------------" +
                   Long.toString(System.currentTimeMillis(), 16);
          * Gets the content type string suitable for the
          * <code>java.net.URLConnection</code> which includes the multipart
          * boundary string.  <br />
          * <br />
          * This method is static because, due to the nature of the
          * <code>java.net.URLConnection</code> class, once the output stream
          * for the connection is acquired, it's too late to set the content
          * type (or any other request parameter).  So one has to create a
          * multipart boundary string first before using this class, such as
          * with the <code>createBoundary()</code> method. 
          * @param  boundary  the boundary string
          * @return  the content type string
          * @see  #createBoundary()
         public static String getContentType(String boundary) {
              return "multipart/form-data; boundary=" + boundary;
    }Usage: (try/catch left out to shorten the post a bit)
    URL url = new URL("http://www.domain.com/webems/upload.do");
    // create a boundary string
    String boundary = MultiPartFormOutputStream.createBoundary();
    URLConnection urlConn = MultiPartFormOutputStream.createConnection(url);
    urlConn.setRequestProperty("Accept", "*/*");
    urlConn.setRequestProperty("Content-Type",
         MultiPartFormOutputStream.getContentType(boundary));
    // set some other request headers...
    urlConn.setRequestProperty("Connection", "Keep-Alive");
    urlConn.setRequestProperty("Cache-Control", "no-cache");
    // no need to connect cuz getOutputStream() does it
    MultiPartFormOutputStream out =
         new MultiPartFormOutputStream(urlConn.getOutputStream(), boundary);
    // write a text field element
    out.writeField("myText", "text field text");
    // upload a file
    out.writeFile("myFile", "text/plain", new File("C:\\test.txt"));
    // can also write bytes directly
    //out.writeFile("myFile", "text/plain", "C:\\test.txt",
    //     "This is some file text.".getBytes("ASCII"));
    out.close();
    // read response from server
    BufferedReader in = new BufferedReader(
         new InputStreamReader(urlConn.getInputStream()));
    String line = "";
    while((line = in.readLine()) != null) {
          System.out.println(line);
    in.close();------
    "Useful Code of the Day" is supplied by the person who posted this message. This code is not guaranteed by any warranty whatsoever. The code is free to use and modify as you see fit. The code was tested and worked for the author. If anyone else has some useful code, feel free to post it under this heading.

    I have a weird problem here. I'm using the Java POST (slightly altered for my purposes) mechanism but the receiving script doesn't receive any form variables (neither files nor regular form fields). If I try using the same receiving script with a regular upload form, it works. Because I've been pulling my hair out, I even went so far as to analyze the ip-packets. I can see that the file is actually sent through the Java POST mecahnism. Anybody any ideas. Here's the ip-packet of the failing upload:
    ----- Hypertext Transfer Protocol -----
    HTTP: POST /fotoxs/upload.cfm HTTP/1.1
    HTTP: Connection: Keep-Alive
    HTTP: Content-Type: multipart/form-data; boundary=-----------------------------fb2649be18
    HTTP: User-Agent: Mozilla/4.7 [en] (WinNT; U)
    HTTP: Accept-Language: en-us
    HTTP: Accept-Encoding: gzip, deflate
    HTTP: Accept: image/gif, image/jpeg, image/pjpeg, */*
    HTTP: CACHE-CONTROL: no-cache
    HTTP: Host: newmarc
    HTTP: Content-Length: 15511
    ----- Hypertext Transfer Protocol -----
    HTTP: -----------------------------fb2649be18
    HTTP: Content-Disposition: form-data; name="uploadFile"; filename="out.jpg"
    HTTP: Content-Type: image/jpeg
    HTTP: Data
    ....[data packets]
    The one that works (from the regular post) is as follows:
    ----- Hypertext Transfer Protocol -----
    HTTP: POST /fotoxs/upload.cfm HTTP/1.1
    HTTP: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-gsarcade-launch, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    HTTP: Referer: http://localhost:8500/fotoxs/test.cfm
    HTTP: Accept-Language: nl
    HTTP: Content-Type: multipart/form-data; boundary=---------------------------7d41961f201c0
    HTTP: Accept-Encoding: gzip, deflate
    HTTP: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
    HTTP: Host: newmarc
    HTTP: Content-Length: 59022
    HTTP: Connection: Keep-Alive
    HTTP: Cache-Control: no-cache
    ----- Hypertext Transfer Protocol -----
    HTTP: -----------------------------7d41961f201c0
    HTTP: Content-Disposition: form-data; name="FiletoUpload"; filename="D:\My Documents\My Pictures\fotomarc.jpg"
    HTTP: Content-Type: image/pjpeg
    HTTP: Data
    ----- Hypertext Transfer Protocol -----
    HTTP: HTTP/1.1 100 Continue
    HTTP: Server: Microsoft-IIS/5.0
    HTTP: Date: Sun, 07 Mar 2004 17:14:41 GMT
    ....[data packets]
    One detail worth mentioning is that I don't read a file from harddisk, I'm streaming it directly to the connection outputstream from an image compression utility. But I can see the data in the ip-packets, and even if that somehow didn't work right, it doesn't explaing the fact that the receiving scripts reports no form fields whatsoever.
    Thanks,
    Marc

  • [svn] 3968: Fix for - ASDoc fails if example code included by the @ includeExample tag contains an "&"

    Revision: 3968
    Author: [email protected]
    Date: 2008-10-30 10:45:04 -0700 (Thu, 30 Oct 2008)
    Log Message:
    Fix for - ASDoc fails if example code included by the @includeExample tag contains an "&"
    Also fix for broken links with $$ symbol.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17830
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17830
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    Revision: 3968
    Author: [email protected]
    Date: 2008-10-30 10:45:04 -0700 (Thu, 30 Oct 2008)
    Log Message:
    Fix for - ASDoc fails if example code included by the @includeExample tag contains an "&"
    Also fix for broken links with $$ symbol.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17830
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17830
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

  • I have paid for ipages 09 on 15/05 but never succed to enter the serial code. After 45 days, altough I was charged by 20 chf, I cannot completely use all ipages tools(impossible to save ). How can I get again the serial code I paid for?

    i have paid for ipages 09 on 15/05 but never succed to enter the serial code. After 45 days, altough I was charged by 20 chf, I cannot completely use all ipages tools(impossible to save ). How can I get again the serial code I paid for?

    Getting the request for a serial number means that at some time you had the iWork ’09 trial installed. You need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user. The easiest way to fix the problem is to use Yvan Koenig's AppleScript that removes the files. You can find it on his box.com account in for_iWork'09 > other_iWork'09 items > uninstall iWork '09.zip. Download uninstall iWork '09.zip, decompress it, open it in AppleScript Editor and click the Run button.
    Apple's support article on the subject says it's due to having a copy of the trial that is a higher version that the one you've purchased, but I'm not sure that is very common. This problem started with Snow Leopard & it seems to be some code in the iWork installers that doesn't do what it should.

  • Whenever I open a file in Lion, other files of the same sort that I opened previously automatically open up. For example, if I open a .jpg file, numerous other .jpg files that I opened previously in the day open up. How do I prevent this from happening?

    Whenever I open a file in Lion, other files of the same sort that I opened previously automatically open up. For example, if I open a .jpg file, numerous other .jpg files that I opened previously in the day open up. How do I close these files to prevent them from showing up again, like in previous versions?

    Dealing With The Resume Feature of Lion
    Managing Mac OS X Lion's application resume feature.
    If you shutdown your computer you should get a dialog asking if you want applications to resume on the next startup. Simply uncheck the box to prevent that from occurring. Open General preferences and uncheck the option to Restore windows when quitting and re-opening apps. You can also install a third-party utility to control resume features on individual applications: RestoreMeNot or Application State Cleaner.
    It is possible to completely stop the Resume feature although I'm unconvinced that it is that annoying. Nevertheless see the following:
    If you have not yet done so you must first make your /Home/Library/ folder visible. Open the Terminal application in the Utilities folder. At the prompt paste the following command line:
    chflags nohidden ~/Library
    Press RETURN. Quit the Terminal application.
    In the Finder navigate to the /Home/Library/Saved Application State/ folder. Delete the contents of the folder. Back up to the /Home/Library/ folder. Select the Saved Application State folder. Press COMMAND-I to open the Get Info window. In the Sharing and Permissions panel at the bottom click on the lock icon and authenticate. Set each of the listed entries to Read Only. Close the Get Info window.
    Quit all open programs except the Finder (this is very important.) Next, navigate to the /Home/Library/Preferences/ByHost/ folder. Look for a .plist file with "com.apple.loginwindow." in the file name followed by some numbers in hexadecimal. Select the file. Press COMMAND-I to open the Get Info window and in the Sharing and Permissions panel click on the lock icon and authenticate. Set each of the listed entries to Read Only. Close the Get Info window. If you also find a file with the same filename but with a last extension of ".lockfile," then you should delete it.
    The above should eliminate the Resume feature system-wide. Note that any future system updates or upgrades will likely undo these changes. You will then need to repeat this procedure assuming there are no major changes in OS X related to it.

  • " Enhancing the Quality of ABAP Development ", downloadable code examples?

    Hello all,
    I just finished reading this book.  I would recommend it highly to experienced ABAP developers.  My only complaint is that the book did not give a link to the source code examples used in the book.
    Is anyone aware of any location where the source code examples in this book are stored?  I have checked both SAP  Press and Galileo Press's web sites.
    Thanks
    Bruce

    closing old post

  • Problems doing the "Web Service" example from the 2-Day-Developer Guide

    Hello,
    I want to do the "web service" example from the 2-Day-Developer Guide.
    I give the application my proxy server address in the format address:port and go through the assistant creating the web service. After selecting the IBM UDDI-service and searching for %xMethods% as business name I get the following error:
    ORA-31011: XML-Parsing not successful ORA-19202: Error parsing XML LPX-00104: Warning: Element "html" is not declared in DTD Error at line 2
    What have I done wrong?
    With kind regards
    Florian Reiser

    Please.. Could you change your forum handle to something more human, we are a friendly group here and lik to know who we are talking to.. Secondly, WHy are you using such an OLD version oft he product. You would be better off installing 3.2.1 (latest released build) and asking your questions after you do that..
    (I am sorry, it's like asking for help in a Windows support forum about issues you are having with Windows 3.1)
    Thank you,
    Tony Miller
    Webster, TX

Maybe you are looking for

  • HP Laptop Upgrade / Replacemen​t

    I need to upgrade / replace my current HP laptop and want some guidance on what to replace it with. I currenty have the following: HP Pavilian DV9000 Product Name dv9760ei Product Number KP947EA Microprocessor 2.40 GHz Intel Core 2 Duo processor T830

  • History not shown correctly

    I have installed BOE 3.1 on Solaris.  When I schedule a report, the history does not always refresh correctly.  In some cases the history shown is from a previous report and not the current report.  Their appears to be a caching problem but the probl

  • Spotlight Has Stopped Working, WHY!!!!!!

    Hi There, New to this mac business converted after 10 years of being a PC man but music industry required me to spend money on Logic, anyway i was casually using my macbook and the spotlight thing stopped working, its nothing big but really annoying

  • "Source List" is gone after intalling new iTunes version

    I downloaded the new version of iiTunes today and I no longer have a source list so I can't get in the store, use my ipod etc. Can anyone help?

  • Show and Share - Mac OS

    Is anyone successful in adding a  video w/ audio with the built-in camera/mic on a Mac Book Pro? Video is  fine, but I have zero audio. Works fine for other products, Skype, CUPC,  etc. I've tried all three options and different browsers. TIA! -Jon