Messagebox that displays a different randum number every 2 secs

well im having trouble with putting a messagebox that displays a different randum number every 2 secs and closes with a close button. it goes in the print menu option of this simple text editor,you shoud also be able to work in the background while this message box is been displayed.
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.rtf.*;
import javax.swing.event.*;
import javax.swing.filechooser.*;
import javax.swing.undo.*;
import java.util.Timer;
import java.util.TimerTask;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import java.beans.*;
  -------------------| Simple Text Editor example application using Java 1.3 with Swing |--------------
public class SimpleTextEditor extends JFrame
        private JTextPane textpane;
        private JMenuBar mb;
        private JFileChooser chooser,picChooser;
        private Hashtable actions;
        private JPopupMenu popup;
        private JMenuItem exit, newDoc, save, open, saveAs,print;
        private About ab;
        private StyledEditorKit edkit;
        private RTFEditorKit rtfkit;
        private DefaultStyledDocument doc;
        private MyDocumentListener doclistener;
       private MyUndoableEditListener undolistener;
         //Useful variables
        private String filename="untitled1.txt",filetype=".txt";
        private File thisfile;
        protected String FileFormats[],FileDescriptions[],PicFileFormats[],PicFileDescriptions[];
        protected boolean DocumentIsUnedited=true, DocumentIsSaved=false;
        public static int SQUARE=0,TRIANGLE=1,CIRCLE=2;
        public String newline="\n";
        protected UndoManager undo ;
        protected UndoAction undoAction;
        protected RedoAction redoAction;
        // These are the actions used in the menus and on the toolbar
        protected Action bold, italic, underline, alignleft, alignright, aligncentre;
        protected Action spellchecker, alignjustify, more, cut, copy, paste, tools[];
        public SimpleTextEditor()
                super("SimpleTextEditor - untitled1.rtf");
                this.setLocation(200,200);
                this.setIconImage(getMyIcon("Icon.gif").getImage());
                getContentPane().setLayout(new BorderLayout());
                undo = new UndoManager();
                //Set up the file formats and file choosers etc
                FileFormats = new String[]{".rtf",".txt",".java",".bat"};
                FileDescriptions = new String[]{"Rich Text Format Files","Text Files","Java Source Files","DOS Batch Files"};
                PicFileFormats = new String[]{".gif",".bmp",".jpg"};
                PicFileDescriptions = new String[]{"Gif Images","Bitmap Images","JPEG Images"};
                chooser = new JFileChooser();
                picChooser = new JFileChooser();
                picChooser.setAccessory(new ImagePreview(picChooser));
                javax.swing.filechooser.FileFilter defaultFilter = new SimpleFilter(FileFormats[0],FileDescriptions[0]);
                javax.swing.filechooser.FileFilter defaultPicFilter = new SimpleFilter(PicFileFormats[0],PicFileDescriptions[0]);
                for(int i=1;i<FileFormats.length;i++){
                        chooser.addChoosableFileFilter(new SimpleFilter(FileFormats,FileDescriptions[i]));
for(int i=1;i<PicFileFormats.length;i++){
picChooser.addChoosableFileFilter(new SimpleFilter(PicFileFormats[i],PicFileDescriptions[i]));
chooser.setFileFilter(defaultFilter);
picChooser.setFileFilter(defaultPicFilter);
File working = new File("C:/Documents");
if(!working.exists()){
working= new File("C:/MyDocuments");
if(!working.exists()) working = new File("C:/");
if(working.exists()) {
chooser.setCurrentDirectory(working);
picChooser.setCurrentDirectory(working);
// Set up Document object and Editor kits
doc = new DefaultStyledDocument();
edkit = new StyledEditorKit();
rtfkit = new RTFEditorKit();
// Set up Listener objects
doclistener= new MyDocumentListener();
undolistener= new MyUndoableEditListener();
doc.addDocumentListener(doclistener);
doc.addUndoableEditListener(undolistener);
//Set up main GUI content
textpane=new JTextPane(doc);
textpane.setPreferredSize(new Dimension(400,400));
textpane.setMinimumSize(new Dimension(400,400));
JScrollPane scroller=new JScrollPane(textpane);
scroller.setPreferredSize(new Dimension(400,400));
mb=new JMenuBar(); // Create a menu bar
JMenu File=new JMenu("File");
JMenu Help=new JMenu("Help");
//Sort out Actions etc
createActionTable(textpane);
createToolbarActions();
JMenu Style=createStyleMenu();
undoAction = new UndoAction();
redoAction = new RedoAction();
//Create Style, Edit and Format menus + Toolbar
JMenu Edit=createEditMenu();
JMenu Format=createFormatMenu();
JMenu Insert = createInsertMenu();
JToolBar toolbar = createToolbar();
getContentPane().add("North",toolbar);
// set up main menu items with ActionListeners
newDoc=new JMenuItem("New");
newDoc.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
newDoc();
exit=new JMenuItem("Exit");
exit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
exit();
print=new JMenuItem("Print");
print.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
print();
save=new JMenuItem("Save");
save.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
save();
saveAs=new JMenuItem("Save As...");
saveAs.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
saveas();
open=new JMenuItem("Open...");
open.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
open();
JMenuItem about=new JMenuItem("About");
about.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
ab=new About(SimpleTextEditor.this);
ab.show();
ab.setLocation(400,300);
// Create the popup menu
popup = createEditMenu().getPopupMenu();
popup.addSeparator();
popup.add(createStyleMenu());
popup.add(createFormatMenu());
textpane.add(popup);
// set up Help and File menus
Help.add(about);
File.add(newDoc);
File.add(open);
File.add(print);
File.add(save);
File.add(saveAs);
File.addSeparator();
File.add(exit);
// add the menus to the menubar
mb.add(File);
mb.add(Edit);
mb.add(Format);
mb.add(Style);
mb.add(Insert);
mb.add(Help);
this.setJMenuBar(mb);
getContentPane().add("Center",scroller);
// Add mouse Listener to the textpane for popup events
textpane.addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent e)
if(e.isPopupTrigger())
popup.show(textpane, e.getX(), e.getY());
e.consume();
public void mouseReleased(MouseEvent e)
if(e.isPopupTrigger())
popup.show(textpane, e.getX(), e.getY());
e.consume();
//-----------------| Main active methods |------------------
public void exit()// Main Exit method
if(DocumentIsUnedited){//Check that document is saved/unedited etc
dispose();
setVisible(false);
System.exit(0);
else{
switch(showNotSavedDialog("Exit")){
case JOptionPane.YES_OPTION: save(); exit(); break;
case JOptionPane.NO_OPTION: DocumentIsUnedited=true;exit();break;
case JOptionPane.CANCEL_OPTION: break;
public void newDoc()//Method to create new documents
if(DocumentIsUnedited){
initDoc();
filename="untitled.txt";
filetype=".txt";
resetTitle();
else
switch(showNotSavedDialog("New Document")){
case JOptionPane.YES_OPTION: save(); newDoc(); break;
case JOptionPane.NO_OPTION: DocumentIsUnedited=true;newDoc();break;
case JOptionPane.CANCEL_OPTION: break;
private void initDoc()// Helper method to initialize a new document
doc = null;
doc = (DefaultStyledDocument)edkit.createDefaultDocument();
doc.addDocumentListener(doclistener);
textpane.setStyledDocument(doc);
public void print()
new TimerTestFrame();
class TimerTestFrame extends JFrame
Timer timer;
TimerTestFrame()
super();
timer = new Timer(true);
TimerTask task = new MessageTimer(TimerTestFrame.this);
timer.schedule(task,2000,2000);
class MessageTimer extends TimerTask
Component parent;
public MessageTimer(Component parent)
this.parent = parent;
public void run()
int randnum = (1 +(int)(Math.random()*10));
JOptionPane.showMessageDialog(parent,""+randnum,"Timer Message",JOptionPane.INFORMATION_MESSAGE);
public void saveas()
int n = chooser.showSaveDialog(this);
if(n==0){
filename=chooser.getSelectedFile().getName();
boolean ext = false;
setFiletype();
thisfile = new File(chooser.getCurrentDirectory(),filename);
DocumentIsSaved=true;
save();
resetTitle();
repaint();
public void save()// Save method. Used by "Save As..." as well
if( DocumentIsSaved)
try
FileOutputStream out = new FileOutputStream(thisfile);
if((filetype.equals(".rtf"))||(filetype.equals(".doc"))){
rtfkit.write(out,doc,0,doc.getLength());
else edkit.write(out,doc,0,doc.getLength());
catch(Exception e)
System.out.println(""+e.getMessage()+"");
DocumentIsUnedited=true;
else saveas();
public void open()// Find a file and read it into the document
if(DocumentIsUnedited){
int n = chooser.showOpenDialog(this); // get the outcome of the dialog
if(n==0){
File file = chooser.getSelectedFile();
filename=chooser.getName(file);
setFiletype();
resetTitle();
initDoc();
try
FileInputStream in= new FileInputStream(file);
if(filetype.equals(".rtf")){
rtfkit.read(in,doc,0);
edkit.read(in,doc,0);
catch(Exception e)
System.out.println(""+e.getMessage()+"");
thisfile= new File(chooser.getCurrentDirectory(),chooser.getSelectedFile().getName());
DocumentIsUnedited=true;
DocumentIsSaved=true;
resetTitle();
repaint();
else
switch(showNotSavedDialog("Open")){
case JOptionPane.YES_OPTION: save(); open(); break;
case JOptionPane.NO_OPTION: DocumentIsUnedited=true; open(); break;
case JOptionPane.CANCEL_OPTION: break;
private void setFiletype()// Helper method to get the filetype of saved/opened documents
filetype=null;
for(int i=0;i<FileFormats.length;i++){
if(filename.toLowerCase().endsWith(FileFormats[i])) filetype = FileFormats[i];
else{
for(i=0;i<filename.length();i++){
if(filename.toLowerCase().charAt(i)=='.')
filetype=filename.substring(i);
if(filetype==null) filetype=".txt";
private void resetTitle()
this.setTitle("SimpleTextEditor - "+filename);
private ImageIcon getMyIcon(String filename){
ImageIcon pic = new ImageIcon("Images/"+filename);
return pic;
private int showNotSavedDialog(String title)// Helper method to create "Save? Yes/No/Cancel" dialogs
int n = JOptionPane.showConfirmDialog(this,"The last document has not been saved. \nDo you want to save it first?",
title,
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
return n;
//-----------------| Listeners and Helper classes |----------------
protected class MyDocumentListener implements DocumentListener
public void insertUpdate(DocumentEvent e) {
SimpleTextEditor.this.DocumentIsUnedited=false;
public void removeUpdate(DocumentEvent e) {
SimpleTextEditor.this.DocumentIsUnedited=false;
public void changedUpdate(DocumentEvent e) {
SimpleTextEditor.this.DocumentIsUnedited=false;
protected class MyUndoableEditListener implements UndoableEditListener {
public void undoableEditHappened(UndoableEditEvent e) {
//Remember the edit and update the menus.
undo.addEdit(e.getEdit());
undoAction.updateUndoState();
redoAction.updateRedoState();
//Helper class for FileFilter, allows a description to be assigned to a filetype
protected class SimpleFilter extends javax.swing.filechooser.FileFilter
String type,des;
public SimpleFilter(String type, String des)
this.des=des;
this.type=type;
public boolean accept(File f){
if(f.isDirectory())return true;
else{
if(f.getName().toLowerCase().endsWith(type)) return true;
else return false;
public String getDescription(){
return des;
//------------| Methods to help create menus and toolbar |--------------
protected JMenu createStyleMenu()
JMenu menu = new JMenu("Style");
menu.add(bold);
menu.add(italic);
menu.add(underline);
menu.addSeparator();
menu.add(new StyledEditorKit.FontSizeAction("12", 12));
menu.add(new StyledEditorKit.FontSizeAction("14", 14));
menu.add(new StyledEditorKit.FontSizeAction("18", 18));
menu.addSeparator();
menu.add(new StyledEditorKit.FontFamilyAction("Serif","Serif"));
menu.add(new StyledEditorKit.FontFamilyAction("SansSerif","SansSerif"));
menu.addSeparator();
Action red = new StyledEditorKit.ForegroundAction("Red", new Color(255,0,0));
red.putValue(Action.SMALL_ICON,getMyIcon("red.gif"));
menu.add(red);
Action green = new StyledEditorKit.ForegroundAction("Green", new Color(0,150,0));
green.putValue(Action.SMALL_ICON,getMyIcon("green.gif"));
menu.add(green);
Action blue = new StyledEditorKit.ForegroundAction("Blue", new Color(0,50,150));
blue.putValue(Action.SMALL_ICON,getMyIcon("blue.gif"));
menu.add(blue);
Action black = new StyledEditorKit.ForegroundAction("Black", new Color(0,0,0));
black.putValue(Action.SMALL_ICON,getMyIcon("black.gif"));
menu.add(black);
menu.add(more);
return menu;
protected JMenu createEditMenu() {
JMenu menu = new JMenu("Edit");
menu.add(undoAction);
menu.add(redoAction);
menu.addSeparator();
menu.add(cut);
menu.add(copy);
menu.add(paste);
menu.addSeparator();
Action selectall=getActionByName(DefaultEditorKit.selectAllAction);
selectall.putValue(Action.NAME, "Select All");
menu.add(selectall);
return menu;
protected JMenu createFormatMenu(){
JMenu menu = new JMenu("Format");
menu.add(spellchecker);
menu.add(alignleft);
menu.add(alignright);
menu.add(aligncentre);
menu.add(alignjustify);
return menu;
protected JMenu createInsertMenu(){
JMenu menu = new JMenu("Insert");
Action insertimage = new InsertImageAction(this);
menu.add(insertimage);
Action insertdate = new InsertDateAction();
menu.add(insertdate);
Action insertline = new InsertLineAction();
menu.add(insertline);
JMenu bullets =new JMenu("Bullet Points");
bullets.add(new InsertBulletAction(CIRCLE,"Circle"));
bullets.add(new InsertBulletAction(TRIANGLE,"Triangle"));
bullets.add(new InsertBulletAction(SQUARE,"Square"));
menu.add(bullets);
return menu;
public JToolBar createToolbar(){
JToolBar bar= new JToolBar();
JButton newbutton=new JButton(getMyIcon("new.gif"));
newbutton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
newDoc();
bar.add(newbutton);
JButton savebutton=new JButton(getMyIcon("save.gif"));
savebutton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
save();
bar.add(savebutton);
JButton openbutton=new JButton(getMyIcon("open.gif"));
openbutton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
open();
bar.add(openbutton);
bar.addSeparator();
for(int i=0;i<tools.length;i++){
JButton button=new JButton();
button.setAction(tools[i]);
button.setIcon(getMyIcon(tools[i].getValue(Action.NAME)+".gif"));
button.setText("");
bar.add(button);
if((i==2)||(i==6))bar.addSeparator();
return bar;
public void createToolbarActions(){
bold = new StyledEditorKit.BoldAction();
bold.putValue(Action.NAME, "Bold");
italic = new StyledEditorKit.ItalicAction();
italic.putValue(Action.NAME, "Italic");
underline = new StyledEditorKit.UnderlineAction();
underline.putValue(Action.NAME, "Underline");
more = new MoreColorsAction();
cut = getActionByName(DefaultEditorKit.cutAction);
cut.putValue(Action.NAME, "Cut");
copy = getActionByName(DefaultEditorKit.copyAction);
copy.putValue(Action.NAME, "Copy");
paste = getActionByName(DefaultEditorKit.pasteAction);
paste.putValue(Action.NAME, "Paste");
alignleft = new StyledEditorKit.AlignmentAction("Left Justify",StyleConstants.ALIGN_LEFT);
alignright = new StyledEditorKit.AlignmentAction("Right Justify",StyleConstants.ALIGN_RIGHT);
aligncentre = new StyledEditorKit.AlignmentAction("Align Centre",StyleConstants.ALIGN_CENTER);
alignjustify = new StyledEditorKit.AlignmentAction("Fully Justify",StyleConstants.ALIGN_JUSTIFIED);
spellchecker = new StyledEditorKit.AlignmentAction("Spell Checker",StyleConstants.ALIGN_JUSTIFIED);
tools = new Action[]{  cut, copy, paste, bold, italic, underline, more, alignleft, alignright, aligncentre, alignjustify, spellchecker };
// helper methods to enable menu creators to get their actions by name
private void createActionTable(JTextComponent textComponent) {
actions = new Hashtable();
Action[] actionsArray = textComponent.getActions();
for (int i = 0; i < actionsArray.length; i++) {
Action a = actionsArray[i];
actions.put(a.getValue(Action.NAME), a);
private Action getActionByName(String name) {
return (Action)(actions.get(name));
//----------------| Custom Actions |--------------------
class InsertImageAction extends AbstractAction {
protected SimpleTextEditor parent;
public InsertImageAction(SimpleTextEditor parent){
super("Image...");
this.parent=parent;
public void actionPerformed(ActionEvent e) {
int n = parent.picChooser.showOpenDialog(parent);
if(n==0){
String filename=picChooser.getSelectedFile().getName();
File file = new File(picChooser.getCurrentDirectory(),filename);
Icon pic = new ImageIcon(file.getAbsolutePath());
textpane.insertIcon(pic);
SimpleTextEditor.this.repaint();
class InsertDateAction extends AbstractAction {
public InsertDateAction(){
super("Date");
public void actionPerformed(ActionEvent ble) {
Calendar c= Calendar.getInstance();
String[] months= new String[]{"01","02","03","04","05","06","07","08","09","10","11","12"};
textpane.replaceSelection(c.get(c.DAY_OF_MONTH)+"/"+months[c.get(c.MONTH)]+"/"+c.get(c.YEAR));
class InsertLineAction extends AbstractAction {
public InsertLineAction(){
super("Horizontal line");
public void actionPerformed(ActionEvent e) {
Icon pic = new ImageIcon("Images/line.gif");
textpane.insertIcon(pic);
class InsertBulletAction extends AbstractAction {
protected int type;
protected String filenames[] = new String[]{"square.gif","triangle.gif","circle.gif"};
public InsertBulletAction(int type,String name){
super(name);
this.type=type;
this.putValue(SMALL_ICON,new ImageIcon("Images/"+filenames[type]));
public void actionPerformed(ActionEvent e) {
Icon pic = new ImageIcon("Images/"+filenames[type]);
textpane.insertIcon(pic);
textpane.replaceSelection(" ");
class MoreColorsAction extends AbstractAction {
public MoreColorsAction(){
super("More Colors");
public void actionPerformed(ActionEvent e){
AttributeSet as = textpane.getCharacterAttributes();
SimpleAttributeSet sas = new SimpleAttributeSet(as);
Color newColor = JColorChooser.showDialog(
SimpleTextEditor.this,
"C

Here you go guys:
Peace!
import javax.swing.*;
import javax.swing.Timer;
import javax.swing.border.BevelBorder;
import javax.swing.text.*;
import javax.swing.text.rtf.*;
import javax.swing.event.*;
import javax.swing.filechooser.*;
import javax.swing.undo.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import java.beans.*;
  -------------------| Simple Text Editor example application using Java 1.3 with Swing |--------------
public class SimpleTextEditor extends JFrame
    private JTextPane textpane;
    private JMenuBar mb;
    private JFileChooser chooser,picChooser;
    private Hashtable actions;
    private JPopupMenu popup;
    private JMenuItem exit, newDoc, save, open, saveAs,print;
    private About ab;
    private StyledEditorKit edkit;
    private RTFEditorKit rtfkit;
    private DefaultStyledDocument doc;
    private MyDocumentListener doclistener;
    private MyUndoableEditListener undolistener;
    //Useful variables
    private String filename = "untitled1.txt",filetype = ".txt";
    private File thisfile;
    protected String FileFormats[],FileDescriptions[],PicFileFormats[],PicFileDescriptions[];
    protected boolean DocumentIsUnedited = true, DocumentIsSaved = false;
    public static int SQUARE = 0,TRIANGLE = 1,CIRCLE = 2;
    public String newline = "\n";
    protected UndoManager undo;
    protected UndoAction undoAction;
    protected RedoAction redoAction;
    // These are the actions used in the menus and on the toolbar
    protected Action bold, italic, underline, alignleft, alignright, aligncentre;
    protected Action spellchecker, alignjustify, more, cut, copy, paste, tools[];
    public SimpleTextEditor()
        super("SimpleTextEditor - untitled1.rtf");
        this.setLocation(200, 200);
        this.setIconImage(getMyIcon("Icon.gif").getImage());
        getContentPane().setLayout(new BorderLayout());
        undo = new UndoManager();
        //Set up the file formats and file choosers etc
        FileFormats = new String[]{".rtf", ".txt", ".java", ".bat"};
        FileDescriptions = new String[]{"Rich Text Format Files", "Text Files", "Java Source Files", "DOS Batch Files"};
        PicFileFormats = new String[]{".gif", ".bmp", ".jpg"};
        PicFileDescriptions = new String[]{"Gif Images", "Bitmap Images", "JPEG Images"};
        chooser = new JFileChooser();
        picChooser = new JFileChooser();
        picChooser.setAccessory(new ImagePreview(picChooser));
        javax.swing.filechooser.FileFilter defaultFilter = new SimpleFilter(FileFormats[0], FileDescriptions[0]);
        javax.swing.filechooser.FileFilter defaultPicFilter = new SimpleFilter(PicFileFormats[0], PicFileDescriptions[0]);
        for (int i = 1; i < FileFormats.length; i++)
            chooser.addChoosableFileFilter(new SimpleFilter(FileFormats, FileDescriptions[i]));
for (int i = 1; i < PicFileFormats.length; i++)
picChooser.addChoosableFileFilter(new SimpleFilter(PicFileFormats[i], PicFileDescriptions[i]));
chooser.setFileFilter(defaultFilter);
picChooser.setFileFilter(defaultPicFilter);
File working = new File("C:/Documents");
if (!working.exists())
working = new File("C:/MyDocuments");
if (!working.exists()) working = new File("C:/");
if (working.exists())
chooser.setCurrentDirectory(working);
picChooser.setCurrentDirectory(working);
// Set up Document object and Editor kits
doc = new DefaultStyledDocument();
edkit = new StyledEditorKit();
rtfkit = new RTFEditorKit();
// Set up Listener objects
doclistener = new MyDocumentListener();
undolistener = new MyUndoableEditListener();
doc.addDocumentListener(doclistener);
doc.addUndoableEditListener(undolistener);
//Set up main GUI content
textpane = new JTextPane(doc);
textpane.setPreferredSize(new Dimension(400, 400));
textpane.setMinimumSize(new Dimension(400, 400));
JScrollPane scroller = new JScrollPane(textpane);
scroller.setPreferredSize(new Dimension(400, 400));
mb = new JMenuBar(); // Create a menu bar
JMenu File = new JMenu("File");
JMenu Help = new JMenu("Help");
//Sort out Actions etc
createActionTable(textpane);
createToolbarActions();
JMenu Style = createStyleMenu();
undoAction = new UndoAction();
redoAction = new RedoAction();
//Create Style, Edit and Format menus + Toolbar
JMenu Edit = createEditMenu();
JMenu Format = createFormatMenu();
JMenu Insert = createInsertMenu();
JToolBar toolbar = createToolbar();
getContentPane().add("North", toolbar);
// set up main menu items with ActionListeners
newDoc = new JMenuItem("New");
newDoc.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
newDoc();
exit = new JMenuItem("Exit");
exit.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
exit();
print = new JMenuItem("Print");
print.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
print();
save = new JMenuItem("Save");
save.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
save();
saveAs = new JMenuItem("Save As...");
saveAs.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
saveas();
open = new JMenuItem("Open...");
open.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
open();
JMenuItem about = new JMenuItem("About");
about.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
ab = new About(SimpleTextEditor.this);
ab.show();
ab.setLocation(400, 300);
// Create the popup menu
popup = createEditMenu().getPopupMenu();
popup.addSeparator();
popup.add(createStyleMenu());
popup.add(createFormatMenu());
textpane.add(popup);
// set up Help and File menus
Help.add(about);
File.add(newDoc);
File.add(open);
File.add(print);
File.add(save);
File.add(saveAs);
File.addSeparator();
File.add(exit);
// add the menus to the menubar
mb.add(File);
mb.add(Edit);
mb.add(Format);
mb.add(Style);
mb.add(Insert);
mb.add(Help);
this.setJMenuBar(mb);
getContentPane().add("Center", scroller);
// Add mouse Listener to the textpane for popup events
textpane.addMouseListener(new MouseAdapter()
public void mousePressed(MouseEvent e)
if (e.isPopupTrigger())
popup.show(textpane, e.getX(), e.getY());
e.consume();
public void mouseReleased(MouseEvent e)
if (e.isPopupTrigger())
popup.show(textpane, e.getX(), e.getY());
e.consume();
//-----------------| Main active methods |------------------
public void exit()// Main Exit method
if (DocumentIsUnedited)
{//Check that document is saved/unedited etc
dispose();
setVisible(false);
System.exit(0);
else
switch (showNotSavedDialog("Exit"))
case JOptionPane.YES_OPTION:
save();
exit();
break;
case JOptionPane.NO_OPTION:
DocumentIsUnedited = true;
exit();
break;
case JOptionPane.CANCEL_OPTION:
break;
public void newDoc()//Method to create new documents
if (DocumentIsUnedited)
initDoc();
filename = "untitled.txt";
filetype = ".txt";
resetTitle();
else
switch (showNotSavedDialog("New Document"))
case JOptionPane.YES_OPTION:
save();
newDoc();
break;
case JOptionPane.NO_OPTION:
DocumentIsUnedited = true;
newDoc();
break;
case JOptionPane.CANCEL_OPTION:
break;
private void initDoc()// Helper method to initialize a new document
doc = null;
doc = (DefaultStyledDocument) edkit.createDefaultDocument();
doc.addDocumentListener(doclistener);
textpane.setStyledDocument(doc);
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
* 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.NORTH);
panel.add(backing, BorderLayout.EAST);
return panel;
private ActionListener ticker = new ActionListener()
public void actionPerformed(ActionEvent e)
label.setText(String.valueOf(getRandomNumber()));
private int getRandomNumber()
return r.nextInt(10) + 1; // shift from 0-9 to 1-10
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();
public void saveas()
int n = chooser.showSaveDialog(this);
if (n == 0)
filename = chooser.getSelectedFile().getName();
boolean ext = false;
setFiletype();
thisfile = new File(chooser.getCurrentDirectory(), filename);
DocumentIsSaved = true;
save();
resetTitle();
repaint();
public void save()// Save method. Used by "Save As..." as well
if (DocumentIsSaved)
try
FileOutputStream out = new FileOutputStream(thisfile);
if ((filetype.equals(".rtf")) || (filetype.equals(".doc")))
rtfkit.write(out, doc, 0, doc.getLength());
else
edkit.write(out, doc, 0, doc.getLength());
catch (Exception e)
System.out.println("" + e.getMessage() + "");
DocumentIsUnedited = true;
else
saveas();
public void open()// Find a file and read it into the document
if (DocumentIsUnedited)
int n = chooser.showOpenDialog(this); // get the outcome of the dialog
if (n == 0)
File file = chooser.getSelectedFile();
filename = chooser.getName(file);
setFiletype();
resetTitle();
initDoc();
try
FileInputStream in = new FileInputStream(file);
if (filetype.equals(".rtf"))
rtfkit.read(in, doc, 0);
edkit.read(in, doc, 0);
catch (Exception e)
System.out.println("" + e.getMessage() + "");
thisfile = new File(chooser.getCurrentDirectory(), chooser.getSelectedFile().getName());
DocumentIsUnedited = true;
DocumentIsSaved = true;
resetTitle();
repaint();
else
switch (showNotSavedDialog("Open"))
case JOptionPane.YES_OPTION:
save();
open();
break;
case JOptionPane.NO_OPTION:
DocumentIsUnedited = true;
open();
break;
case JOptionPane.CANCEL_OPTION:
break;
private void setFiletype()// Helper method to get the filetype of saved/opened documents
filetype = null;
for (int i = 0; i < FileFormats.length; i++)
if (filename.toLowerCase().endsWith(FileFormats[i]))
filetype = FileFormats[i];
else
for (i = 0; i < filename.length(); i++)
if (filename.toLowerCase().charAt(i) == '.')
filetype = filename.substring(i);
if (filetype == null) filetype = ".txt";
private void resetTitle()
this.setTitle("SimpleTextEditor - " + filename);
private ImageIcon getMyIcon(String filename)
ImageIcon pic = new ImageIcon("Images/" + filename);
return pic;
private int showNotSavedDialog(String title)// Helper method to create "Save? Yes/No/Cancel" dialogs
int n = JOptionPane.showConfirmDialog(this, "The last document has not been saved. \nDo you want to save it first?",
title,
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
return n;
//-----------------| Listeners and Helper classes |----------------
protected class MyDocumentListener implements DocumentListener
public void insertUpdate(DocumentEvent e)
SimpleTextEditor.this.DocumentIsUnedited = false;
public void removeUpdate(DocumentEvent e)
SimpleTextEditor.this.DocumentIsUnedited = false;
public void changedUpdate(DocumentEvent e)
SimpleTextEditor.this.DocumentIsUnedited = false;
protected class MyUndoableEditListener implements UndoableEditListener
public void undoableEditHappened(UndoableEditEvent e)
//Remember the edit and update the menus.
undo.addEdit(e.getEdit());
undoAction.updateUndoState();
redoAction.updateRedoState();
//Helper class for FileFilter, allows a description to be assigned to a filetype
protected class SimpleFilter extends javax.swing.filechooser.FileFilter
String type,des;
public SimpleFilter(String type, String des)
this.des = des;
this.type = type;
public boolean accept(File f)
if (f.isDirectory())
return true;
else
if (f.getName().toLowerCase().endsWith(type))
return true;
else
return false;
public String getDescription()
return des;
//------------| Methods to help create menus and toolbar |--------------
protected JMenu createStyleMenu()
JMenu menu = new JMenu("Style");
menu.add(bold);
menu.add(italic);
menu.add(underline);
menu.addSeparator();
menu.add(new StyledEditorKit.FontSizeAction("12", 12));
menu.add(new StyledEditorKit.FontSizeAction("14", 14));
menu.add(new StyledEditorKit.FontSizeAction("18", 18));
menu.addSeparator();
menu.add(new StyledEditorKit.FontFamilyAction("Serif", "Serif"));
menu.add(new StyledEditorKit.FontFamilyAction("SansSerif", "SansSerif"));
menu.addSeparator();
Action red = new StyledEditorKit.ForegroundAction("Red", new Color(255, 0, 0));
red.putValue(Action.SMALL_ICON, getMyIcon("red.gif"));
menu.add(red);
Action green = new StyledEditorKit.ForegroundAction("Green", new Color(0, 150, 0));
green.putValue(Action.SMALL_ICON, getMyIcon("green.gif"));
menu.add(green);
Action blue = new StyledEditorKit.ForegroundAction("Blue", new Color(0, 50, 150));
blue.putValue(Action.SMALL_ICON, getMyIcon("blue.gif"));
menu.add(blue);
Action black = new StyledEditorKit.ForegroundAction("Black", new Color(0, 0, 0));
black.putValue(Action.SMALL_ICON, getMyIcon("black.gif"));
menu.add(black);
menu.add(more);
return menu;
protected JMenu createEditMenu()
JMenu menu = new JMenu("Edit");
menu.add(undoAction);
menu.add(redoAction);
menu.addSeparator();
menu.add(cut);
menu.add(copy);
menu.add(paste);
menu.addSeparator();
Action selectall = getActionByName(DefaultEditorKit.selectAllAction);
selectall.putValue(Action.NAME, "Select All");
menu.add(selectall);
return menu;
protected JMenu createFormatMenu()
JMenu menu = new JMenu("Format");
menu.add(spellchecker);
menu.add(alignleft);
menu.add(alignright);
menu.add(aligncentre);
menu.add(alignjustify);
return menu;
protected JMenu createInsertMenu()
JMenu menu = new JMenu("Insert");
Action insertimage = new InsertImageAction(this);
menu.add(insertimage);
Action insertdate = new InsertDateAction();
menu.add(insertdate);
Action insertline = new InsertLineAction();
menu.add(insertline);
JMenu bullets = new JMenu("Bullet Points");
bullets.add(new InsertBulletAction(CIRCLE, "Circle"));
bullets.add(new InsertBulletAction(TRIANGLE, "Triangle"));
bullets.add(new InsertBulletAction(SQUARE, "Square"));
menu.add(bullets);
return menu;
public JToolBar createToolbar()
JToolBar bar = new JToolBar();
JButton newbutton = new JButton(getMyIcon("new.gif"));
newbutton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
newDoc();
bar.add(newbutton);
JButton savebutton = new JButton(getMyIcon("save.gif"));
savebutton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
save();
bar.add(savebutton);
JButton openbutton = new JButton(getMyIcon("open.gif"));
openbutton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
open();
bar.add(openbutton);
bar.addSeparator();
for (int i = 0; i < tools.length; i++)
JButton button = new JButton();
button.setAction(tools[i]);
button.setIcon(getMyIcon(tools[i].getValue(Action.NAME) + ".gif"));
button.setText("");
bar.add(button);
if ((i == 2) || (i == 6)) bar.addSeparator();
return bar;
public void createToolbarActions()
bold = new StyledEditorKit.BoldAction();
bold.putValue(Action.NAME, "Bold");
italic = new StyledEditorKit.ItalicAction();
italic.putValue(Action.NAME, "Italic");
underline = new StyledEditorKit.UnderlineAction();
underline.putValue(Action.NAME, "Underline");
more = new MoreColorsAction();
cut = getActionByName(DefaultEditorKit.cutAction);
cut.putValue(Action.NAME, "Cut");
copy = getActionByName(DefaultEditorKit.copyAction);
copy.putValue(Action.NAME, "Copy");
paste = getActionByName(DefaultEditorKit.pasteAction);
paste.putValue(Action.NAME, "Paste");
alignleft = new StyledEditorKit.AlignmentAction("Left Justify", StyleConstants.ALIGN_LEFT);
alignright = new StyledEditorKit.AlignmentAction("Right Justify", StyleConstants.ALIGN_RIGHT);
aligncentre = new StyledEditorKit.AlignmentAction("Align Centre", StyleConstants.ALIGN_CENTER);
alignjustify = new StyledEditorKit.AlignmentAction("Fully Justify", StyleConstants.ALIGN_JUSTIFIED);
spellchecker = new StyledEditorKit.AlignmentAction("Spell Checker", StyleConstants.ALIGN_JUSTIFIED);
tools = new Action[]{cut, copy, paste, bold, italic, underline, more, alignleft, alignright, aligncentre, alignjustify, spellchecker};
// helper methods to enable menu creators to get their actions by name
private void createActionTable(JTextComponent textComponent)
actions = new Hashtable();
Action[] actionsArray = textComponent.getActions();
for (int i = 0; i < actionsArray.length; i++)
Action a = actionsArray[i];
actions.put(a.getValue(Action.NAME), a);
private Action getActionByName(String name)
return (Action) (actions.get(name));
//----------------| Custom Actions |--------------------
class InsertImageAction extends AbstractAction
protected SimpleTextEditor parent;
public InsertImageAction(SimpleTextEditor parent)
super("Image...");
this.parent = parent;
public void actionPerformed(ActionEvent e)
int n = parent.picChooser.showOpenDialog(parent);
if (n == 0)
String filename = picChooser.getSelectedFile().getName();
File file = new File(picChooser.getCurrentDirectory(), filename);
Icon pic = new ImageIcon(file.getAbsolutePath());
textpane.insertIcon(pic);
SimpleTextEditor.this.repaint();
class InsertDateAction extends AbstractAction
public InsertDateAction()
super("Date");
public void actionPerformed(ActionEvent ble)
Calendar c = Calendar.getInstance();
String[] months = new String[]{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"};
textpane.replaceSelection(c.get(c.DAY_OF_MONTH) + "/" + months[c.get(c.MONTH)] + "/" + c.get(c.YEAR));
class InsertLineAction extends AbstractAction
public InsertLineAction()
super("Horizontal line");
public void actionPerformed(ActionEvent e)
Icon pic = new ImageIcon("Images/line.gif");
textpane.insertIcon(pic);
class InsertBulletAction extends AbstractAction
protected int type;
protected String filenames[] = new String[]{"square.gif", "triangle.gif", "circle.gif"};
public InsertBulletAction(int type, String name)
super(name);
this.type = type;
this.putValue(SMALL_ICON, new ImageIcon("Images/" + filenames[type]));
public void actionPerformed(ActionEvent e)
Icon pic = new ImageIcon("Images/" + filenames[type]);
textpane.insertIcon(pic);
textpane.replaceSelection(" ");
class MoreColorsAction extends AbstractAction
public MoreColorsAction()
super("More Colors");
public void actionPerformed(ActionEvent e)
AttributeSet as = textpane.getCharacterAttributes();
SimpleAttributeSet sas = new SimpleAttributeSet(as);
Color newColor = JColorChooser.showDialog(
SimpleTextEditor.this,
"Choose Text Color",
doc.getForeground(as));
if (newColor != null)
StyleConstants.setForeground(sas, newColor);
textpane.setCharacterAttributes(sas, true);
SimpleTextEditor.this.repaint();
class UndoAction extends AbstractAction
public UndoAction()
super("Undo");
setEnabled(false);
public void actionPerformed(ActionEvent e)
try
undo.undo();
catch (CannotUndoException ex)
System.out.println("Unable to undo: " + ex);
ex.printStackTrace();
updateUndoState();
redoAction.updateRedoState();
protected void updateUndoState()
if (undo.canUndo())
setEnabled(true);
putValue(Action.NAME, undo.getUndoPresentationName());
else
setEnabled(false);
putValue(Action.NAME, "Undo");
class RedoAction extends AbstractAction
public RedoAction()
super("Redo");
setEnabled(false);
public void actionPerformed(ActionEvent e)
try
undo.redo();
catch (CannotRedoException ex)
System.out.println("Unable to redo: " + ex);
ex.printStackTrace();
updateRedoState();
undoAction.updateUndoState();
protected void updateRedoState()
if (undo.canRedo())
setEnabled(true);
putValue(Action.NAME, undo.getRedoPresentationName());
else
setEnabled(false);
putValue(Action.NAME, "Redo");
//-------------| Very nice Image Previewer 'borrowed' from Sun's Java Tutorial
class ImagePreview extends JComponent implements PropertyChangeListener
ImageIcon thumbnail = null;
File file = null;
public ImagePreview(JFileChooser fc)
setPreferredSize(new Dimension(100, 50));
fc.addPropertyChangeListener(this);
public void loadImage()
if (file == null)
return;
ImageIcon tmpIcon = new ImageIcon(file.getPath());
if (tmpIcon.getIconWidth() > 90)
thumbnail = new ImageIcon(tmpIcon.getImage().getScaledInstance(90, -1,
Image.SCALE_DEFAULT));
else
thumbnail = tmpIcon;

Similar Messages

  • Is there a way to create a custom screensaver with pics/slides that display for different amounts of time?

    Is there a way to create a custom screensaver with pics/slides that display for different amounts of time? Or even add a "video slide" into the screensaver?
    My business has 3 TVs displayed in our lobby, each with its own apple TV and they are all linked to the same photo stream. Currently the Atv screensaver displays the photostream pictures of our products for the default 3 seconds. We just added pics/slides that now display messages and useful info for our customers but I want that info to be displayed for a longer period of time than the pictures to give people a chance to read it.
    I tried using flickr and powerpoint as a work around but no luck.  I created a slide in powerpoint with play length of 15 secs and saved it as a wmv file.  I added that file to a "screensaver" set in flickr and pointed the Atv screensaver to that flickr set.  It still displays everything, pics and the wmv file at the default 3 sec.
    I know I can increase the duration of all pics in the screensaver to display for longer but the goal is to have the pics display at 3 secs and the info slides to display at 15 secs.

    Welcome to the Apple Community.
    No that's not possible.
    If you have any suggestions that you think might enhance the Apple TV you can send Apple your feedback here 

  • Invoices report that displays also the VAT number

    Hi
    I am looking for invoices report that displays also the customer/vendor name and its VAT registration number.
    The customer invoices are SD invoices (can be displayed using the FI) and the supplier invoices are MM or FI invoices.
    It is relevant for the supplier invoices (MM/FI) and for the customer invoices (two seperate reports)
    Thanks
    Ofer

    Hi Edgar,
    As per my understanding, std SAP report won't fulfill your requirement. Best approach would be a custom report where you can update the required fields.
    Regards,
    Chandru

  • Hi Everyone,  I am using iPhone5, my question in how to display name and contact number both stored for incoming and outgoing calls? If I have saved five different numbers with a same name, how do I recognise that from which number caller is calling?

    Hi Everyone,  I am using iPhone5, my question in how to display name and contact number both stored for incoming and outgoing calls? If I have saved five different numbers with a same name, how do I recognise that from which number caller is calling?

    I have friends all over Europe, does it matter what number they use to call me? Nope! All incoming calls are free for me.
    The only time you ever have to worry about which number is if you get charged for incoming domestic/international calls.
    You can tag their number (work/home/iphone) and that may show on the CallerID accordingly.
    It should show, John Doe
    underneath,    work/home/mobile
    For example:
    http://shawnblanc.net/images/img-0009-1.png

  • HT201303 It keeps saying that I used a different computer to access my account. I haven't. How can I get it to stop this so I don't have to enter my card number every time?

    It keeps saying that I used a different computer to access my account. I haven't. How can I get it to stop this so I don't have to enter my card number every time?

    It also says that "your account information has changed. Please review your account and email address and approve them for use in the itunes store." It happens EVERY time I buy a new song, a new album, anything. Even if I buy an album and five minutes later, without closing itunes, buy another one, I have to go through this whole process. It's REALLY annoying.

  • HT5538 I have a different phone number when traveling, that the one registered in my account. How can I add it?

    I have a different phone number when traveling, that the one registered in my account. How can I add it?

    Lost information
    https://www.adobe.com/account.html for serial numbers or subscriptions on your Adobe page... or
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • I would like to add content that changes on a calendar basis, such as 'thought for the day". It can then display a different text or image on a nominated day. Can this be done? Robert.

    I would like to add content that changes on a calendar basis, such as 'thought for the day". It can then display a different text or image on a nominated day. Can this be done? Robert.

    OK Thanks Brad.
    I could use Tockify of course, but wanted to create the same things on an existing site.
    I do not know how to copy the code and get it onto Muse, but that’s OK for now. I will work something else out.
    Robert

  • I have a text window open that displays every move I make on the desktop and I can't get rid of it. Help!

    My grandson was playing with my mouse and keyboard and did something so that now I have a text window open that displays every move I make on the desktop and I can't get rid of it. Help! The window continuously tells me where I am, etc.

    Go to System Preferences > Universal Access > Seeing Tab > Turn VoiceOver off.
    Or  CMD FN F5
    Captfred

  • Query that displays  number of orders shipped in state of Texas

    Hello experts,
    I would need a report that displays the following
    Deliver doc Number,Posting date,Item Number,Item Description and the ship to state to be "Texas".
    If possible we also need a date selection range parameter that would help filter the report.
    Thanks
    Edited by: Sheena Lin on Apr 14, 2011 9:39 PM
    Edited by: Sheena Lin on Apr 14, 2011 9:41 PM

    Hi,
    Try this:
    SELECT T0.DocNum, T0.DocDate, T1.ItemCode, T1.Dscription
    FROM ODLN T0
    INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T0.Address2 LIKE '%TX%' AND T0.DocDate > [%0]
    AND T0.DocDate < [%1]
    Thanks,
    Gordon

  • Report that displays Costcenter , Document Number and Document type

    Hi All,
    Can anyone suggest Report that displays Costcenter for a Document Number of certain Document type - Like G/L accounts .
    Thanks in advance ,
    Regards,
    Ry

    Good afternoon.
    If you are trying to run a report for a particular cost center (or range of cost centers) and have the report show the GL document number and document type, try transaction KSB1.  You can update the line layout to show these fields.
    If you are trying to run a report for a GL account and have the report show the cost center, run FAGLL03. You can update the line layout to include cost center.
    Apologies if I have mis-understood your question.
    Barb

  • I am trying to download Illustrator to my windows laptop.  I tried with CC but got an error when entering the license number.  So someone told me that CC is different from CS6 Illustrator, and I have a license only for CS6 Illustrator.  What is the correc

    I am trying to download Illustrator to my windows laptop.  I tried with CC but got an error when entering the license number.  So someone told me that CC is different from CS6 Illustrator, and I have a license only for CS6 Illustrator.  What is the correct link for CS6 Illustrator then?

    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 |12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.window using the Lightroom 3 link to see those 'Important Instructions'.

  • I did a trial using one email, then purchased a subscription using a different email. Every time I try to open a downloaded app it tells me that my trial has expired and only offers me the option to purchase it. Any ideas how I can access the subscription

    I did a trial using one email, then purchased a subscription using a different email. Every time I try to open a downloaded app it tells me that my trial has expired and only offers me the option to purchase it. Any ideas how I can access the subscription I just paid for?

    Sign out from Creative Cloud desktop application and Sign in with email ID using which you had purchased subscription .
    https://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    Then launch CC apps and try to activate.
    Still face issue , let me know 

  • Are there any payment gateways that will display the BC invoice number in transaction info?

    MI've been told by BC suppor that this functionality is not available for Paypal, and am wondering if any Payment gateways would support this. My client wants to see the invoice number (from BC) in each transaction in Paypal to be able to easily reconcile orders and payments. Other pamynet info shows up, and it would be great if the invoice number would come through as well.
    Any help?

    Just have a follow up question about this. My client's accounting dept is having some issues with how the funds are deposited into the bank account without any identification to describe where it is coming from. When you say that "BC sends an order number to the gateways," do you mean that once someone places an order the order number is passed to the payment gateway with all the rest of the payment info? So that order number could be seen in PayPal, for example, but once the client deposits those funds into their bank account, that information would not necessarily be submitted along with it, correct? Thanks.

  • I accidentally downloaded an adware that I did not want. Every time I shut down a screen pops up and asks if I'd like to abort the script. How do I get rid of this and get the adware off my computer?

    Accidental adware download. How to I get rid of it?

    Helpful Links Regarding Malware Problems
    If you are having an immediate problem with ads popping up see The Safe Mac » Adware Removal Guide, remove adware that displays pop-up ads and graphics on your Mac, and AdwareMedic. If you require anti-virus protection Thomas Reed recommends using ClamXAV. (Thank you to Thomas Reed for this recommendation.) You might consider adding this Safari extensions: Adblock Plus 1.8.9.
    Open Safari, select Preferences from the Safari menu. Click on Extensions icon in the toolbar. Disable all Extensions. If this stops your problem, then re-enable them one by one until the problem returns. Now remove that extension as it is causing the problem.
    The following comes from user stevejobsfan0123. I have made minor changes to adapt to this presentation.
    Fix Some Browser Pop-ups That Take Over Safari.
    Common pop-ups include a message saying the government has seized your computer and you must pay to have it released (often called "Moneypak"), or a phony message saying that your computer has been infected, and you need to call a tech support number (sometimes claiming to be Apple) to get it resolved. First, understand that these pop-ups are not caused by a virus and your computer has not been affected. This "hijack" is limited to your web browser. Also understand that these messages are scams, so do not pay any money, call the listed number, or provide any personal information. This article will outline the solution to dismiss the pop-up.
    Quit Safari
    Usually, these pop-ups will not go away by either clicking "OK" or "Cancel." Furthermore, several menus in the menu bar may become disabled and show in gray, including the option to quit Safari. You will likely have to force quit Safari. To do this, press Command + option + esc, select Safari, and press Force Quit.
    Relaunch Safari
    If you relaunch Safari, the page will reopen. To prevent this from happening, hold down the 'Shift' key while opening Safari. This will prevent windows from the last time Safari was running from reopening.
    This will not work in all cases. The shift key must be held at the right time, and in some cases, even if done correctly, the window reappears. In these circumstances, after force quitting Safari, turn off Wi-Fi or disconnect Ethernet, depending on how you connect to the Internet. Then relaunch Safari normally. It will try to reload the malicious webpage, but without a connection, it won't be able to. Navigate away from that page by entering a different URL, i.e. www.apple.com, and trying to load it. Now you can reconnect to the Internet, and the page you entered will appear rather than the malicious one.

  • "Link That Displays Item In Folder Area " option for a Text Item not there in 9.0.2

    Hi,
    In the previous version of Portal when you created a content area item of type text. there were four display options
    1) Item Displayed Directly In Folder Area
    2) Link That Displays Item In Folder Area (i.e on a page for a folder)
    3) Link That Displays Item In Full Browser Window
    4) Link That Displays Item In New Browser Window.
    In release2 of protal the option number 2) is removed.
    We were using option 2 as we added different portlets and style sheets on content area page because of which we were able to get the desired page.
    Now in the new release this option is not there.
    Any pointers to the issue.
    or Is there a default style and page design which is used while opening the details of the text and whether that default can be modified or not?
    Regards
    Kapil

    Hi,
    Please post this question in the content areas discussion folder.
    Thanks,
    Sharmila

Maybe you are looking for

  • Calling virtual function recursively

    Hello, I have a virtual function foo() in class A which, under certain conditions, will call itself. In a class B, which is derived from A, I am overriding foo() to call super.foo() and then execute come code. My question is: When the code in class A

  • Stopsap is not working in Java ystem

    Hi All, We have a Java system connected to XI. stopsap command is not working when I try to shutdown the java system. I have to kill all the processes to stop the Java. The error that I am getting is the following. I used <SID>adm user to stop the Ja

  • How do I cancel NHL gamecenter ?

    I just bought the gamecenter app just to find out that all my games are blocked out now I can't cancel it !!

  • Report for basic dates change in maintenance order

    Dear friends, Client requirement is to see the orders for which basic dates have been changed. The scenario is when preventive maintenance is done , if the work cannot be done on the date(basic date in maintenanc eorder), the basic date is changed fo

  • Need to drop a current redo log on a Standby

    Oracle 11.2.0.2 I have 3 redo logs on a newly created Standby database. SQL> SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG; GROUP# ARC STATUS 1 YES UNUSED 3 NO CURRENT 2 YES UNUSED The redo log in Group 3 needs to be dropped and recreated. How can I for