Can U help me change "Paint.java" to MVC model

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JTextField;
import javax.swing.ImageIcon;
public class Paint extends Applet implements ActionListener, AdjustmentListener, MouseListener, MouseMotionListener
private static final long serialVersionUID = 1L;
private final int NO_OP = 0;
private final int PEN_OP = 1;
private final int LINE_OP = 2;
private final int ERASER_OP = 3;
private final int CLEAR_OP = 4;
private final int RECT_OP = 5;
private final int OVAL_OP = 6;
private final int FRECT_OP = 7;
private final int FOVAL_OP = 8;
private final int SPLINE_OP = 9;
private final int POLY_OP = 10;
private int mousex = 0;
private int mousey = 0;
private int prevx = 0;
private int prevy = 0;
private boolean initialPen = true;
private boolean initialLine = true;
private boolean initialEraser = true;
private boolean initialRect = true;
private boolean initialOval = true;
private boolean initialFRect = true;
private boolean initialFOval = true;
private boolean initialPolygon = true;
private boolean initialSpline = true;
private int Orx = 0;
private int Ory = 0;
private int OrWidth = 0;
private int OrHeight = 0;
private int drawX = 0;
private int drawY = 0;
private int eraserLength = 5;
private int udefRedValue = 255;
private int udefGreenValue = 255;
private int udefBlueValue = 255;
private int opStatus = PEN_OP;
private int colorStatus = 1;
private Color mainColor = new Color(0,0,0);
private Color xorColor = new Color(255,255,255);
private Color statusBarColor = new Color(166,166,255);
private Color userDefinedColor = new Color(udefRedValue,udefGreenValue,udefBlueValue);
private JButton penButton           = new JButton(new ImageIcon(getClass().getResource("pen.gif")));
private JButton lineButton           = new JButton(new ImageIcon(getClass().getResource("line.gif")));
private JButton eraserButton           = new JButton(new ImageIcon(getClass().getResource("eraser.gif")));
private JButton clearButton = new JButton("Clear");
private JButton rectButton           = new JButton(new ImageIcon(getClass().getResource("rec.gif")));
private JButton ovalButton           = new JButton(new ImageIcon(getClass().getResource("oval.gif")));
private JButton fillRectButton      = new JButton(new ImageIcon(getClass().getResource("fillrec.gif")));
private JButton fillOvalButton      = new JButton(new ImageIcon(getClass().getResource("filloval.gif")));
private JButton splineButton = new JButton("Spline");
private JButton polygonButton = new JButton("Polygon");
private JButton blackButton = new JButton("Black");
private JButton blueButton = new JButton("Blue");
private JButton redButton = new JButton("Red");
private JButton greenButton = new JButton("Green");
private JButton purpleButton = new JButton("Purple");
private JButton orangeButton = new JButton("Orange");
private JButton pinkButton = new JButton("Pink");
private JButton grayButton = new JButton("Gray");
private JButton yellowButton = new JButton("Yellow");
private JButton userDefButton = new JButton("User-Def");
private JScrollBar redSlider = new JScrollBar(Scrollbar.HORIZONTAL, 0, 1, 0, 255);
private JScrollBar blueSlider = new JScrollBar(Scrollbar.HORIZONTAL, 0, 1, 0, 255);
private JScrollBar greenSlider = new JScrollBar(Scrollbar.HORIZONTAL, 0, 1, 0, 255);
private JTextField colorStatusBar = new JTextField(20);
private JTextField opStatusBar = new JTextField(20);
private JTextField mouseStatusBar = new JTextField(10);
private JTextField redValue = new JTextField(3);
private JTextField greenValue = new JTextField(3);
private JTextField blueValue = new JTextField(3);
private JLabel operationLabel = new JLabel(" Tool mode:");
private JLabel colorLabel = new JLabel(" Color mode:");
private JLabel cursorLabel = new JLabel(" Cursor:");
private JPanel ToolbarPanel = new JPanel(new GridLayout(11,2,0,0));
private JPanel drawPanel = new JPanel();
private JPanel statusPanel = new JPanel();
private JPanel udefcolPanel = new JPanel(new GridLayout(3,3,0,0));
private JPanel udefdemcolPanel = new JPanel();
private JPanel PicPanel               = new JPanel();
public void init()
setLayout(new BorderLayout());
ToolbarPanel.add(blackButton);
ToolbarPanel.add(blueButton);
ToolbarPanel.add(redButton);
ToolbarPanel.add(greenButton);
ToolbarPanel.add(purpleButton);
ToolbarPanel.add(orangeButton);
ToolbarPanel.add(pinkButton);
ToolbarPanel.add(grayButton);
ToolbarPanel.add(yellowButton);
ToolbarPanel.add(userDefButton);
blueButton.setBackground(Color.blue);
redButton.setBackground(Color.red);
greenButton.setBackground(Color.green);
purpleButton.setBackground(Color.magenta);
orangeButton.setBackground(Color.orange);
pinkButton.setBackground(Color.pink);
grayButton.setBackground(Color.gray);
yellowButton.setBackground(Color.yellow);
userDefButton.setBackground(userDefinedColor);
ToolbarPanel.add(penButton);
ToolbarPanel.add(lineButton);
ToolbarPanel.add(eraserButton);
ToolbarPanel.add(clearButton);
ToolbarPanel.add(rectButton);
ToolbarPanel.add(ovalButton);
ToolbarPanel.add(fillRectButton);
ToolbarPanel.add(fillOvalButton);
ToolbarPanel.add(splineButton);
ToolbarPanel.add(polygonButton);
ToolbarPanel.setBounds(0,0,100,300);
ToolbarPanel.add(udefcolPanel);
ToolbarPanel.add(udefdemcolPanel);
udefcolPanel.add(redValue);
udefcolPanel.add(redSlider);
udefcolPanel.add(greenValue);
udefcolPanel.add(greenSlider);
udefcolPanel.add(blueValue);
udefcolPanel.add(blueSlider);
statusPanel.add(colorLabel);
statusPanel.add(colorStatusBar);
statusPanel.add(operationLabel);
statusPanel.add(opStatusBar);
statusPanel.add(cursorLabel);
statusPanel.add(mouseStatusBar);
colorStatusBar.setEditable(false);
opStatusBar.setEditable(false);
mouseStatusBar.setEditable(false);
statusPanel.setBackground(statusBarColor);
ToolbarPanel.setBackground(Color.white);
drawPanel.setBackground(Color.white);
add(statusPanel, "North");
add(ToolbarPanel, "West");
add(drawPanel, "Center");
penButton.addActionListener(this);
lineButton.addActionListener(this);
eraserButton.addActionListener(this);
clearButton.addActionListener(this);
rectButton.addActionListener(this);
ovalButton.addActionListener(this);
fillRectButton.addActionListener(this);
fillOvalButton.addActionListener(this);
splineButton.addActionListener(this);
polygonButton.addActionListener(this);
blackButton.addActionListener(this);
blueButton.addActionListener(this);
redButton.addActionListener(this);
greenButton.addActionListener(this);
purpleButton.addActionListener(this);
orangeButton.addActionListener(this);
pinkButton.addActionListener(this);
grayButton.addActionListener(this);
yellowButton.addActionListener(this);
userDefButton.addActionListener(this);
redSlider.addAdjustmentListener(this);
blueSlider.addAdjustmentListener(this);
greenSlider.addAdjustmentListener(this);
drawPanel.addMouseMotionListener(this);
drawPanel.addMouseListener(this);
// this.addMouseListener(this);
// this.addMouseMotionListener(this);
updateRGBValues();
opStatusBar.setText("Pen");
colorStatusBar.setText("Black");
public void actionPerformed(ActionEvent e)
     penButton.setActionCommand("Pen");
     lineButton.setActionCommand("Line");
     eraserButton.setActionCommand("Eraser");
     rectButton.setActionCommand("Rectangle");
     ovalButton.setActionCommand("Oval");
     fillRectButton.setActionCommand("Filled Rectangle");
     fillOvalButton.setActionCommand("Filled Oval");
     if (e.getActionCommand() == "Pen")
     opStatus = PEN_OP;
     else if (e.getActionCommand() == "Line")
     opStatus = LINE_OP;
     else if (e.getActionCommand() == "Eraser")
     opStatus = ERASER_OP;
     else if (e.getActionCommand() == "Clear")
     opStatus = CLEAR_OP;
     else if (e.getActionCommand() == "Rectangle")
     opStatus = RECT_OP;
     else if (e.getActionCommand() == "Oval")
     opStatus = OVAL_OP;
     else if (e.getActionCommand() == "Filled Rectangle")
     opStatus = FRECT_OP;
     else if (e.getActionCommand() == "Filled Oval")
     opStatus = FOVAL_OP;
     else if (e.getActionCommand() == "Polygon")
     opStatus = POLY_OP;
     else if (e.getActionCommand() == "Spline")
     opStatus = SPLINE_OP;
     else if (e.getActionCommand() == "Black")
     colorStatus = 1;
     else if (e.getActionCommand() == "Blue")
     colorStatus = 2;
     else if (e.getActionCommand() == "Green")
     colorStatus = 3;
     else if (e.getActionCommand() == "Red")
     colorStatus = 4;
     else if (e.getActionCommand() == "Purple")
     colorStatus = 5;
     else if (e.getActionCommand() == "Orange")
     colorStatus = 6;
     else if (e.getActionCommand() == "Pink")
     colorStatus = 7;
     else if (e.getActionCommand() == "Gray")
     colorStatus = 8;
     else if (e.getActionCommand() == "Yellow")
     colorStatus = 9;
     else if (e.getActionCommand() == "User-Def")
     colorStatus = 10;
initialPolygon = true;
initialSpline = true;
switch (opStatus)
case PEN_OP : opStatusBar.setText("Pen");
break;
case LINE_OP : opStatusBar.setText("Line");
break;
case ERASER_OP: opStatusBar.setText("Eraser");
break;
case CLEAR_OP : clearPanel(drawPanel);
break;
case RECT_OP : opStatusBar.setText("Rectangle");
break;
case OVAL_OP : opStatusBar.setText("Oval");
break;
case FRECT_OP : opStatusBar.setText("Fill-Rectangle");
break;
case FOVAL_OP : opStatusBar.setText("Fill-Oval");
break;
case POLY_OP : opStatusBar.setText("Polygon");
break;
case SPLINE_OP: opStatusBar.setText("Spline");
break;
switch (colorStatus)
case 1: colorStatusBar.setText("Black");
break;
case 2: colorStatusBar.setText("Blue");
break;
case 3: colorStatusBar.setText("Green");
break;
case 4: colorStatusBar.setText("Red");
break;
case 5: colorStatusBar.setText("Purple");
break;
case 6: colorStatusBar.setText("Orange");
break;
case 7: colorStatusBar.setText("Pink");
break;
case 8: colorStatusBar.setText("Gray");
break;
case 9: colorStatusBar.setText("Yellow");
break;
case 10: colorStatusBar.setText("User Defined Color");
break;
setMainColor();
updateRGBValues();
public void adjustmentValueChanged(AdjustmentEvent e)
updateRGBValues();
public void clearPanel(JPanel drawPanel2)
opStatusBar.setText("Clear");
Graphics g = drawPanel2.getGraphics();
g.setColor(drawPanel2.getBackground());
g.fillRect(0,0,drawPanel2.getBounds().width,drawPanel2.getBounds().height);
public void penOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
if (initialPen)
setGraphicalDefaults(e);
initialPen = false;
g.drawLine(prevx,prevy,mousex,mousey);
if (mouseHasMoved(e))
mousex = e.getX();
mousey = e.getY();
g.drawLine(prevx,prevy,mousex,mousey);
prevx = mousex;
prevy = mousey;
public void lineOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
if (initialLine)
setGraphicalDefaults(e);
g.setXORMode(xorColor);
g.drawLine(Orx,Ory,mousex,mousey);
initialLine=false;
if (mouseHasMoved(e))
g.setXORMode(xorColor);
g.drawLine(Orx,Ory,mousex,mousey);
mousex = e.getX();
mousey = e.getY();
g.drawLine(Orx,Ory,mousex,mousey);
public void rectOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
if (initialRect)
setGraphicalDefaults(e);
initialRect = false;
if (mouseHasMoved(e))
g.setXORMode(drawPanel.getBackground());
g.drawRect(drawX,drawY,OrWidth,OrHeight);
mousex = e.getX();
mousey = e.getY();
setActualBoundry();
g.drawRect(drawX,drawY,OrWidth,OrHeight);
public void ovalOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
if (initialOval)
setGraphicalDefaults(e);
initialOval=false;
if (mouseHasMoved(e))
g.setXORMode(xorColor);
g.drawOval(drawX,drawY,OrWidth,OrHeight);
mousex = e.getX();
mousey = e.getY();
setActualBoundry();
g.drawOval(drawX,drawY,OrWidth,OrHeight);
public void frectOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
if (initialFRect)
setGraphicalDefaults(e);
initialFRect=false;
if (mouseHasMoved(e))
g.setXORMode(xorColor);
g.drawRect(drawX,drawY,OrWidth-1,OrHeight-1);
mousex = e.getX();
mousey = e.getY();
setActualBoundry();
g.drawRect(drawX,drawY,OrWidth-1,OrHeight-1);
public void fovalOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
if (initialFOval)
setGraphicalDefaults(e);
initialFOval = false;
if (mouseHasMoved(e))
g.setXORMode(xorColor);
g.drawOval(drawX,drawY,OrWidth,OrHeight);
mousex = e.getX();
mousey = e.getY();
setActualBoundry();
g.drawOval(drawX,drawY,OrWidth,OrHeight);
public void eraserOperation(MouseEvent e)
Graphics g = drawPanel.getGraphics();
if (initialEraser)
setGraphicalDefaults(e);
initialEraser = false;
g.setColor(mainColor.white);
g.fillRect(mousex-eraserLength, mousey-eraserLength,eraserLength*2,eraserLength*2);
g.setColor(Color.black);
g.drawRect(mousex-eraserLength,mousey-eraserLength,eraserLength*2,eraserLength*2);
prevx = mousex;
prevy = mousey;
if (mouseHasMoved(e))
g.setColor(mainColor.white);
g.drawRect(prevx-eraserLength, prevy-eraserLength,eraserLength*2,eraserLength*2);
mousex = e.getX();
mousey = e.getY();
g.setColor(mainColor.white);
g.fillRect(mousex-eraserLength, mousey-eraserLength,eraserLength*2,eraserLength*2);
g.setColor(Color.black);
g.drawRect(mousex-eraserLength,mousey-eraserLength,eraserLength*2,eraserLength*2);
prevx = mousex;
prevy = mousey;
public void polygonOperation(MouseEvent e)
if (initialPolygon)
prevx = e.getX();
prevy = e.getY();
initialPolygon = false;
else
mousex = e.getX();
mousey = e.getY();
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
g.drawLine(prevx,prevy,mousex,mousey);
prevx = mousex;
prevy = mousey;
public void splineOperation(MouseEvent e)
if(initialSpline)
initialSpline = false;
public boolean mouseHasMoved(MouseEvent e)
return (mousex != e.getX() || mousey != e.getY());
public void setActualBoundry()
if (mousex < Orx || mousey < Ory)
if (mousex < Orx)
OrWidth = Orx - mousex;
drawX = Orx - OrWidth;
else
drawX = Orx;
OrWidth = mousex - Orx;
if (mousey < Ory)
OrHeight = Ory - mousey;
drawY = Ory - OrHeight;
else
drawY = Ory;
OrHeight = mousey - Ory;
else
drawX = Orx;
drawY = Ory;
OrWidth = mousex - Orx;
OrHeight = mousey - Ory;
public void setGraphicalDefaults(MouseEvent e)
mousex = e.getX();
mousey = e.getY();
prevx = e.getX();
prevy = e.getY();
Orx = e.getX();
Ory = e.getY();
drawX = e.getX();
drawY = e.getY();
OrWidth = 0;
OrHeight = 0;
public void mouseDragged(MouseEvent e)
updateMouseCoordinates(e);
switch (opStatus)
case PEN_OP : penOperation(e);
break;
case LINE_OP : lineOperation(e);
break;
case RECT_OP : rectOperation(e);
break;
case OVAL_OP : ovalOperation(e);
break;
case FRECT_OP : frectOperation(e);
break;
case FOVAL_OP : fovalOperation(e);
break;
case ERASER_OP: eraserOperation(e);
break;
public void mouseReleased(MouseEvent e)
updateMouseCoordinates(e);
switch (opStatus)
case PEN_OP : releasedPen();
break;
case LINE_OP : releasedLine();
break;
case RECT_OP : releasedRect();
break;
case OVAL_OP : releasedOval();
break;
case FRECT_OP : releasedFRect();
break;
case FOVAL_OP : releasedFOval();
break;
case ERASER_OP : releasedEraser();
break;
public void mouseEntered(MouseEvent e)
updateMouseCoordinates(e);
public void setMainColor()
switch (colorStatus)
case 1 : mainColor = Color.black;
break;
case 2: mainColor = Color.blue;
break;
case 3: mainColor = Color.green;
break;
case 4: mainColor = Color.red;
break;
case 5: mainColor = Color.magenta;
break;
case 6: mainColor = Color.orange;
break;
case 7: mainColor = Color.pink;
break;
case 8: mainColor = Color.gray;
break;
case 9: mainColor = Color.yellow;
break;
case 10: mainColor = userDefinedColor;
break;
public void releasedPen()
initialPen = true;
public void releasedLine()
if ((Math.abs(Orx-mousex)+Math.abs(Ory-mousey)) != 0)
// System.out.println("Line has been released....");
initialLine = true;
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
g.drawLine(Orx,Ory,mousex,mousey);
public void releasedEraser()
initialEraser = true;
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor.white);
g.drawRect(mousex-eraserLength,mousey-eraserLength,eraserLength*2,eraserLength*2);
public void releasedRect()
initialRect = true;
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
g.drawRect(drawX,drawY,OrWidth,OrHeight);
public void releasedOval()
initialOval = true;
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
g.drawOval(drawX,drawY,OrWidth,OrHeight);
public void releasedFRect()
initialFRect = true;
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
g.fillRect(drawX,drawY,OrWidth,OrHeight);
public void releasedFOval()
initialFOval = true;
Graphics g = drawPanel.getGraphics();
g.setColor(mainColor);
g.fillOval(drawX,drawY,OrWidth,OrHeight);
public void updateMouseCoordinates(MouseEvent e)
String xCoor ="";
String yCoor ="";
if (e.getX() < 0) xCoor = "0";
else
xCoor = String.valueOf(e.getX());
if (e.getY() < 0) xCoor = "0";
else
yCoor = String.valueOf(e.getY());
mouseStatusBar.setText("x:"+xCoor+" y:"+yCoor);
public void updateRGBValues()
udefRedValue = redSlider.getValue();
udefGreenValue = greenSlider.getValue();
udefBlueValue = blueSlider.getValue();
if (udefRedValue > 255)
udefRedValue = 255;
if (udefRedValue < 0 )
udefRedValue =0;
if (udefGreenValue > 255)
udefGreenValue = 255;
if (udefGreenValue < 0 )
udefGreenValue =0;
if (udefBlueValue > 255)
udefBlueValue = 255;
if (udefBlueValue < 0 )
udefBlueValue =0;
redValue.setText(String.valueOf(udefRedValue));
greenValue.setText(String.valueOf(udefGreenValue));
blueValue.setText(String.valueOf(udefBlueValue));
userDefinedColor = new Color(udefRedValue,udefGreenValue,udefBlueValue);
userDefButton.setBackground(userDefinedColor);
Graphics g = udefdemcolPanel.getGraphics();
g.setColor(userDefinedColor);
g.fillRect(0,0,800,800);
public void mouseClicked(MouseEvent e)
updateMouseCoordinates(e);
switch (opStatus)
case 9 : splineOperation(e);
break;
case 10 : polygonOperation(e);
break;
public void mouseExited(MouseEvent e)
updateMouseCoordinates(e);
public void mouseMoved(MouseEvent e)
updateMouseCoordinates(e);
public void mousePressed(MouseEvent e)
updateMouseCoordinates(e);
Edited by: eclipse on Feb 19, 2008 6:29 AM

If you can't divide the class then you can't implement an MVC design methodology.
This class is a giant mess and can be EASILY broken down into smaller classes. Seperate the visual components into their own classes. Create Model objects that contain the data behind your visual components.
Split up your giant ActionListener into several smaller more specialized actionlisteners and create a Controller object that you can assign these listeners and models to. Allow the event handling to be done by the controller so it can propogate necessary data changes to the models, thus altering the Views.
Thats it in a nutshell. It is not an easy answer.

Similar Messages

  • Can anyone help me change the DOB on my sons profile for his apple I'd so I can setup family sharing? I originally put both ids in my name. He is 19 do it keeps saying needs my permission but no instructions in how to get that done?

    Can anyone help me change the DOB on my sons profile for his apple I'd so I can setup family sharing? I originally put both ids in my name. He is 19 do it keeps saying needs my permission but no instructions in how to get that done? His phone was stollen once last month need to get this done ASAP to prevent future headaches. Ty

    You can not change the date of birth on the account. Apple makes that clear up front when the account is created.
    The only way to "fix" this is going to be for him to create a new account with the correct information. Any apps purchased with the old one will need to be re-purchased with the new account. They can not be transferred.

  • Can someone help me change the line width of my numbers table, its not set to thin or none and its stuck on .25. its a spreadsheet i imported from excel.

    Can someone help me change the line width of my numbers table, its not set to thin or none and its stuck on pt25. its a spreadsheet i imported from excel.

    MR,
    Apparently the import wasn't a good one.
    The best option at this point might be to start a new table. Insert a new Table, Copy the old table cell range, select the first cell in the new table and Edit > Paste and Match Style. This will throw out all the old formatting. A bit of work, but a nice clean start.
    Jerry

  • Can anyone help me change fonts and size on my page? I don't understand the class questions?

    Can anyone help me change fonts and size on my page? I don't understand the class questions? All I want to do is change the font and size of a table or div.
    http://www.allgearinc.com/AG12SSWL-Swift.htm -One problem page

    If you want to change the fonts of the entire page then this code will do the trick:
    body {
        font-size: 16pt;
        color: silver;
         font-family: whatever, goes, here;
    If you want to change the fonts of ALL tables on a page then the code is something like this:
    table {
        font-size: 20pt;
        font-family: "Courier New", Courier, monospace;
        font-style: italic;
        font-weight: bold;
    what exactly do you want to change?  Can you be a bit specific so that Ben or Ken can give you the exact code and tell you about the short-hand method to write the code in one line.
    Have you bought a book on CSS yet?  If not, it is a good idea to get one as a reference.  Eric Meyer writes good books on CSS.

  • Can some help me change this text?

    My wife decided to buy Adobe CS4 Master Suite. None of us have had a chance to go on any courses yet but we intend to to learn how to use some of the relevent progrmas on it. Anyway a friend was doing some work for us recently and he is away on holiday. I forgot to ask him to change the hours on the leaflet he was doing for us. I for the life of me can't find a way to do it its only 2 lines of what looks like text to me. I say that as when I try to select it via acrobat using the touch up text tool it won't let me. The only way I can select any of the text is via the touch up object tool. After I have selected the relevent lines and right-click and select edit objects illustrator opens with the document and only the relevent text inside. I know there is no security on the document and i can move things around etc but can someone help me with this. I only want to change the hours and working days, that's it nothing fancy and have the text the same as what my friend has done. I have posted an attachment of what I am seeing in illustrator.

    pspage wrote:
    Thanks to you both for your responses. I tried the type tool and didn't get anywhere. Is there any way to change it if it was converted. I know when I look in the document setup it says it was created using adobe cs3 illustrator.
    Try opening it in Illustrator. click on text. If converted to outlines, just delete that bit and reenter the text you want in the ame area, using the saved version as a reference. Save file. Then save file as PDF.
    But if your friend created the file in Illustrator on your system, then just open the original Illustrator file and make the changes there...

  • Can anybody help me produce a Java code??? HELP GREATLY APPRECIATED!!!

    This is the goal:
    Write a program that produces block letters for the following letters which could be read into your program: A, B, C, E, F, G, H, I, L, O, P, T, or U.
    The user should input ONE letter from the keyboard. The user should also input a width as an integer to determine the width of the letters. This input should be at least 5 and up to 20; if the user enters less than 5 or more than 20, issue an error message for the user and quit the program.
    Replies are gratly appreciated!!!

    jk89computer wrote:
    To add to my original topic,
    My question is can anybody produce a java program that can do the following:
    Write a program that produces block letters for the following letters which could be read into your program: A, B, C, E, F, G, H, I, L, O, P, T, or U.
    The user should input ONE letter from the keyboard. The user should also input a width as an integer to determine the width of the letters. This input should be at least 5 and up to 20; if the user enters less than 5 or more than 20, issue an error message for the user and quit the program.
    For example, the letter A would be formed by:
    * *Thank you for adding more complete requirements for us to do your homework for you. We'll get right on that. Donuts are on the table, help yourself to them while you wait.

  • Can anyone help with changing colors without making a selection

    I've been trying to work the the script below. All the front most paths are black I want to change them all to yellow without having to select them first.
    Any help would be really appreciated. "I am a novice javascripter"
    var myStyles = app.activeDocument.pathItems;
    lastStyle=myStyles[myStyles.length-1]
    lastStyle.remove();
    frontStyle=myStyles[0]
    frontStyle.filled=true;
    // Sets the default fill color in the current document to yellow.
    if ( app.documents.length > 0 ) {
    //added
    frontPath = frontStyle;
    // Define the new color
    var newRGBColor = new RGBColor();
    newRGBColor.red = 255;
    newRGBColor.green = 255;
    newRGBColor.blue = 0;
    // Use the color object in the path item
    frontPath.filled = true;
    frontPath.fillColor = newRGBColor;

    A couple of pointers from one novice to another… With script there is NO need to deal with 'selections' to change the writeable properties of any object you simply need reference them with your code as you have done above… You can select art and you can deal with user selected art should you wish but as a rule for all else just target the object with your syntax… The best thing to do is to get your code working… as you know the current state to be ( a document open with you test objects in it ) once you have this then add to it by wrapping your conditionals around this… For example…
    if ( app.documents.length > 0 ) {
         // All your code goes inside this statement
    There is no point in getting the path items of the active document then checking later if there is a doc… Just a case of putting things in there respective order…
    The property filled… I only use to check the state, giving an object a fill will automatically update this… So here are your lines with a little reshuffle and a loop example…
    // Check there is a doc open
    if ( app.documents.length > 0 ) {
              // set a variable to the front document
              var doc = app.activeDocument;
              //Make your new color
              var rgbYellow = new RGBColor();
              // assign some values
              rgbYellow.red = 255;
              rgbYellow.green = 255;
              rgbYellow.blue = 0;
              // set variable to the collection ( list ) you want
              var paths = doc.pathItems;
              // loop this using a variable 'i'
              for ( var i = 0; i < paths.length; i++ ) {
                        paths[i].fillColor = rgbYellow;
              }; // this is your loop ending
    }; // this is the condition ending

  • I recentley bought a ipod touch set all language to English, billing to English etc. The problem i have is when i open itunes or Apps store on my ipod it is in German, I'm English so don't understand German.. Can anyone help to change language in store

    I recentley bought a ipod touch 5.01,set all language to English.....every thing i view is in English except when i view (open) itunes or apps store it is in German, I live in England, I was born in England, and i speak only English. I want my itunes and apps store to open and display in English. I have messaged the apple help and telephoned the help, both was helpful but no matter what i do in setting (even in reset, which i've done) my ipod will keep reverting back to German in Itunes and Apps store. All other data in my ipod is in English........just the itunes and apps store grrrrrrrrrrrr.
    Please help :-)

    You can only use the German iTunes/App store if you are located in Germany.  The German store is in the German language.

  • Can anyone help me with multiple Java scripts?

    I am totally new to java....... minus some scripts and stuff.. can anyone tell me how to put multiple java scripts onto a page??
    Ty,
    Godrio

    Totally new to Javascript too, I suppose. That's the language you use for scripting of web pages, not Java. This forum is for Java.

  • Can anyone help i changed my apple password and now i cant do updates

    i changed my apple id password and now it wont work for updates on my ipod touch

    Go to.....
    https://iforgot.apple.com/password/verify/appleid
    .....and fill out the info to get your Apple ID password.
    Please give me points if it helps!

  • Can someone help me change my security questions? Plz

    I bought a 15$ dollar prepaid card today and redeem It today. I was gonna use my money for a game I have called "Battle Camp" I was gonna buy something from the game but it asked for my security questions answers But I forgot them. Can someone plz help me out here?Plz and thanks :/

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (111930)

  • I forgot my security questions to my apple id, can you help me change them?

    I can't change my security questions, i forgotten the old answers.

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (117018)

  • Can someone help me, changing the screen AV

    ive been looking through my keyboard hotkeys for about 45 mins, and i cant seem to find the hotkey to change the imac screen AV for my mini tv port, as ive got my xbox connected to it....any ideas?

    My original problem occurred because my hard drive was one of the ones that was recalled so when I was in the process of restoring all of my data and software, it froze up during the registration process.  I finally called Apple Support and her suggestion was to restart it and this actually worked.

  • I need FireFox 3 for school. FireFox 4 is not compatible yet. Can you help me change back to FireFox 3?

    My online classes at the UoP math lab does not support the FireFox 4. It is asking for me to use
    Windows Vista™:
    IE7 and IE8
    Firefox 2.x and 3.x
    Chrome 7.0

    To downgrade to Firefox 3.6 first uninstall Firefox 4, but do not select the option to "Remove my Firefox personal data". If you select that option it will delete your bookmarks, passwords and other user data.
    You can then install the latest version of Firefox 3.6 available from http://www.mozilla.com/en-US/firefox/all-older.html - it will automatically use your current bookmarks, passwords etc.
    To avoid possible problems with downgrading, I recommend going to your profile folder and deleting the following files if they exist - extensions.cache, extensions.rdf, extensions.ini, extensions.sqlite and localstore.rdf. Deleting these files will force Firefox to rebuild the list of installed extensions, checking their compatibility, and reset toolbar customizations.
    For details of how to find your profile folder see https://support.mozilla.com/kb/Profiles

  • I have cc but lights room is coming up with a error ,An error occurred when attempting to change modules. can you help please

    i have cc but lights room is coming up with  ,An error occurred when attempting to change modules. can you help please

    Error changing modules | Lightroom
    Mylenium

Maybe you are looking for

  • HP Smart Web Printing feature, problem with IE7 and FireFox3

    "HP Smart Web Printing" problem with Internet Explorer 7 and FireFox 3I have a laptop that came with: Windows Vista Home Premium, Internet Explorer 7, FireFox 1.9. Everything worked fine. Recently I bought a "HP Photosmart C4580 All-in-One" printer t

  • How to convert date format in XI? Help!

    Hi Experts, PIP is the input for XI. The PIP has date as : <DateTimeStamp>20030515T000000.000Z</DateTimeStamp>. How to convert it into MM/DD/YYYY format in XI?  Thanks Gopal

  • How do I sync iTunes Library in Mac directly with IOS device if I use iTunes Match?

    When I turned on Itunes Match on the iPad and iPhone, my entire iTunes Library imported from the Mac using the iTunes sync process was moved to the Cloud. However, this means that I have to download all my songs again on my iPhone and iPad. I have 6,

  • Jdbc to rfc to jdbc scenario is not working

    Hi... We have done the JDBC to RFC to JDBC scenario using BPM, it was working fine in the last month. now we started testing the same scenario, that is not working. In SXMB_MONI it is showing only sender data is successful, it is not showing any RFC

  • Overloading with Generics

    If this is ok (compiles fine): void f(A a) {} void f(B b) {} shouldn't this also be ok? (compilation error) void f(Collection<A> ca) {} void f(Collection<B> cb) {} Is there some fundemental reason why this is disallowed or is this a missing feature?