Bug alert!

I found that really big files (like over 10 meg) may crashe iphoto. I have one file that it thinks is 46 meg (not sure why, its not that big) and sometimes it loads fine, and sometimes it crashes. It always restarted ok, so I didn't worry too much.
Decided to delete the file, and when I tried to empty the iphoto trash, it killed iPhoto competely, eventually requiring an OS reinstall after that cascaded into other problems.
Bug seems to be some limit in file size in iPhoto main and trash functions, and there appears to be no error trapping.
Doh!

Spinnetti:
I have one
file that it thinks is 46 meg (not sure why, its not
that big)
That's an issue that was around in V4. iPhoto would
mistakenly think a file was enormous, in the gigabyte
range, and that would cause problems. The solution
there was to do an edit on it and then a Revert to
Original. That would get iPhoto to read it properly.
It's not just size as I've got a 106MB file in one of
my libraries and it works just fine, but very slow.
Thanks for the tip. Glad its not just me. Sometimes it would load it fine, other times crash. It was the deleting it that killed iPhoto

Similar Messages

  • Bugging alert in offline mode ?

    Hi
    When working offline, I click "send" for composed messages to have them sent as soon as I get online again.
    Alas, even though Mail.app understands I'm offline, it keeps bugging me for each and every message alerting that it can't send the message using the current SMTP server (I have several alternatives) and I must click "Try again later".
    How can I work around this annoyance?
    Thanks!

    You’re welcome.
    Mail doesn’t handle this very well. If you quit Mail while in the offline state, for example, then open it again, Mail will ignore that it’s offline for sending purposes and will try to send all the messages waiting in Outbox regardless, which can be quite annoying.

  • How do I get Alert Tone to sound for Weather Bug Alerts?

    I'm not able to get the Alert Tones to sound for Weather Bug weather Alerts and FOX News news Alerts.
    I have the sounds turn on in the notification section, but when alerts come in there's no sound.

    Hello DenWD
    If the notification sound is not working, then I would recommend removing the App to get it out of Notification Center and then download it again and change the settings to see if that resolves the issue.
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/ts1702
    Regards,
    -Norm G.  

  • Bug Alert: Problems with font color in CS5

    I'm noticing a problem that occurs when I try to change the color of some point type on my artboard. I type in some text, it's selected and I use the eyedropper or click on a swatch to select a new color for the text, and the font stays black. The active color on the color panel and the tool panel for the fill has changed to the new color I selected, but the font displays in black.
    I can even select something else, then go back and select the problem type and see that the color panel "thinks" it's blue, but the text displays as black. The only remedy seems to be re-typing the word, essentially starting over. I've rebooted to no avail. This seems like a bug, because it pops up about every other or every third time I try to work with type.
    At first I ignored it because it was occurring with a new font, and I thought the problem was the font - but now it's happening with all my tried-and-true fonts.
    Is anyone else having this problem?

    The only way I know this to happen is if there is a new fill which has been added via the appearance panel and the fill has been drag to the bottom of the characters in the panel.
    Or you have the type tool active and the cursor is active but the tex is not actually selected. Like such

  • Bug alert re iMT Extraction tool and custom data/display fields superclasses

    In the current iMT there is a Extraction tool bug whereby custom
    superclass usage in NetDynamics displayFields and/or dataFields are
    resulting in nodes being omitted from the
    application description. Worse, this omission was not being detected
    by the Extraction tool. The error would not surface until the
    Translation tool ran and tried to use the incomplete application
    description xml file. The translation tool would then error as it
    tried to locate non-existant nodes.
    This is a serious problem for those applications which make use of
    custom superclasses for displayFields and/or dataFields. If the
    extraction omits these nodes, then the information is not available
    to be translated. The problem is so severe, that I assume no one out
    there has encountered it, or they would have reported it to us. If I
    am mistaken in this assumption, please contact us.
    The problem was easily corrected once identified. A fix will be
    included in the next general release of the iMT.
    At this point we are holding off on releasing micro-patches, in
    anticipation of releasing a comprehensive iMT 1.1 release in the near
    future.
    If you have urgent need for this fix or any others that have been
    listed on these boards, since the last patch drop, please let us know
    ASAP and we will see what we can do.

    I, for one, appreciate your contribution to this forum.
    I haven't used Ultiboard since my initial purchase of it many many years ago.  (MultiSim was bad enough.  I wasn't about to start fighting with UltiBoard also.)  However, it's of note how may bugs you have open/unsolved.  MultiSim Inc has definitely not done its homework.  In my case, that's not so much of a loss, but based on what you're saying, you actually have to use this thing to make money!  That stinks!
    I have little grounds for filing suit, as I've taken little risk; although, I can't tell you how many hours I've burned trying to figure out MultiSim's latest burp, that's hardly grounds for benefit from a suit.   But you however, you're losing money!  I'm thinking that the "at your own risk" in the fine print is MultiSim's out, but this is just wrong, the way this company is.  This program just doesn't work and it looks like little can be done about it. 
    I thought that National Instruments' involvement would get some where with this program, but thus far that's proving to be an error on my part.  My latest bug is the inclusion of MultiSim's multimeter causes a circuit to stop simulating.  I mean how ridiculous is that?!  But at least when MultiSim burps for me I'm not losing money, just time.
    Thanks again for starting this thread!

  • Bug Alert - MIDI Environment

    Probably nothing to most people but mission critical to me - arpeggiators used live with a length of 'Original' put out no signal at all any more - worked fine through the last many versions of Logic. Total show-stopper, total loss of the cost of upgrade, I have no choice but to go back to Ver 7. (Can't find out where to report a bug either!)

    here is the URL for logic feedback...
    http://www.apple.com/feedback/logicpro.html

  • Minor bug alert re: MigrationClassMappings.properties file entry

    The MigrationClassMappings.properties contains entries that are
    intended to provide the mapping of ND classes to JATO classes, and ND
    project specific classes to migration specific classes.
    Currently there is an improper entry.
    Project=ApplicationServletBase
    This entry should be changed to
    Project=__appName__ServletBase
    The implications of this "bug" only surfaced if your ND project class
    had derived from a custom superclass (i.e. something other than
    CSpProject) AND you had not augmented the
    MigrationClassMappings.properties to add an entry for that custom
    class.
    If both of those circumstances applied to your translation effort
    then the net effect of the "bug" entry would be that your module
    specific servlet would be improperly derived from the JATO
    ApplicationServletBase, when in fact it should have been derived from
    the application specific servlet base.
    For example if ND project Foo extended Bar
    the bug would have resulted in the generation of code where
    FooServlet extends ApplicationServletBase
    when, in fact, it should be
    FooServlet extends FooApplicationServletBase
    If this is not clear, please respond.
    The next release of the iMT will include this fix.
    Current users can easily adjust the MigrationClassMappings.properties
    file manually.

    Hi Everyone:
               I have done some further testing.  We are using a re-usable Business Components .jar file to access our entities.  We import the .jar file into the project and create the ViewObjects and ViewLinks from that .jar file.
                It APPEARS that a test case using the HRSchema and using the Entities & Associates generates the constraint error messages, but when I use the .jar file of re-usable business components imported into the project, those constraint error messages are not created in the ApplicationResources_en.properties file.  I have created two testcases as well as the re-usable .jar file that I can send to you to show what I mean. 
                This behaviour seems to have shown up in 11.1.2 as there was no problem before this.
                 Please let me know where you'd like me to upload the testcases.
                 Thank you.
    Mary
    UofW

  • **Bug Alert** Can't create an WDS on an intel mac

    I've been trying to extend the range of my network with two Airport extreme's, (one main and one relay) using the airport admin utility on my mac book pro, but when setting up the relay base station it always returned an error of "fault with base station".
    So I tried the same setup with my tangerine iMac and it took a couple of minutes! no problems at all.
    I personally think it's a fault with the application, rather that with the computer?
    Any thoughts anyone??

    Here's a thought. What document format is your dissertation requirement? If it is expected in a Microsoft Word format, then you would be better served (without future surprises) to do your dissertation entirely in MS Word, and take advantage of Microsoft's Smart Art (Hierarchy category) graphics within Word.
    Your work will look professionally done and not hand-drawn. You will create all work directly in a native Word document format, and not experience potential format issues when Pages attempts to translate its content to a non-native format. Dissertations are very important. Don't gamble. Enjoy Pages on less critical documents.

  • BUG ALERT!!!! 1.2 killed my 60 gig

    My 60 gig video has 666 days of apple care coverage left.
    Last night I "upgraded" to software V.1.2 and now my ipod wost stop reseting randomly. I've "restored" it like five times now.....with the latest version of itunes.
    The apple rep told me to send it in!!! or go to an apple store!!!!

    Don't worry about sending your iPod in, you will only live without your iPod for a week from the date of sending it via the courier before getting it back.
    (although if it plays a big part in your life like mine, you may go into withdrawal)
    If there is a problem and Apple find out about it, it would do so much good for so many other people and they will fix the issue.
    You may get a new iPod 5th generation out of this, just be careful with your library - you don't want to lose your music!

  • Searching for a Certain iPhone App on Apple iTunes AppStore???

    ok i need to know if Apple AppStore has an iPhone App that Detects Rats & Mice???
    why i ask???
    Last night I Was Sleeping in My Room ok so there are times I Get up in the middile of the night & Have Very Bad Habits of Rocking back & Fourth at night so I Was in The Dark Rocking Back & Fourth on My Bed ok so a Rat or a Mouse came from underneath the Bed & was Sniffing My Leg, I Could feel it's Nose & Whiskers & I Saw it but it was Dark but i saw it even in the Dark but the Minute I Screamed & was calling my Grandmother it ran back underneath the Bed so when My Grandmother came in my room after i woke her up, we did not see The Mouse or the Rat, i moved my bed & everything i did not see anything but I Work in an AMC Movie Theatre & I Know how these Rats & Mice are on how they work & I Don't have a very big Room so it's a Small regular room but the funny part about it is, I Never saw it's Eyes Glow in the dark but i saw it & it was Sniffing My leg & i felt it's Nose & Whiskers???
    so this is why i am asking if they have an iPhone App that Detects Mice & Rats, if Only i had a iPhone App that Detects Rats & Mice just to know if i had them???

    yeah i mean reference material about bed bugs i got it,
    these are the 2 iPhone Apps i have for bed bugs, but i don't have any bed bugs thank god but i have the app to tell me in case something serious mite happen?
    https://itunes.apple.com/us/app/bed-bug-alert/id397206377?mt=8
    https://itunes.apple.com/us/app/bedbugs-101/id411932955?mt=8

  • Adobe Reader printer output not printing with printer

    Hi all,
    I've downloaded the current Adobe Reader 9.3 and have not been able to print. It sends the file to my print spooler where I check on it and see that the job is tagged with an error. I've just got the 10.6.3 but this also occurred under 10.6.2 Mac OS. I posted a bug alert to Adobe. My printer is a Canon. I sometimes choose to use Adobe Reader in leu of Preview when filling out a form. Personal choice at this point, but in the past, only Adobe preserved the correct font and all of the form.
    Just wondering if anyone else has had this issue.
    Not sure if this is a printer driver issue or a output error. But the printer works with everything else.
    Linc

    I have a similar problem that my mac mini running 10.6.3 with Adobe Reader 9.3.2. I print using a shared printer HP F2280 from iMac running 10.5.8 wireless airport.
    When I print PDF from my mac mini, the share printer can only print a few lines and that stop. There is no error in the printer queue. It say accept print file.
    I'm using preview to print PDF right now before solution come out.

  • Aspect ratio filter not working properly

    I am running LR3.5 on Mac OS 10.6.8 and recently discovered that the aspect ratio filter is not working when used on folders created a few years ago. Specifically, a great many images shot in landscape mode are included with the portrait mode filter instead of in the landscape mode filter. This is not happening with more recent folders. At least one of my camera bodies has been used for images in older and newer folders so I do not think it is the camera's fault. I should also add that the files are saved in the dng format.
    I do not know how long this has been going on, since I rarely use the aspect ratio filter. It is even possible that this happened when I converted my catalog from LR2 to LR3.   The integrity of the catalog is checked each time I back up, which is whenever I exit.  Does anyone have any ideas how to fix this?
    Thanks.
    Mark

    So the metadata is properly showing the images as landscape. Somewhere along the way LR got out of sync, perhaps moving images into a new catalog? As long as there are no portrait Crops on any of these files they should filter properly after resynching the DNG metadata. There have been other posts with this same issue and a bug report to Adobe. Not sure it has been actually fixed though:
    http://paulsumberg.com/2010/08/03/leave-it-to-me-to-discover-a-flaw-in-adobe-lightroom/
    http://paulsumberg.com/2010/08/14/bug-alert-adobe-lightroom-and-work-around/

  • Why is the font different weight in iOS?

    I am using an iOS font and yet it's thin and badly rendered until I edit the text field and then it appears bolder than it should appear.
    I've been using Helvetica Neue and it looks thin on my iPad and the line size is shorter than what I have set.
    Anyone else have this problem, and if so, have they found a solution?
    If not please reply so I know it's just me.
    I tried pre-rendering text but it crashes the app on iOS. (bug alert)

    I apologize.
    English is the Language of Great Britain.
    Every other versions are degenerate ones.
    About the localized versions of 10.7 I agree with you.
    As a beta tester of 10.7.2, I reported hundreds of wanted changes. Alas, the only result was :
    This issue is still under investigation with engineering.
    When I received the 10.7.3 beta versions I discovered that nothing was corrected on this side so, I asked if it was useful to waste time for such a result.
    I got the same autistic answer :
    This issue is still under investigation with engineering.
    I have some difficulties to understand why engineering is required to correct misspelled words or to correct a grammatical error.
    It seems that US engineers are supposed to know the French spelling rules better than French engineers.
    Yvan KOENIG (VALLAURIS, France) dimanche 12 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • Minimum value of UNIX/Linux Heartbeat Monitor in scom 2012

    Hi,
    In my environment, we have SCOM 2012 server, when I change values of UNIX/Linux
    Heartbeat Monitor: Interval , Missed
    Heartbeats and Missed Heartbeats from 300 , 630 ,2 to 120, 150, 1 in event viewer shows Error
    11112:
    The Microsoft Operations Manager Consolidate Module failed to initialize because the specified compare count is less than the minimum
    Compare count value : 1
    Minimum value allowed : 2
    One or more workflows were affected by this.
    What is the best minimum value?
    Thanks

    You've ended up in the wrong forum. mostly service manager here, Ops manager is
    over there https://social.technet.microsoft.com/Forums/en-US/home?category=systemcenteroperationsmanager. 
    That being said, the error you reference is somewhat abstracted from the values you adjusted. the error you posted is the system comparison operator complaining that it only has one thing to compare, typically you need two things to do a comparison.
    Here is a person running into a similar problem with the lync MP, where it was trying to compare the site assignment of two systems, but the environment only has one system.
    http://thoughtsonopsmgr.blogspot.com/2014/09/lync-server-2010-mp-bug-alert.html. is it possible this is an outgrowth of something similar in your unix environment? Do you have any more details about the specific health XML that's failing?

  • PrintDialog in WordProcessor

    Hi,
    Im trying to insert this dummy print function in my Wordprocessor, the code generates a new dialog with a textfield and continues generating random numbers every 2 seconds in the textfield.
    Here is the code for the wordprocessor & print functions
    Any help much appreciated..........
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import javax.swing.text.rtf.*;
    import javax.swing.undo.*;
    public class WordProcessor extends JFrame
    protected JTextPane m_monitor;
    protected StyleContext m_context;
    protected DefaultStyledDocument m_doc;
    protected RTFEditorKit m_kit;
    protected JFileChooser m_chooser;
    protected SimpleFilter m_rtfFilter;
    protected JToolBar m_toolBar;
    protected JComboBox m_cbFonts;
    protected JComboBox m_cbSizes;
    protected SmallToggleButton m_bBold;
    protected SmallToggleButton m_bItalic;
    protected String m_fontName = "";
    protected int m_fontSize = 0;
    protected boolean m_skipUpdate;
    protected int m_xStart = -1;
    protected int m_xFinish = -1;
    protected SimpleFilter m_jpgFilter;
    protected SimpleFilter m_gifFilter;
    protected ColorMenu m_foreground;
    protected ColorMenu m_background;
    protected JComboBox m_cbStyles;
    protected Hashtable m_styles;
    protected UndoManager m_undo = new UndoManager();
    protected Action m_undoAction;
    protected Action m_redoAction;
    protected String[] m_fontNames;
    protected String[] m_fontSizes;
    protected FontDialog m_fontDialog;
    protected ParagraphDialog m_paragraphDialog;
    protected FindDialog m_findDialog;//////////////////////////////////////
    public WordProcessor() {
    super("Text Editor");
    setSize(600, 400);
    m_monitor = new JTextPane();
    m_kit = new RTFEditorKit();
    m_monitor.setEditorKit(m_kit);
    m_context = new StyleContext();
    m_doc = new DefaultStyledDocument(m_context);
    m_monitor.setDocument(m_doc);
    JScrollPane ps = new JScrollPane(m_monitor);
    getContentPane().add(ps, BorderLayout.CENTER);
    JMenuBar menuBar = createMenuBar();
    setJMenuBar(menuBar);
    m_chooser = new JFileChooser();
    m_chooser.setCurrentDirectory(new File("."));
    m_rtfFilter = new SimpleFilter("rtf", "RTF Documents");
    m_chooser.setFileFilter(m_rtfFilter);
    m_gifFilter = new SimpleFilter("gif", "GIF images");
    m_jpgFilter = new SimpleFilter("jpg", "JPG images");
    CaretListener lst = new CaretListener() {
    public void caretUpdate(CaretEvent e) {
    showAttributes(e.getDot());
    m_monitor.addCaretListener(lst);
    FocusListener flst = new FocusListener() {
    public void focusGained(FocusEvent e) {
    if (m_xStart>=0 && m_xFinish>=0)
    if (m_monitor.getCaretPosition()==m_xStart) {
    m_monitor.setCaretPosition(m_xFinish);
    m_monitor.moveCaretPosition(m_xStart);
    else
    m_monitor.select(m_xStart, m_xFinish);
    public void focusLost(FocusEvent e) {
    m_xStart = m_monitor.getSelectionStart();
    m_xFinish = m_monitor.getSelectionEnd();
    m_monitor.addFocusListener(flst);
    WindowListener wndCloser = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    addWindowListener(wndCloser);
    showAttributes(0);
    showStyles();
    m_doc.addUndoableEditListener(new Undoer());
    setVisible(true);
    protected JMenuBar createMenuBar() {
    JMenuBar menuBar = new JMenuBar();
    JMenu mFile = new JMenu("File");
    mFile.setMnemonic('f');
    ImageIcon iconNew = new ImageIcon("file_new.gif");
    Action actionNew = new AbstractAction("New", iconNew) {
    public void actionPerformed(ActionEvent e) {
    m_doc = new DefaultStyledDocument(m_context);
    m_monitor.setDocument(m_doc);
    showAttributes(0);
    showStyles();
    m_doc.addUndoableEditListener(new Undoer());
    JMenuItem item = mFile.add(actionNew);
    item.setMnemonic('n');
    ImageIcon iconOpen = new ImageIcon("file_open.gif");
    Action actionOpen = new AbstractAction("Open...", iconOpen) {
    public void actionPerformed(ActionEvent e) {
    WordProcessor.this.setCursor(
    Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    Thread runner = new Thread() {
    public void run() {
    if (m_chooser.showOpenDialog(WordProcessor.this) !=
    JFileChooser.APPROVE_OPTION)
    return;
    WordProcessor.this.repaint();
    File fChoosen = m_chooser.getSelectedFile();
    // Recall that text component read/write operations are
    // thread safe. Its ok to do this in a separate thread.
    try {
    InputStream in = new FileInputStream(fChoosen);
    m_doc = new DefaultStyledDocument(m_context);
    m_kit.read(in, m_doc, 0);
    m_monitor.setDocument(m_doc);
    in.close();
    showAttributes(0);
    showStyles();
    m_doc.addUndoableEditListener(new Undoer());
    catch (Exception ex) {
    //ex.printStackTrace();
    System.out.println("Problems encountered: Note that RTF"
    + " support is still under development.");
    WordProcessor.this.setCursor(Cursor.getPredefinedCursor(
    Cursor.DEFAULT_CURSOR));
    runner.start();
    item = mFile.add(actionOpen);
    item.setMnemonic('o');
    ImageIcon iconSave = new ImageIcon("file_save.gif");
    Action actionSave = new AbstractAction("Save...", iconSave) {
    public void actionPerformed(ActionEvent e) {
    WordProcessor.this.setCursor(
    Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    Thread runner = new Thread() {
    public void run() {
    if (m_chooser.showSaveDialog(WordProcessor.this) !=
    JFileChooser.APPROVE_OPTION)
    return;
    WordProcessor.this.repaint();
    File fChoosen = m_chooser.getSelectedFile();
    // Recall that text component read/write operations are
    // thread safe. Its ok to do this in a separate thread.
    try {
    OutputStream out = new FileOutputStream(fChoosen);
    m_kit.write(out, m_doc, 0, m_doc.getLength());
    out.close();
    catch (Exception ex) {
    ex.printStackTrace();
    // Make sure chooser is updated to reflect new file
    m_chooser.rescanCurrentDirectory();
    WordProcessor.this.setCursor(Cursor.getPredefinedCursor(
    Cursor.DEFAULT_CURSOR));
    runner.start();
    item = mFile.add(actionSave);
    item.setMnemonic('s');
    mFile.addSeparator();
    Action actionExit = new AbstractAction("Exit") {
    public void actionPerformed(ActionEvent e) {
    System.exit(0);
    item = mFile.add(actionExit);
    item.setMnemonic('x');
    menuBar.add(mFile);
    m_toolBar = new JToolBar();
    JButton bNew = new SmallButton(actionNew, "New document");
    m_toolBar.add(bNew);
    JButton bOpen = new SmallButton(actionOpen, "Open RTF document");
    m_toolBar.add(bOpen);
    JButton bSave = new SmallButton(actionSave, "Save RTF document");
    m_toolBar.add(bSave);
    JMenu mEdit = new JMenu("Edit");
    mEdit.setMnemonic('e');
    Action action = new AbstractAction("Copy",
    new ImageIcon("edit_copy.gif"))
    public void actionPerformed(ActionEvent e) {
    m_monitor.copy();
    item = mEdit.add(action);
    item.setMnemonic('c');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,
    KeyEvent.CTRL_MASK));
    action = new AbstractAction("Cut",
    new ImageIcon("edit_cut.gif"))
    public void actionPerformed(ActionEvent e) {
    m_monitor.cut();
    item = mEdit.add(action);
    item.setMnemonic('t');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X,
    KeyEvent.CTRL_MASK));
    action = new AbstractAction("Paste",
    new ImageIcon("edit_paste.gif"))
    public void actionPerformed(ActionEvent e) {
    m_monitor.paste();
    item = mEdit.add(action);
    item.setMnemonic('p');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V,
    KeyEvent.CTRL_MASK));
    mEdit.addSeparator();
    m_undoAction = new AbstractAction("Undo",
    new ImageIcon("edit_undo.gif"))
    public void actionPerformed(ActionEvent e) {
    try {
    m_undo.undo();
    catch (CannotUndoException ex) {
    System.err.println("Unable to undo: " + ex);
    updateUndo();
    item = mEdit.add(m_undoAction);
    item.setMnemonic('u');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z,
    KeyEvent.CTRL_MASK));
    m_redoAction = new AbstractAction("Redo",
    new ImageIcon("edit_redo.gif"))
    public void actionPerformed(ActionEvent e) {
    try {
    m_undo.redo();
    catch (CannotRedoException ex) {
    System.err.println("Unable to redo: " + ex);
    updateUndo();
    item = mEdit.add(m_redoAction);
    item.setMnemonic('r');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y,
    KeyEvent.CTRL_MASK));
    mEdit.addSeparator();
    Action findAction = new AbstractAction("Find...",
    new ImageIcon("edit_find.gif"))
    public void actionPerformed(ActionEvent e) {
    WordProcessor.this.repaint();
    if (m_findDialog==null)
    m_findDialog = new FindDialog(WordProcessor.this, 0);
    else
    m_findDialog.setSelectedIndex(0);
    Dimension d1 = m_findDialog.getSize();
    Dimension d2 = WordProcessor.this.getSize();
    int x = Math.max((d2.width-d1.width)/2, 0);
    int y = Math.max((d2.height-d1.height)/2, 0);
    m_findDialog.setBounds(x + WordProcessor.this.getX(),
    y + WordProcessor.this.getY(), d1.width, d1.height);
    m_findDialog.show();
    item = mEdit.add(findAction);
    item.setMnemonic('f');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F,
    KeyEvent.CTRL_MASK));
    Action replaceAction = new AbstractAction("Replace...") {
    public void actionPerformed(ActionEvent e) {
    WordProcessor.this.repaint();
    if (m_findDialog==null)
    m_findDialog = new FindDialog(WordProcessor.this, 1);
    else
    m_findDialog.setSelectedIndex(1);
    Dimension d1 = m_findDialog.getSize();
    Dimension d2 = WordProcessor.this.getSize();
    int x = Math.max((d2.width-d1.width)/2, 0);
    int y = Math.max((d2.height-d1.height)/2, 0);
    m_findDialog.setBounds(x + WordProcessor.this.getX(),
    y + WordProcessor.this.getY(), d1.width, d1.height);
    m_findDialog.show();
    item = mEdit.add(replaceAction);
    item.setMnemonic('r');
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H,
    KeyEvent.CTRL_MASK));
    menuBar.add(mEdit);
    GraphicsEnvironment ge = GraphicsEnvironment.
    getLocalGraphicsEnvironment();
    m_fontNames = ge.getAvailableFontFamilyNames();
    m_toolBar.addSeparator();
    m_cbFonts = new JComboBox(m_fontNames);
    m_cbFonts.setMaximumSize(m_cbFonts.getPreferredSize());
    m_cbFonts.setEditable(true);
    ActionListener lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    m_fontName = m_cbFonts.getSelectedItem().toString();
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setFontFamily(attr, m_fontName);
    setAttributeSet(attr);
    m_monitor.grabFocus();
    m_cbFonts.addActionListener(lst);
    m_toolBar.add(m_cbFonts);
    m_toolBar.addSeparator();
    m_fontSizes = new String[] {"8", "9", "10", "11", "12", "14",
    "16", "18", "20", "22", "24", "26", "28", "36", "48", "72"};
    m_cbSizes = new JComboBox(m_fontSizes);
    m_cbSizes.setMaximumSize(m_cbSizes.getPreferredSize());
    m_cbSizes.setEditable(true);
    m_fontDialog = new FontDialog(this, m_fontNames, m_fontSizes);
    m_paragraphDialog = new ParagraphDialog(this);
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    int fontSize = 0;
    try {
    fontSize = Integer.parseInt(m_cbSizes.
    getSelectedItem().toString());
    catch (NumberFormatException ex) { return; }
    m_fontSize = fontSize;
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setFontSize(attr, fontSize);
    setAttributeSet(attr);
    m_monitor.grabFocus();
    m_cbSizes.addActionListener(lst);
    m_toolBar.add(m_cbSizes);
    m_toolBar.addSeparator();
    ImageIcon img1 = new ImageIcon("font_bold1.gif");
    ImageIcon img2 = new ImageIcon("font_bold2.gif");
    m_bBold = new SmallToggleButton(false, img1, img2,
    "Bold font");
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setBold(attr, m_bBold.isSelected());
    setAttributeSet(attr);
    m_monitor.grabFocus();
    m_bBold.addActionListener(lst);
    m_toolBar.add(m_bBold);
    img1 = new ImageIcon("font_italic1.gif");
    img2 = new ImageIcon("font_italic2.gif");
    m_bItalic = new SmallToggleButton(false, img1, img2,
    "Italic font");
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setItalic(attr, m_bItalic.isSelected());
    setAttributeSet(attr);
    m_monitor.grabFocus();
    m_bItalic.addActionListener(lst);
    m_toolBar.add(m_bItalic);
    JMenu mFormat = new JMenu("Format");
    mFormat.setMnemonic('o');
    item = new JMenuItem("Font...");
    item.setMnemonic('o');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    WordProcessor.this.repaint();
    AttributeSet a = m_doc.getCharacterElement(
    m_monitor.getCaretPosition()).getAttributes();
    m_fontDialog.setAttributes(a);
    Dimension d1 = m_fontDialog.getSize();
    Dimension d2 = WordProcessor.this.getSize();
    int x = Math.max((d2.width-d1.width)/2, 0);
    int y = Math.max((d2.height-d1.height)/2, 0);
    m_fontDialog.setBounds(x + WordProcessor.this.getX(),
    y + WordProcessor.this.getY(), d1.width, d1.height);
    m_fontDialog.show();
    if (m_fontDialog.getOption()==JOptionPane.OK_OPTION) {
    setAttributeSet(m_fontDialog.getAttributes());
    showAttributes(m_monitor.getCaretPosition());
    item.addActionListener(lst);
    mFormat.add(item);
    item = new JMenuItem("Paragraph...");
    item.setMnemonic('p');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    WordProcessor.this.repaint();
    AttributeSet a = m_doc.getCharacterElement(
    m_monitor.getCaretPosition()).getAttributes();
    m_paragraphDialog.setAttributes(a);
    Dimension d1 = m_paragraphDialog.getSize();
    Dimension d2 = WordProcessor.this.getSize();
    int x = Math.max((d2.width-d1.width)/2, 0);
    int y = Math.max((d2.height-d1.height)/2, 0);
    m_paragraphDialog.setBounds(x + WordProcessor.this.getX(),
    y + WordProcessor.this.getY(), d1.width, d1.height);
    m_paragraphDialog.show();
    if (m_paragraphDialog.getOption()==JOptionPane.OK_OPTION) {
    setAttributeSet(m_paragraphDialog.getAttributes(), true);
    showAttributes(m_monitor.getCaretPosition());
    item.addActionListener(lst);
    mFormat.add(item);
    mFormat.addSeparator();
    JMenu mStyle = new JMenu("Style");
    mStyle.setMnemonic('s');
    mFormat.add(mStyle);
    item = new JMenuItem("Update");
    item.setMnemonic('u');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    String name = (String)m_cbStyles.getSelectedItem();
    Style style = m_doc.getStyle(name);
    int p = m_monitor.getCaretPosition();
    AttributeSet a = m_doc.getCharacterElement(p).
    getAttributes();
    style.addAttributes(a);
    m_monitor.repaint();
    item.addActionListener(lst);
    mStyle.add(item);
    item = new JMenuItem("Reapply");
    item.setMnemonic('r');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    String name = (String)m_cbStyles.getSelectedItem();
    Style style = m_doc.getStyle(name);
    setAttributeSet(style);
    item.addActionListener(lst);
    mStyle.add(item);
    mFormat.addSeparator();
    m_foreground = new ColorMenu("Selection Foreground");
    m_foreground.setColor(m_monitor.getForeground());
    m_foreground.setMnemonic('f');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setForeground(attr, m_foreground.getColor());
    setAttributeSet(attr);
    m_foreground.addActionListener(lst);
    mFormat.add(m_foreground);
    MenuListener ml = new MenuListener() {
    public void menuSelected(MenuEvent e) {
    int p = m_monitor.getCaretPosition();
    AttributeSet a = m_doc.getCharacterElement(p).
    getAttributes();
    Color c = StyleConstants.getForeground(a);
    m_foreground.setColor(c);
    public void menuDeselected(MenuEvent e) {}
    public void menuCanceled(MenuEvent e) {}
    m_foreground.addMenuListener(ml);
    // Bug Alert! JEditorPane background color
    // doesn't work as of Java 2 FCS.
    m_background = new ColorMenu("Selection Background");
    m_background.setColor(m_monitor.getBackground());
    m_background.setMnemonic('b');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setBackground(attr, m_background.getColor());
    setAttributeSet(attr);
    m_background.addActionListener(lst);
    mFormat.add(m_background);
    ml = new MenuListener() {
    public void menuSelected(MenuEvent e) {
    int p = m_monitor.getCaretPosition();
    AttributeSet a = m_doc.getCharacterElement(p).
    getAttributes();
    Color c = StyleConstants.getBackground(a);
    m_background.setColor(c);
    public void menuDeselected(MenuEvent e) {}
    public void menuCanceled(MenuEvent e) {}
    m_background.addMenuListener(ml);
    // Bug Alert! Images do not get saved.
    mFormat.addSeparator();
    item = new JMenuItem("Insert Image");
    item.setMnemonic('i');
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    m_chooser.addChoosableFileFilter(m_gifFilter);
    m_chooser.addChoosableFileFilter(m_jpgFilter);
    m_chooser.setFileFilter(m_gifFilter);
    m_chooser.removeChoosableFileFilter(m_rtfFilter);
    Thread runner = new Thread() {
    public void run() {
    if (m_chooser.showOpenDialog(WordProcessor.this) !=
    JFileChooser.APPROVE_OPTION)
    return;
    WordProcessor.this.repaint();
    File fChoosen = m_chooser.getSelectedFile();
    ImageIcon icon = new ImageIcon(fChoosen.getPath());
    int w = icon.getIconWidth();
    int h = icon.getIconHeight();
    if (w<=0 || h<=0) {
    JOptionPane.showMessageDialog(WordProcessor.this,
    "Error reading image file\n"+
    fChoosen.getPath(), "Warning",
    JOptionPane.WARNING_MESSAGE);
    return;
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setIcon(attr, icon);
    int p = m_monitor.getCaretPosition();
    try {
    m_doc.insertString(p, " ", attr);
    catch (BadLocationException ex) {}
    // Its ok to do this outside of the event-dispatching
    // thread because the chooser is not visible here.
    m_chooser.addChoosableFileFilter(m_rtfFilter);
    m_chooser.setFileFilter(m_rtfFilter);
    m_chooser.removeChoosableFileFilter(m_gifFilter);
    m_chooser.removeChoosableFileFilter(m_jpgFilter);
    runner.start();
    item.addActionListener(lst);
    mFormat.add(item);
    menuBar.add(mFormat);
    m_toolBar.addSeparator();
    m_cbStyles = new JComboBox();
    m_cbStyles.setMaximumSize(m_cbStyles.getPreferredSize());
    m_cbStyles.setEditable(true);
    m_toolBar.add(m_cbStyles);
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (m_skipUpdate || m_cbStyles.getItemCount()==0)
    return;
    String name = (String)m_cbStyles.getSelectedItem();
    int index = m_cbStyles.getSelectedIndex();
    int p = m_monitor.getCaretPosition();
    // New name entered
    if (index == -1) {
    m_cbStyles.addItem(name);
    Style style = m_doc.addStyle(name, null);
    AttributeSet a = m_doc.getCharacterElement(p).
    getAttributes();
    style.addAttributes(a);
    return;
    // Apply the selected style
    Style currStyle = m_doc.getLogicalStyle(p);
    if (!currStyle.getName().equals(name)) {
    Style style = m_doc.getStyle(name);
    setAttributeSet(style);
    m_cbStyles.addActionListener(lst);
    JMenu mTools = new JMenu("Tools");
    mTools.setMnemonic('t');
    Action spellAction = new AbstractAction("Print...",
    new ImageIcon("tools_abc.gif"))
    public void actionPerformed(ActionEvent e) {
    SpellChecker checker = new SpellChecker(WordProcessor.this);
    WordProcessor.this.setCursor(Cursor.getPredefinedCursor(
    Cursor.WAIT_CURSOR));
    checker.start();
    item = mTools.add(spellAction);
    item.setMnemonic('s');
    item.setAccelerator(KeyStroke.getKeyStroke(
    KeyEvent.VK_F7, 0));
    menuBar.add(mTools);
    m_toolBar.addSeparator();
    m_toolBar.add(new SmallButton(spellAction,
    "Spell checker"));
    getContentPane().add(m_toolBar, BorderLayout.NORTH);
    return menuBar;
    protected void showAttributes(int p) {
    m_skipUpdate = true;
    AttributeSet a = m_doc.getCharacterElement(p).
    getAttributes();
    String name = StyleConstants.getFontFamily(a);
    if (!m_fontName.equals(name)) {
    m_fontName = name;
    m_cbFonts.setSelectedItem(name);
    int size = StyleConstants.getFontSize(a);
    if (m_fontSize != size) {
    m_fontSize = size;
    m_cbSizes.setSelectedItem(Integer.toString(m_fontSize));
    boolean bold = StyleConstants.isBold(a);
    if (bold != m_bBold.isSelected())
    m_bBold.setSelected(bold);
    boolean italic = StyleConstants.isItalic(a);
    if (italic != m_bItalic.isSelected())
    m_bItalic.setSelected(italic);
    Style style = m_doc.getLogicalStyle(p);
    name = style.getName();
    m_cbStyles.setSelectedItem(name);
    if (m_styles!=null && m_styles.get(name)==null) {
    style = m_doc.addStyle(name, null);
    a = m_doc.getCharacterElement(p).getAttributes();
    style.addAttributes(a);
    m_styles.put(name, style);
    m_skipUpdate = false;
    protected void setAttributeSet(AttributeSet attr) {
    setAttributeSet(attr, false);
    protected void setAttributeSet(AttributeSet attr,
    boolean setParagraphAttributes)
    if (m_skipUpdate)
    return;
    int xStart = m_monitor.getSelectionStart();
    int xFinish = m_monitor.getSelectionEnd();
    if (!m_monitor.hasFocus()) {
    xStart = m_xStart;
    xFinish = m_xFinish;
    if (setParagraphAttributes)
    m_doc.setParagraphAttributes(xStart,
    xFinish - xStart, attr, false);
    else if (xStart != xFinish)
    m_doc.setCharacterAttributes(xStart,
    xFinish - xStart, attr, false);
    else {
    MutableAttributeSet inputAttributes =
    m_kit.getInputAttributes();
    inputAttributes.addAttributes(attr);
    protected void showStyles() {
    m_skipUpdate = true;
    if (m_cbStyles.getItemCount() > 0)
    m_cbStyles.removeAllItems();
    Enumeration en = m_doc.getStyleNames();
    while (en.hasMoreElements()) {
    String str = en.nextElement().toString();
    m_cbStyles.addItem(str);
    m_styles = new Hashtable();
    m_skipUpdate = false;
    protected void updateUndo() {
    if(m_undo.canUndo()) {
    m_undoAction.setEnabled(true);
    m_undoAction.putValue(Action.NAME,
    m_undo.getUndoPresentationName());
    else {
    m_undoAction.setEnabled(false);
    m_undoAction.putValue(Action.NAME, "Undo");
    if(m_undo.canRedo()) {
    m_redoAction.setEnabled(true);
    m_redoAction.putValue(Action.NAME,
    m_undo.getRedoPresentationName());
    else {
    m_redoAction.setEnabled(false);
    m_redoAction.putValue(Action.NAME, "Redo");
    public Document getDocument() { return m_doc; }
    public JTextPane getTextPane() { return m_monitor; }
    public void setSelection(int xStart, int xFinish, boolean moveUp) {
    if (moveUp) {
    m_monitor.setCaretPosition(xFinish);
    m_monitor.moveCaretPosition(xStart);
    else
    m_monitor.select(xStart, xFinish);
    m_xStart = m_monitor.getSelectionStart();
    m_xFinish = m_monitor.getSelectionEnd();
    public static void main(String argv[]) {
    new WordProcessor();
    class Undoer implements UndoableEditListener
    public Undoer() {
    m_undo.die();
    updateUndo();
    public void undoableEditHappened(UndoableEditEvent e) {
    UndoableEdit edit = e.getEdit();
    m_undo.addEdit(e.getEdit());
    updateUndo();
    // Class SmallButton unchanged from section 4.8
    class SmallButton extends JButton implements MouseListener
    protected Border m_raised;
    protected Border m_lowered;
    protected Border m_inactive;
    public SmallButton(Action act, String tip) {
    super((Icon)act.getValue(Action.SMALL_ICON));
    m_raised = new BevelBorder(BevelBorder.RAISED);
    m_lowered = new BevelBorder(BevelBorder.LOWERED);
    m_inactive = new EmptyBorder(2, 2, 2, 2);
    setBorder(m_inactive);
    setMargin(new Insets(1,1,1,1));
    setToolTipText(tip);
    addActionListener(act);
    addMouseListener(this);
    setRequestFocusEnabled(false);
    public float getAlignmentY() { return 0.5f; }
    public void mousePressed(MouseEvent e) {
    setBorder(m_lowered);
    public void mouseReleased(MouseEvent e) {
    setBorder(m_inactive);
    public void mouseClicked(MouseEvent e) {}
    public void mouseEntered(MouseEvent e) {
    setBorder(m_raised);
    public void mouseExited(MouseEvent e) {
    setBorder(m_inactive);
    // Class SimpleFilter unchanged from section 14.1.9
    class SimpleFilter extends javax.swing.filechooser.FileFilter
    private String m_description = null;
    private String m_extension = null;
    public SimpleFilter(String extension, String description) {
    m_description = description;
    m_extension = "."+extension.toLowerCase();
    public String getDescription() {
    return m_description;
    public boolean accept(File f) {
    if (f == null)
    return false;
    if (f.isDirectory())
    return true;
    return f.getName().toLowerCase().endsWith(m_extension);
    // Class SmallToggleButton unchanged from section 4.8
    class SmallToggleButton extends JToggleButton implements ItemListener
    protected Border m_raised;
    protected Border m_lowered;
    public SmallToggleButton(boolean selected, ImageIcon imgUnselected,
    ImageIcon imgSelected, String tip)
    super(imgUnselected, selected);
    setHorizontalAlignment(CENTER);
    setBorderPainted(true);
    m_raised = new BevelBorder(BevelBorder.RAISED);
    m_lowered = new BevelBorder(BevelBorder.LOWERED);
    setBorder(selected ? m_lowered : m_raised);
    setMargin(new Insets(1,1,1,1));
    setToolTipText(tip);
    setRequestFocusEnabled(false);
    setSelectedIcon(imgSelected);
    addItemListener(this);
    public float getAlignmentY() { return 0.5f; }
    public void itemStateChanged(ItemEvent e) {
    setBorder(isSelected() ? m_lowered : m_raised);
    // Class ColorMenu unchanged from section 12.5
    class ColorMenu extends JMenu
    protected Border m_unselectedBorder;
    protected Border m_selectedBorder;
    protected Border m_activeBorder;
    protected Hashtable m_panes;
    protected ColorPane m_selected;
    public ColorMenu(

    Sorry about that...newbie here....
    Here we go.....what im having trouble doing is inserting this print dialog into my menu
    Here is the print snippet
    public void print()
            new TimerTestDialog(this);
        class TimerTestDialog extends JDialog
            TimerTestDialog(Frame parent)
                super(parent);
                setLocationRelativeTo(parent);
                setupDialog();
                setModal(false);    // this will allow you to do still stuff with the main frame
                                         //The popup window in this case is not modal. This means that the
                                         //user isnt required to respond to the popup before the program continues running
                 * sorry, using a Timer instead of your original TimerTask - it's simpler
                Timer t = new Timer(2000, ticker);
                t.start();
            private void setupDialog()
                Container c = getContentPane();
                c.setLayout(new BorderLayout());
                c.add(getDisplayPanel(), BorderLayout.CENTER);
                c.add(getButtonPanel(), BorderLayout.SOUTH);
                setSize(300, 150);
                setVisible(true);
            private Component getDisplayPanel()
                label = new JLabel("---", JLabel.CENTER);
                label.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
                JPanel panel = new JPanel(new BorderLayout());
                panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
                JPanel backing = new JPanel(new BorderLayout());
                backing.add(label, BorderLayout.NORTH);     // this will ensure the label doesn't go all tall
                panel.add(backing, BorderLayout.CENTER);
                return panel;
            private Component getButtonPanel()
                JPanel panel = new JPanel(new BorderLayout());
                panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
                JPanel backing = new JPanel(new BorderLayout());
                JButton closeButton = new JButton("Close");
                closeButton.addActionListener(new ActionListener()
                    public void actionPerformed(ActionEvent e)
                        dispose();
                backing.add(closeButton, BorderLayout.CENTER);
                panel.add(backing, BorderLayout.LINE_END);
                return panel;
            private ActionListener ticker = new ActionListener()
                public void actionPerformed(ActionEvent e)
                    label.setText(String.valueOf(getRandomNumber()));
            private int getRandomNumber()
                return r.nextInt(1000) + 1;       // shift from 0-9 to 1-1000
            private JLabel label;
         * NOTE - this is the best way to use random stuff in java.  if you use instance members
         * you can sometimes get the same result each time.  not really sure how that works but
         * i've seen it happen
        private static Random r = new Random();
    Here is my menu code
    Action actionPrint = new AbstractAction("Print...", iconPrint) {
          public void actionPerformed(ActionEvent e) {
            WordProcessor.this.setCursor(
              Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            Thread runner = new Thread() {
              public void run() {
              //this is where I want to put the print function, so when the user click on print the print dialog box will appear

Maybe you are looking for

  • Invoice tables / AP documents

    i'm doing some sap analysis on AP and am trying to recreate the vendor history within sap i.e. understand the AP tables. - rseg and rbkp (these seem to have invoice / invoice receipt document types mainly document types starting with R) This table do

  • Deferred Tax:Post invoice and clearing of open payment seperately $

    Hi Team, User not able to clear the vendor Through F-44 Down payment was done at 2013 and Invoice is generated at 2014 . now user trying to clear thevendor through F-44 .When he is trying to clear the vendor system throwing error message stating that

  • Batch processing in MPEG Streamclip

    I have been given over 200 MPEG-1 clips with muxed audio to make a movie in iMovie. Dragging them right in will remove the audio, so I need to convert them to DV-PAL first I tried MPEG Streamclip 1.8 and 1.9b2. The manual implies that I in "Batch Lis

  • Critical Battery Suspends Incorrectly

    I'm using gnome-power-manager, and my computer suspends wonderfully. I'm not sure which method I'm using since I tried both and I cannot recall what I did on my last effort to get suspend/hibernate to work. However, after my laptop suspends for being

  • PDF with Tomcat - failing with isHexDigit conversion

    Hi I've built a small report writer with printed output using Tomcat. All works fine until a '%' is used in a parameter in the report. I then get a Tomcat Error 2007/05/22 06:57:36 org.apache.tomcat.util.http.Parameters processParameters WARNING: Par