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

Similar Messages

  • How to change PrinterJob.printDialog(..)'s dialog's language?

    Hey!
    I'm using PrinterJob.printDialog(attributes)-method for printing. How do I change the language on the printing dialog? Is there an attribute that does the trick or does it have something to do with Windows' settings?
    Cheers,
    Antti

    Do you want get rich easily?
    You can change life, you can have money as much as you want. All you have to do is to send 12 dollars to 6 people bank accounts.
    All you have to do is the fallowing:
    You have to have bank account. You have to send 2 $ to below listed bank accounts. This is legal, you made a favour for those people and for your self.
    This is the bank accounts:
    1. LT957300010074515201
    2. LT217044000017612013
    3. LT547400012388523830
    4. LT857044000879616105
    5. LT577300010085485906
    6. LT837300010088377105
    After sending money, you need to delete the first bank account and make room for your account, after deleting first account, in the bottom of the list write your accounts number. You have to delete only the first one. Very important to do it honestly.

  • Problems with printdialog in linux

    I am creating an application under Ubuntu that will be able to print. But when I use the printDialog the program throws an exception under Ubuntu. But it works when I run the application under Windows 2000.
    It works in both OS:s if I don't use printDialog.
    Does anyone know what's wrong? Does linux os:s need extra treatment?
    I get the following error under Ubuntu:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: null attribute
    at sun.print.IPPPrintService.isAttributeValueSupported(IPPPrintService.java:1147)
    at sun.print.ServiceDialog$OrientationPanel.updateInfo(ServiceDialog.java:2121)
    at sun.print.ServiceDialog$PageSetupPanel.updateInfo(ServiceDialog.java:1263)
    at sun.print.ServiceDialog.updatePanels(ServiceDialog.java:437)
    at sun.print.ServiceDialog.initPrintDialog(ServiceDialog.java:195)
    at sun.print.ServiceDialog.<init>(ServiceDialog.java:124)
    at javax.print.ServiceUI.printDialog(ServiceUI.java:188)
    at sun.print.RasterPrinterJob.printDialog(RasterPrinterJob.java:855)
    at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:421)
    at coverprinter.CoverToPrint.execute(CoverToPrint.java:23)
    at coverprinter.CoverPrinterUI.jButtonPrintMouseClicked(CoverPrinterUI.java:108)
    at coverprinter.CoverPrinterUI.access$000(CoverPrinterUI.java:8)
    at coverprinter.CoverPrinterUI$1.mouseClicked(CoverPrinterUI.java:37)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
    at java.awt.Component.processMouseEvent(Component.java:6041)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4410)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2429)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

    Hi J�rg,
    Thanks for your reply.
    I wrote a standalone version simulating the problem I have and -- guess what -- it worked fine.
    The only feasible difference between the two programs is that for the demo program I coded the layout and placement of the components myself, whereas with the problem code, I used IntelliJ's GUI builder, which uses its own layout manager. This must have something to do with the problem.
    However, I have managed to botch a fix -- first I set the JSpinners' values to 0, THEN set them to the random numbers. Weird, but works.
    Thanks again, though.
    Regards.

  • Crystal Report XI (R2) - PrintDialog

    Hi,
    We are using Crystal Reports XI (R2)
    This is our current setup
    To print direct to the Printer we use the PrintToPrinter method of a Crystal Report. We do not view this in the Viewer object.
    It works perfect for passing the parameter, Copies, Collation, PageStart,PageEnd into this function.
    We have adapted a standard Microsoft.NET PrintDialog object so that we pull the Copies, PageStart and PrinterName from this object and set in as in below code
    Dim printDialog1 As New System.Windows.Forms.PrintDialog
       If printDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                    'Get the Copy times
                    Dim intCopy As Int16 = printDialog1.PrinterSettings.Copies
                    'Get the number of Start Page
                    Dim intFromPage As Int16 = printDialog1.PrinterSettings.FromPage
                    'Get the number of End Page
                    Dim intToPage As Int16 = printDialog1.PrinterSettings.ToPage
                    'Get the printer name
                    crReportDocument.PrintOptions.PrinterName = printDialog1.PrinterSettings.PrinterName
                    crReportDocument.PrintToPrinter(intCopy, True, intFromPage, intToPage)
    End if
    The problem with this is the user thinks they can change all other properties show in this PrintDialog window, but yet it'll do nothing with the Crystal Printoff. (Except PrinterName, Copies etc.)
    Guess my question is, Is there an inherent PrintDialog form associated with the Crystal Report and PrintToPrinter method. I need to get a PrintDialog form to the user when they want to print without viewing, but not the one above, as all the properties can't be passed to the PrintToPrinter method?
    You help and advice would be most appreciated!!
    Stuart

    Hello Stuart.
    I know exactly what you are looking for. Many are looking for the same thing. Unfortunately, no such PrintDialog form from CR. (there used to be with the old RDC, but not with the .NET SDK). Perhaps a future version of CR... Unfortunately, your only option is to build your own form from scratch and offer the users only the print properties you want them to be able to set.
    Now, you should also be able to set paper source, paper size, printer duplex, margins and a few more properties, but depending on the printer driver, not all properties can be set.
    Ludek

  • Hide Acrobat When/After  Printing PDF with printdialog

    In Acrobat 8.0, using VB.NET while printing a PDF file with printdialog , acrobat window shows and does not close after printing.
    This behavior was not present with previous versions. Are there any commands that does not show the viewer using printdialog.
    Your comments would be highly appreciated
    Thanks in advance
    Kelvin

    > If you look through this entire thread you will see that the conditions you are having is not the same as many of us here.
    I understand that. What you want to achieve can be simply done with Acrobat, but when limited to only the Reader ActiveX control there are limitations. You have to work within the bounds of what the control can provide.
    > However having an empty window open up that the user must close has been something new for most of us since version 8.
    It is new in version 8, yes. This was done for security reasons. The reason being the possibility of malicious software being developed. I don't want to give anybody ideas for a malicious application on a public forum, but if you want a full explanation personally I would be happy to contact you.
    At least this way the user knows what's happening, and your average Joe who doesn't know about task manager can still right-click in the taskbar and close Reader to solve the problem. It balances worldwide user security against a small usability feature for Acrobat SDK application developers that are limited to only developing for Reader and yet again only when using silent printing. As I'm sure you can appreciate and understand, worldwide security won that battle - Reader is a secure product and its intention is to stay that way.
    Is it a nuisance? Yes, a very minor one in most cases. However, there are workarounds. If you're developing with VB, what is stopping you from moving the window offscreen during print, monitoring the print queue, and terminating the Reader thread when it is done spooling? It is extra work for the developer, yes - but the fact is, security has to be at the forefront and it is unfortunate that you as the application developer have to do extra work in order to maintain the high level of security expected by Reader users.
    If you have suggestions for a secure alternative approach, I am honestly glad to hear them if you care to discuss them.

  • Set location of PrintDialog

    Hi ~ I am looking for an easy method to center the print dialog on the parent window that calls it - ideas?
    Lena

    What is for U a PrintDialog ???
    I seek the SDK javadoc, but can't find this class !!!
    But if this is a swing class AND you are using JRE 1.4.X, I suggest you to try printDialog.setLocationRelativeTo(parent)Hope this help.

  • Printing problem with ServiceUI.printDialog

    Hi,
    We use the IcePDF component from IceSoft to render and print our pdf files. In most of the cases, we configure the page settings in the code before we send the document to the printer, but there is one case that we need to let the user choose the printer and change some settings. In this case, we show the dialog box using the ServiceUI.printDialog but there is a problem when the user accepts the defaults (Chromaticity = Color) without change this property, it doesn't take effect and the property that is used is the printer's default.
    Thanks in advance!

    Um I dont know if im doing something daft but I tried this like you said
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if(printJob.printDialog()){
    try {
              PageFormat pageFormat = printJob.defaultPage();
              if (pageFormat.getOrientation() == PageFormat.PORTRAIT) {
              landscape = 0;} else {
                   landscape = 1;}
              System.out.println("THE ORIENTATION IS "+ landscape);
              printJob.print(); }
    catch (Exception PrinterExeption) { PrinterExeption.printStackTrace();}
    and it doesnt seem to work as I tried it both as landscape and portrait in the print dialog but landscape is always 0.
    cheers
    pmiggy

  • HELP !!! How to access to printDialog properties ?

    I really need help !!! I have to know how I can access to the printDialog of the PrinterJob class to set the printer by code. I searched nearly everywhere but have never found the way... Should I try by using an AttributeSet in which I may specify a PrinterName attribute or has someone a different and easier way to choose the printer by code ?
    Thanks for answering !!

    You can use PrintRequestAttributeSet to set the printDialog properties.
    eg :
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(new JobName("My Application", null));
    aset.add(OrientationRequested.LANDSCAPE);
    aset.add(new MediaPrintableArea(0.5f,0.5f,7.5f,10.0f,MediaPrintableArea.INCH);
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(component);
    if(printJob.printDialog(aset))
    printJob.print(aset);
    }

  • PrintDialog tabs

    Hello all,
    I was exploring the Java Print tutorial trail. I began with HelloWorldPrinter.java, the print dialog displays 3 tabs: General, Page Setup, Appearance. On the General tab, the button with label "Properties" is disabled. On the Apperance tab, the radio button group titled "Color Appearance" has 2 radio buttons: Monochrome (disabled), Color (enabled, this is weird because my printer is not a color printer); another radio button group tittled "Quality" has 3 radio buttons: Draft, Normal, High (all disalbed).
    Why are those buttons diabled, how can one enable them?
    Thank you for your help!
    My JDK version is 1.5.0_06 running on RedHat linux. Below is the code listing of the HelloWordPrinter.java:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class HelloWorldPrinter implements Printable, ActionListener {
        public int print(Graphics g, PageFormat pf, int page) throws
                                                            PrinterException {
            if (page > 0) { /* We have only one page, and 'page' is zero-based */
                return NO_SUCH_PAGE;
            /* User (0,0) is typically outside the imageable area, so we must
             * translate by the X and Y values in the PageFormat to avoid clipping
            Graphics2D g2d = (Graphics2D)g;
            g2d.translate(pf.getImageableX(), pf.getImageableY());
            /* Now we perform our rendering */
            g.drawString("Hello world!", 100, 100);
            /* tell the caller that this page is part of the printed document */
            return PAGE_EXISTS;
        public void actionPerformed(ActionEvent e) {
             PrinterJob job = PrinterJob.getPrinterJob();
             job.setPrintable(this);
             boolean ok = job.printDialog();
             if (ok) {
                 try {
                      job.print();
                 } catch (PrinterException ex) {
                  /* The job did not successfully complete */
        public static void main(String args[]) {
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            JFrame f = new JFrame("Hello World Printer");
            f.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {System.exit(0);}
            JButton printButton = new JButton("Print Hello World");
            printButton.addActionListener(new HelloWorldPrinter());
            f.add("Center", printButton);
            f.pack();
            f.setVisible(true);
    }

    those buttons you've mentioned will be enabled/disabled depending on the selected Print Service (in the General Tab). Try changing you selection and see how they behave.
    ;o)
    V.V.

  • Printerjob.printDialog() Locale

    Hiyas
    How can I set the locale that is used to display the strings int he printDialog()? The dialog always pops up in german, but I need to display it in the currently set locale, however, I don't know where to set the locale. Of course, if there isn't a translation for the desired locale, a default locale can be used, but I would imagine that, in a non-modified JRE, the english language shpould always be supported. In my case it isnt.
    ANyone?

    You could use Locale.setDefault() static method.

  • Retrieve user defined MediaSizeName without printDialog

    Hi,
    to use a label printer (Brother P-touch 2420PC), it is necessary to define an individual Format (=MediaSizeName), which is done once outside Java via Windows Printer Property UI.
    In my Java application I now need to set this MediaSizeName. How to I retrieve the available MediaSizeNames without invoking printDialog or pageDialog?
    (MediaSize.findMedia will find static Java formats, not user defined formats)
    Christoph

    I'm hoping this is a classroom assignment. Otherwise, exception handlers that just call DBMS_OUTPUT.PUT_LINE would be very much frowned upon.
    If you declare a local variable that counts the number of iterations, you can code something like this
    DECLARE
      l_cnt PLS_INTEGER := 0;
    BEGIN
      FOR x IN (<<your SELECT statement>>)
      LOOP
        l_cnt := l_cnt + 1;
        dbms_output.put_line( ... );
      END LOOP;
      IF( l_cnt = 0 )
      THEN
        RAISE e_no_rows
      END IF;
    EXCEPTION
    END;Justin

  • PrintDialog with applet

    Hi,
    I want to open print dialog on the client ,
    Therefore I wrote an applet , but it opens printDialog on the server.
    Any idea ?
    thanks

    Where did u put the print dialog code ??
    If you put the Print dialog code in the applet then the dialog box should come up on the client side.
    if (printJob.printDialog()) {
         printJob.print(pras);
                   }

  • How to hide the table gris in AW6, wordprocessor

    For the life of me I can't work out how to do this. I've created a flier using different table fields to contain various fields of text & graphics. Now I come to print the page, I can't get rid of the layout lines, by which I mean the lines of the table. I assumed they could just be switched off.
    Can anyone suggest how to do this? The option seems to exist in other AW packages but not Word Processor.
    Or: Which application should I have done this in? Is there an equivalent of MS publisher?

    It can be done, but not as easily as I would think. I created a small table in an AppleWorks word processing document to experiment with. I could not select more than one line at a time, although I'm sure I've done it before. I have the table as a floating object & have selected the second line (it's now dashed). I have now selected "none" for line width & then clicking elsewhere in or outside of the table will show the line is now invisible.

  • Fonts in Wordprocessor

    Hi,
    I have decided to give Appleworks a go for my wordprocesing. Up to now I've been using Word on a PC.
    I have imported all my fonts from my collection on my PC and manage them with Font Book. However I'm having a few issues:
    1/ I have 'Show actual fonts in menu' checked. Some fonts do not display in their font.
    2/ Some font names are there that I have turned off in Font Book. I've checked and they are not listed in Photoshop's font list.
    Some report as .dfont, some as .TTF and some with no suffix when I select Validate Font. All were checked by Font Book when I imported them and were reported as 'safe to use'.
    Any ideas why I get this problem?

    Heh! I can see I'm late to the party. Most of the questions have already been answered. But to respond to, "My computer should not be functioning!". It definitely wouldn't be if LucidaGrande.dfont were missing. Your Mac would neither boot or be usable without it. You had to have been looking in the wrong folder. There are three main Fonts folders in OS X:
    /System/Library/Fonts/
    /Library/Fonts/
    ~/Library/Fonts/ (the ~ indicates your home folder)
    To answer a couple of other questions, there is no reason you can't remove .dfonts you aren't using, or the system doesn't need. All of the fonts in the /Library/Fonts folder installed by OS X are simply a varied choice of type faces for you to use. None are needed by the OS. Just because it's a .dfont doesn't mean it can't be removed.
    These are the only fonts I have in my /System/Library/Fonts/ folder:
    AppleGothic.dfont
    Geneva.dfont
    Keyboard.dfont
    LastResort.dfont
    LucidaGrande.dfont
    Monaco.dfont
    And these are all I have in the /Library/Fonts/ folder:
    Arial
    Arial Black
    Courier (Type 1 PostScript set)
    Helvetica (Type 1 PostScript set)
    Tahoma
    Times (Type 1 PostScript set)
    Times New Roman
    Trebuchet MS
    Verdana
    Webdings
    Wingdings
    Note that I replaced the .dfont version of three type faces since I must use PostScript versions for prepress. The rest are minimal fonts for MS Office and so the majority of web pages display the way they should (Arial and Verdana in particular get used a lot).
    As far as the Asian fonts. Well, you can see I have none of them. What would I need those for? I can't read any of those languages, so what good are they to me? I've been running my system this way since Panther came out, and now with Tiger. I have zero problems using any applications. And I've got a lot.
    Of course, none of this means you have to mimic my setup. My FAQ is intended for those who want to, or need to get their Macs down to minimal font usage. Mainly for the purpose, like me, to make font conflicts a rarity. It also speeds up the system. The less fonts you have loaded, the less resources used by the system.

  • Get no printdialog in iPhoto 08

    Hallo together
    i have MacBook Pro 2.00. When I use the iPhoto print dialog the Button just flashes one time and nothing happens. In all other apps the printing is possible.
    I found differnt postings in the forum but no answer.
    I delete the preferences, delete the package, delete the application, install iPhoto again, install the Printerdriver again and do everything what i have found. Another user do all this to and said that it does not work. There are no more replys after his last posting. I try again. Is there anybody who have a solution for this problem.
    Thanks for you replys.
    Desperate Greetings
    Richard

    Richard:
    Welcome to the Apple Discussions. You've done everything I would have suggested as the first try. Download and run the Mac OS X 10.4.10 Combo Update v1.1 followed by a repair of disk permissions. See if that will help.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

Maybe you are looking for

  • I'm really starting to hate my ipod touch and it's apps problem

    I have the 3rd gen Ipod Touch. I have the most up to date software. I have had it a little over 2 weeks and have had to wipe everything off at least 8 times because the apps stop working. It usually happens after a sync so I turn auto-sync off but it

  • How to handle multiple requests to the same servlet at one time?

    Hi, I am new to Servlets. I have doubt regarding ... Handling multiple requests to a servlet at a time. If we send a single request to a servlet, as know that group of objects such as servlet, servletContext, servletConfig, request, response and etc

  • 2nd HDD that doesn't refresh

    Hello, I have a SSD in my main MBP bay and a HDD in the optical bay. Sometimes, it looks like my MBP lose the connection to the HDD. The drive is there but when I look at folders from Finder, I get endless spinning wheel at the bottom right of the fi

  • Refund of $100 request {Removed per Forum Guidelines​}

    To whom it may concern, On Monday 11/24 I placed the following order from bestbuy.com after receiving an email for Black Friday early access: Order number: {Removed per Forum Guidelines} Apple® MacBook® Pro Intel Core i5 13334 Display 4GB Memory 500G

  • Limit the matnr matchcode in MMBE (4.7)

    I've been researching this and I'm not finding useful answers. We have a client which uses release 4.7, and has requested that we limit the F4 help for MATNR in transaction MMBE. MMBE uses the logical database MSM, and in it's selection screen it use