Problem in a drawing program

Dear experts,
While working on a program,i am having a problem which is just killing me.This is a simple drawing program.On clicking draw button,user
can do free hand drawing.On clicking line he can stretch line to any
coordinate.Similarily do erasing etc.
Problem underlies in rectangle part.I am using some conditions.
Conditions are based on analysis.Fixx and Fixy are the points
when mouse is pressed.
Prevx and Prevy are coordinates which are stored before retrieving
newer ones.x and y are new coordinates.
I have marked the relevant code as part of code for easy understanding.
Problem is in behaviour for rectangle.If i draw twoards either side
it works well but the moment i drag right ,left,up down ,i get
patched near origin(fixed point) from where mouse was pressed ie
fixx,fixy.
I recommend if this could be copied as it is and run,the problem will come to light better.
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.util.*;
public class FProf extends JPanel implements MouseListener,ActionListener,MouseMotionListener
JFrame main_window;
int draw_mode,erase_mode,line_mode,box_mode;
double fixx,fixy;
double initx,inity;
double x,y;
JButton b_draw;
JButton b_erase;
JButton b_line;
JButton b_rec;
JPanel draw_panel;
JPanel bt_panel;
Graphics2D g2;
Point p;//Mouse pointer
Image image=null;
double prevx,prevy;
double c1,c2,c3,c4,c5,c6,c7,c8;
Stroke[] linestyles = new Stroke[] {
new BasicStroke(25.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL),
new BasicStroke(25.0f, BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER),
new BasicStroke(1.0f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_MITER),
new BasicStroke(25.0f, BasicStroke.CAP_ROUND,
BasicStroke.JOIN_ROUND), };
FProf()
draw_mode=0; //Inactive
erase_mode=0; //Inactive
addMouseListener(this);
addMouseMotionListener(this);
GridLayout l=new GridLayout(4,4);
main_window=new JFrame("Fountain Prof V.200");
bt_panel=new JPanel();
b_draw=new JButton ("Draw");
b_draw.addActionListener(this);
b_erase=new JButton("Erase");
b_erase.addActionListener(this);
b_line=new JButton("Line");
b_line.addActionListener(this);
b_rec=new JButton ("Box");
b_rec.addActionListener(this);
main_window.getContentPane().setLayout(new BorderLayout());
main_window.getContentPane().add("Center",this);
bt_panel.setLayout(l);
bt_panel.add(b_draw);
bt_panel.add(b_erase);
bt_panel.add(b_line);
bt_panel.add(b_rec);
main_window.getContentPane().add("East",bt_panel);
main_window.setSize(800,600);
main_window.show();
private void draw()
if ((erase_mode==1) &&(draw_mode==0) &&(line_mode==0)&&(box_mode==0)) {
g2.setPaintMode();
g2.setColor(Color.white);
g2.setStroke(linestyles[3]); // Select the line style to use
g2.draw(new Line2D.Double(initx,inity,x,y));
repaint();
else if ((draw_mode==1) && (line_mode==0) &&(erase_mode==0)&&(box_mode==0))
g2.setPaintMode();
g2.setColor(Color.black);
g2.setStroke(linestyles[2]); // Select the line style to use
g2.draw(new Line2D.Double(initx,inity,x,y));
repaint();
else if ((draw_mode==0) && (erase_mode==0) &&(line_mode==1)&&(box_mode==0))
repaint();
        else if ((draw_mode==0) && (erase_mode==0) &&(line_mode==0)&&(box_mode==1))
        repaint();
public void paintComponent(Graphics g)
super.paintComponent(g);
if (image == null)
System.out.print(getHeight());
g2=(Graphics2D) g;
image = createImage(getWidth(), getHeight());
g2 = (Graphics2D)image.getGraphics();
g2.setColor(Color.white);
g2.fillRect(0, 0, getWidth(), getHeight());
g2.setColor(Color.black);
Rectangle r = g.getClipBounds();
g.drawImage(image, r.x, r.y, r.width+r.x, r.height+r.y, r.x, r.y, r.width+r.x, r.height+r.y, null);
public void mouseReleased(MouseEvent e)
public void mouseEntered(MouseEvent e)
public void mouseExited(MouseEvent e)
public void change_cursor()
Toolkit tk=Toolkit.getDefaultToolkit();
if ((draw_mode==1)&&(erase_mode==0)) {
Image img=tk.getImage("Pen.gif");
Cursor dym=tk.createCustomCursor(img,new Point(10,10),null);
setCursor(dym);
else if ((erase_mode==1)&&(draw_mode==0)) {
Image img=tk.getImage("eraser.gif");
Cursor dym=tk.createCustomCursor(img,new Point(10,10),null);
setCursor(dym);
public void mouseClicked(MouseEvent e)
public void mouseDragged(MouseEvent e)
Point p;
if ((draw_mode ==1)||(erase_mode==1)) {
initx=x;inity=y;
p=e.getPoint();
x=p.getX();
y=p.getY();
draw();
if ((line_mode==1)&&(box_mode==0)) {
if (mousehasmoved(e)) {
prevx=x;prevy=y;
p=e.getPoint();
x=p.getX();
y=p.getY();
g2 = (Graphics2D)image.getGraphics();
g2.setColor(Color.black);
g2.setXORMode(Color.white);
g2.draw(new Line2D.Double(fixx,fixy,prevx,prevy)); //erasing previous line
draw();
g2.draw(new Line2D.Double(fixx,fixy,x,y)); //redrawing newer one
draw();
if ((line_mode==0)&&(box_mode==1)) {
if (mousehasmoved(e)) {
prevx=x;prevy=y;
p=e.getPoint();
x=p.getX();
y=p.getY();
g2 = (Graphics2D)image.getGraphics();
g2.setColor(Color.black);
g2.setXORMode(Color.white);
if ((x<=fixx) && (y>=fixy)) {
c1=x;c2=fixy;c3=fixx-x;c4=y-fixy;c5=prevx;c6=fixy;c7=fixx-prevx;c8=prevy-fixy;
else if ((x>=fixx)&&(y>=fixy)) {
c1=fixx;c2=fixy;c3=x-fixx;c4=y-fixy;c5=fixx;c6=fixy;c7=prevx-fixx;c8=prevy-fixy;
else if ((x>=fixx)&&(y<=fixy)) {
c1=fixx;c2=y;c3=x-fixx;c4=fixy-y;c5=fixx;c6=prevy;c7=prevx-fixx;c8=fixy-prevy;
else if ((x<=fixx)&&(y<=fixy)) {
c1=x;c2=y;c3=fixx-x;c4=fixy-y;c5=prevx;c6=prevy;c7=fixx-prevx;c8=fixy-prevy;
g2.draw(new  Rectangle2D.Double(c5,c6,c7,c8));
draw();
g2.draw(new  Rectangle2D.Double(c1,c2,c3,c4));
draw();
}public void mouseMoved(MouseEvent e)
p=e.getPoint();
x=p.getX();
y=p.getY();
main_window.setTitle("X- "+x+" "+"Y- "+y);
initx=x;inity=y; //Get me current position
if ((draw_mode==1)||(erase_mode==1)) {
//change_cursor();
else {
setCursor(Cursor.getDefaultCursor());
public void mousePressed(MouseEvent ex)
if ((draw_mode==0) && (erase_mode==0) &&((line_mode==1)||(box_mode==1))) {
fixx=ex.getX();fixy=ex.getY();
public void actionPerformed(ActionEvent ev)
Object ob=ev.getSource();
if (ob==b_draw) {
draw_mode=1;erase_mode=0;line_mode=0;
box_mode=0;
if (ob==b_erase) {
erase_mode=1;draw_mode=0;line_mode=0;
box_mode=0;
if (ob==b_line) {
erase_mode=0;draw_mode=0;line_mode=1;
box_mode=0;
if (ob==b_rec) {
erase_mode=0;draw_mode=0;line_mode=0;box_mode=1;
public static void main(String args[])
new FProf();
public boolean mousehasmoved (MouseEvent e)
return((initx != e.getX()) ||(inity!=e.getY()));
}}

change your mouseDragged method to something like:
    public void mouseDragged(MouseEvent e)
        Point p;
        if ((draw_mode == 1) || (erase_mode == 1))
            initx = x;
            inity = y;
            p = e.getPoint();
            x = p.getX();
            y = p.getY();
            draw();
        if ((line_mode == 1) && (box_mode == 0))
            if (mousehasmoved(e))
                prevx = x;
                prevy = y;
                p = e.getPoint();
                x = p.getX();
                y = p.getY();
                g2 = (Graphics2D) image.getGraphics();
                g2.setColor(Color.black);
                g2.setXORMode(Color.white);
                g2.draw(new Line2D.Double(fixx, fixy, prevx, prevy)); // erasing
                                                                        // previous
                                                                        // line
                draw();
                g2.draw(new Line2D.Double(fixx, fixy, x, y)); // redrawing
                                                                // newer one
                draw();
        if ((line_mode == 0) && (box_mode == 1))
            if (mousehasmoved(e))
                prevx = x;
                prevy = y;
                p = e.getPoint();
                x = p.getX();
                y = p.getY();
                g2 = (Graphics2D) image.getGraphics();
                g2.setColor(Color.black);
                g2.setXORMode(Color.white);
                 * calculate the former rectangle - it does not depend to
                 * the new rectangle!
                if((prevx <= fixx) && (prevy >= fixy))
                    c5 = prevx;
                    c6 = fixy;
                    c7 = fixx - prevx;
                    c8 = prevy - fixy;                   
                else
                    if ((prevx >= fixx) && (prevy >= fixy))
                        c5 = fixx;
                        c6 = fixy;
                        c7 = prevx - fixx;
                        c8 = prevy - fixy;
                    else
                        if ((prevx >= fixx) && (prevy <= fixy))
                            c5 = fixx;
                            c6 = prevy;
                            c7 = prevx - fixx;
                            c8 = fixy - prevy;
                        else
                            if ((prevx <= fixx) && (prevy <= fixy))
                                c5 = prevx;
                                c6 = prevy;
                                c7 = fixx - prevx;
                                c8 = fixy - prevy;
                 * calculate the new rectangle here
                if ((x <= fixx) && (y >= fixy))
                    c1 = x;
                    c2 = fixy;
                    c3 = fixx - x;
                    c4 = y - fixy;
                else
                    if ((x >= fixx) && (y >= fixy))
                        c1 = fixx;
                        c2 = fixy;
                        c3 = x - fixx;
                        c4 = y - fixy;
                    else
                        if ((x >= fixx) && (y <= fixy))
                            c1 = fixx;
                            c2 = y;
                            c3 = x - fixx;
                            c4 = fixy - y;
                        else
                            if ((x <= fixx) && (y <= fixy))
                                c1 = x;
                                c2 = y;
                                c3 = fixx - x;
                                c4 = fixy - y;
                g2.draw(new Rectangle2D.Double(c5, c6, c7, c8));
                draw();
                g2.draw(new Rectangle2D.Double(c1, c2, c3, c4));
                draw();
    }why?
You calculated the former rectangle in dependence to the newly created one. It does not depend on that, but needs its own if statements. I'm sure you will understand what I mean when looking at the method.

Similar Messages

  • Problem with simple drawing program - please help!

    Hi,
    I've only just started using Java and would appreciate some help with a drawing tool application I'm currently trying to write.
    The problem is that when the user clicks on a button at the bottom of the frame, they are then supposed to be able to produce a square or circle by simply clicking on the canvas.
    Unfortunately, this is not currently happening.
    Please help!
    The code for both classes is as follows:
    1. DrawToolFrame Class:
    import java.awt.*;
    import java.awt.event.*;
    public class DrawToolFrame extends Frame
    implements WindowListener
    DrawToolCanvas myCanvas;
    public DrawToolFrame()
    setTitle("Draw Tool Frame");
    addWindowListener(this);
    Button square, circle;
    Panel myPanel = new Panel();
    square = new Button("square"); square.setActionCommand("square");
    circle = new Button("circle"); circle.setActionCommand("circle");
    myPanel.add(square); myPanel.add(circle);
    add("South", myPanel);
    DrawToolCanvas myCanvas = new DrawToolCanvas();
    add("Center", myCanvas);
    square.addMouseListener(myCanvas);
    circle.addMouseListener(myCanvas);
    public void windowClosing(WindowEvent event) { System.exit(0); }
    public void windowOpened(WindowEvent event) {}
    public void windowIconified(WindowEvent event) {}
    public void windowDeiconified(WindowEvent event) {}
    public void windowClosed(WindowEvent event) {}
    public void windowActivated(WindowEvent event) {}
    public void windowDeactivated(WindowEvent event) {}
    2. DrawToolCanvas Class:
    import java.awt.*;
    import java.awt.event.*;
    public class DrawToolCanvas
    extends Canvas
    implements MouseListener, ActionListener {
    String drawType="square";
    Point lastClickPoint=null;
    public void drawComponent(Graphics g) {
    if (lastClickPoint==null) {
    g.drawString("Click canvas first",20,20);
    } else {
    if (drawType.equals("square")) {
    square(g);
    else if (drawType.equals("circle")) {
    circle(g);
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("square"))
    drawType="square";
    else if (event.getActionCommand().equals("circle"))
    drawType="circle";
    repaint();
    public void mouseReleased(MouseEvent e) {
    lastClickPoint=e.getPoint();
    public void square(Graphics g) {
    g.setColor(Color.red);
    g.fillRect(lastClickPoint.x, lastClickPoint.y, 40, 40);
    g.setColor(Color.black);
    public void circle(Graphics g) {
    g.setColor(Color.blue);
    g.fillOval(lastClickPoint.x, lastClickPoint.y, 40, 40);
    g.setColor(Color.black);
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}
    public void mousePressed(MouseEvent e) {}
    public void mouseClicked(MouseEvent e) {}
    Any help would be appreciated!

    Some of the problems:
    1) nothing calls drawComponent(Graphics g)
    2) Paint(Graphics g) has not been overriden
    3) myCanvas is declared twice: once as an instance variable to DrawToolFrame, and once local its constructor. Harmless but distracting.

  • Blackberry Desktop Software has stopped working. A problem has caused the program to stop...

    I have a Tour 9630 and just installed v6.0 and receiving an error window "Blackberry Desktop Software has stopped working. A problem as caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available."  I have not received any message from Windows after 2 days.  Has anyone experienced this problem?  If so, I would appreciate any guidance.  I have Windows 7, if that matters. Thank you. in advance.

    Hi somewhatstock
    How far did you get with them? Did they have any ideas what might be causing the problem? Trying to work on it myself, so trying to eliminate what others might have tried. Curious why it works on my Desktop however. Losing tethering really causes problems as I rely on tethering with my laptop quite a lot.  
    Any information most welcome,
    regards,
    John

  • Problem in submiting standard program via job

    Hi Experts ,
       I have developed  programs for creating and posting return lots and payment lots for multiple incoming  files. For this i have submited standard  program of FPB3 and FPB5 transaction .  What happened is ,  if the child program fails due to some reason for one file , it is not coming back to the mother program and as a result other files remain unprocessed . So for this i tried with submiting the child program Via job so that if child program fails , only that job will fail and the mother program will not fail , so rest  files will be processed .
    But the problem is the child program (standard program of FPB3/FPB5 )  is not working by this i.e.  the lots are not getting created adn.
    Awaiting for any respone .

    Hi,
    If you are using Submit via Job, you need to use JOB_OPEN and JOB_CLOSE FM's.
    JOB_OPEN : Create a new job and return you the job number which you use in Submit
    JOB_CLOSE: Will set the release conditions of the job.
    Example:
    DATA: number TYPE tbtcjob-jobcount,
          name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT submitable TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                        WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    Jovito

  • Unable to Install Office 2013 Pro and I get returned message "Couldn't Install We're sorry, we had a problem installing your office programs"

    I purchased 40 licenses of Office 2013 Pro from a vendor in the US and received 40 product keys along with the URL to download the software - 1 for each pc activation codes.  I have done a few and were all successful.  I am now trying
    install on 2 other pcs and I am having real difficulty and getting error message each time I try to install.  I am able to download the installer and copied to my desktop and when I double click to execute it, it gives me the option to run on the next
    screen.  I click on run then it gives me the message " do you want to allow the program to make changes to this computer".  When I press YES, nothing happens and minutes later, I get the flwg message everytime, "Couldn't
    install"  "We're sorry, we had a problem installing your office programs.  Is your internet connection working?  Do you have enough free space on your main hard drive?  Please try installing again after you've checked the above. 
    Go online for additional help.
    I have lots of space and my pc is Win 7 64 bit new machine.  I have connection to internet and I was able to get the others done.  What is the problem here and I have been trying to work late night hours to try to install the program and I am unable
    to successfully get it to work.  I receive the same message every time and I followed all the recommended troubleshoot steps I found on the internet.  Someone please help.  I have to install all for all the PCs we have for our organization. 
    Please respond because I am really stuck.
    Gabe

    Hi Gabe,
    First, please check the suggestion above is helpful. I also suggest you removing all version of Office and re-install Office 2013.
    We can try to run the application as an administrator and check if it works.
     1. Right click the shortcut of the application or the main application.
     2. Select properties.
     3. Select compatibility tab and select "Run this program as an administrator."
    If there is anything I can do for you about this issue, don't hesitate to tell me.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Windows 8 - Photoshop CS5.1 crashes upon startup. Error message: "Adobe Photoshop CS5.1 has stopped working.A problem caused by the program to stop working correctly. Windows will close the program and notify you if a solution is available."

    Hello!
    I've had the student version of the Adobe Creative Suite 5.5 Design Premium software for several years now.
    When I received my Windows 8 computer I installed the software with no issue.
    Last week when I tried opening Photoshop I get the following error: "Adobe Photoshop CS5.1 has stopped working.A problem caused by the program to stop working correctly. Windows will close the program and notify you if a solution is available."
    I deactivated and uninstalled the entire Creative Suite then reinstalled it. I am able to open the other programs, but still receive the same message for Photoshop.
    What can I do?

    I found the issue was with the Nik Filters I was using. The filters were messing with Photoshop's initializing. I uninstalled and reinstalled the filters and now Photoshop works like a charm.
    It appears this forum is dead?!
    Thankfully, I was able to troubleshoot on my own and figured out the problem...

  • Upgraded to 10.6.7 and now having various issues with Appleworks Drawing program.

    HELP...I just upgraded to 10.6.7 and now my Appleworks drawing program is slow - beach balls all the time, I can not copy into other programs, copy and paste messes with the formatting, fills and lines disappear, Fonts are messed up when copied...ON and ON..I Installed rosetta from the 10.6.7 install disk but still no luck.   Any advice is appreciated, I am in a crunch with drawing deadlines an no time to learn another drawing program..Yes I am old school.and HELP! 

    You could look at EazyDraw: the version on the website is $95 download, $139 box and manual: it will open ClarisWorks drawings and is a powerful vector drawing program which makes a good replacement for Appleworks.
    There is a much cheaper version in the Mac App Store but note that this version does not open AppleWorks documents.

  • ITunes keeps shutting down when I open it up.  The message says iTunes has stopped working.  A problem has caused the program to stop working correctly.  Windows will close the program and notify you if a solutions is found.

    iTunes keeps shutting down when I open it up.  The message says iTunes has stopped working.  A problem has caused the program to stop working correctly.  Windows will close the program and notify you if a solutions is found.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried something like the above then try opening iTunes in safe mode (press and hold down CTRL+SHIFT as you start iTunes) then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud Purchases. You may find that iTunes opens normally now.
    tt2

  • Problem in compiling a program

    i am using an API, and have a problem in executing a program which uses the API
    the source code is here
    import java.io.*;
    import org.apache.lucene.document.*;
    import org.apache.lucene.index.*;
    import org.apache.lucene.analysis.*;
    import org.apache.lucene.analysis.standard.*;
    import java.util.*;
    import java.io.IOException;
    public class Indexer {
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    throw new Exception("Usage: java " + Indexer.class.getName()
    + " <index dir> <data dir>");
    File indexDir = new File(args[0]);
    File dataDir = new File(args[1]);
    long start = new Date().getTime();
    int numIndexed = index(indexDir, dataDir);
    long end = new Date().getTime();
    System.out.println("Indexing " + numIndexed + " files took "
    + (end - start) + " milliseconds");
    // open an index and start file directory traversal
    public static int index(File indexDir, File dataDir)
    throws IOException {
            if (!dataDir.exists() || !dataDir.isDirectory()) {
    throw new IOException(dataDir
    + " does not exist or is not a directory");
    IndexWriter writer = new IndexWriter(indexDir,
    new StandardAnalyzer(), true);
    writer.setUseCompoundFile(false);
    indexDirectory(writer, dataDir);
    int numIndexed = writer.docCount();
    writer.optimize();
    writer.close();
    return numIndexed;
    // recursive method that calls itself when it finds a directory
    private static void indexDirectory(IndexWriter writer, File dir)
    throws IOException {
    File[] files = dir.listFiles();
    for (int i = 0; i < files.length; i++) {
    File f = files;
    if (f.isDirectory()) {
    indexDirectory(writer, f);
    } else if (f.getName().endsWith(".txt")) {
    indexFile(writer, f);
    // method to actually index a file using Lucene
    private static void indexFile(IndexWriter writer, File f)
    throws IOException {
    if (f.isHidden() || !f.exists() || !f.canRead()) {
    return;
    System.out.println("Indexing " + f.getCanonicalPath());
    Document doc = new Document();
    doc.add(Field.Text("contents", new FileReader(f)));
    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
    writer.addDocument(doc);
    and the errors are C:\Documents and Settings\Sumit\Desktop\db>javac Indexer.java
    Indexer.java:60: cannot find symbol
    symbol : method Text(java.lang.String,java.io.FileReader)
    location: class org.apache.lucene.document.Field
    doc.add(Field.Text("contents", new FileReader(f)));
    ^
    Indexer.java:61: cannot find symbol
    symbol : method Keyword(java.lang.String,java.lang.String)
    location: class org.apache.lucene.document.Field
    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
    ^
    2 errors
    this program came with the API, but i dont know why it is not executing, ask me if you need any other file of API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    ping.sumit wrote:
    i am using an API, and have a problem in executing a program which uses the API and you will likely need to find a forum or other source which supports this API. Much luck.

  • Problem with a wrapper program.

    Hi all,
    we are facing problem with a wrapper program,through which we are calling three different xml reports.
    when we independently submit these xml reports thorugh front end .
    All the three programs run successfully & gives the desired output.
    but when we run this through wrapper program.
    All ths three programs run successfully ,but don't give output,i.e. output file comes as blank.
    when I 'VIEW DETAILS" on the SRS window, the only difference between the independent program & the report through wrapper program is the 'UPON COMPLETION..'part.
    The 'UPON COMPLETION..'part. for the independent program shows the RTF Template Layout name ,while the program submitted through the wrapper program doesn't show the layout name.
    i have registered all the three reports as XML REPORTS,while the wrapper program as "package_name.procedure_name" & 'TEXT' as an output format.
    can anybody tell us , the problem??
    thanks.

    Wow, that's a lot of work. This isn't any different than PL/SQL in the real Oracle world. Parameters are named or positional. Named input uses the assignment operator of =>. Positional takes them in order per the procedure/function signature. In SQL*Plus, do a desc on fnd_request (owned by apps) and tell us what the "default" column represents.
    If you have been typing in all arguments, figure out how many times you've done that, how much time it took, multiply it by your hourly rate, and then tell your manager you owe your company that amount of money for having wasted so much time.
    function submit_request (
                     application IN varchar2 default NULL,
                     program     IN varchar2 default NULL,
                     description IN varchar2 default NULL,
                     start_time  IN varchar2 default NULL,
                     sub_request IN boolean  default FALSE,
                     argument1   IN varchar2 default CHR(0),
                     argument2   IN varchar2 default CHR(0),
                       argument3   IN varchar2 default CHR(0),
                     argument4   IN varchar2 default CHR(0),
                     argument5   IN varchar2 default CHR(0),
                     argument6   IN varchar2 default CHR(0),
                     argument7   IN varchar2 default CHR(0),
                     argument8   IN varchar2 default CHR(0),
                     argument9   IN varchar2 default CHR(0),
                     argument10  IN varchar2 default CHR(0),
                     argument11  IN varchar2 default CHR(0),
                     argument12  IN varchar2 default CHR(0),
                       argument13  IN varchar2 default CHR(0),
                     argument14  IN varchar2 default CHR(0),
                     argument15  IN varchar2 default CHR(0),
                     argument16  IN varchar2 default CHR(0),
                     argument17  IN varchar2 default CHR(0),
                     argument18  IN varchar2 default CHR(0),
                     argument19  IN varchar2 default CHR(0),
                     argument20  IN varchar2 default CHR(0),
                     argument21  IN varchar2 default CHR(0),
                     argument22  IN varchar2 default CHR(0),
                       argument23  IN varchar2 default CHR(0),
                     argument24  IN varchar2 default CHR(0),
                     argument25  IN varchar2 default CHR(0),
                     argument26  IN varchar2 default CHR(0),
                     argument27  IN varchar2 default CHR(0),
                     argument28  IN varchar2 default CHR(0),
                     argument29  IN varchar2 default CHR(0),
                     argument30  IN varchar2 default CHR(0),
                     argument31  IN varchar2 default CHR(0),
                     argument32  IN varchar2 default CHR(0),
                       argument33  IN varchar2 default CHR(0),
                     argument34  IN varchar2 default CHR(0),
                     argument35  IN varchar2 default CHR(0),
                     argument36  IN varchar2 default CHR(0),
                     argument37  IN varchar2 default CHR(0),
                       argument38  IN varchar2 default CHR(0),
                     argument39  IN varchar2 default CHR(0),
                     argument40  IN varchar2 default CHR(0),
                     argument41  IN varchar2 default CHR(0),
                       argument42  IN varchar2 default CHR(0),
                     argument43  IN varchar2 default CHR(0),
                     argument44  IN varchar2 default CHR(0),
                     argument45  IN varchar2 default CHR(0),
                     argument46  IN varchar2 default CHR(0),
                     argument47  IN varchar2 default CHR(0),
                       argument48  IN varchar2 default CHR(0),
                     argument49  IN varchar2 default CHR(0),
                     argument50  IN varchar2 default CHR(0),
                     argument51  IN varchar2 default CHR(0),
                       argument52  IN varchar2 default CHR(0),
                     argument53  IN varchar2 default CHR(0),
                     argument54  IN varchar2 default CHR(0),
                     argument55  IN varchar2 default CHR(0),
                     argument56  IN varchar2 default CHR(0),
                     argument57  IN varchar2 default CHR(0),
                     argument58  IN varchar2 default CHR(0),
                     argument59  IN varchar2 default CHR(0),
                     argument60  IN varchar2 default CHR(0),
                     argument61  IN varchar2 default CHR(0),
                     argument62  IN varchar2 default CHR(0),
                       argument63  IN varchar2 default CHR(0),
                     argument64  IN varchar2 default CHR(0),
                     argument65  IN varchar2 default CHR(0),
                     argument66  IN varchar2 default CHR(0),
                     argument67  IN varchar2 default CHR(0),
                     argument68  IN varchar2 default CHR(0),
                     argument69  IN varchar2 default CHR(0),
                     argument70  IN varchar2 default CHR(0),
                     argument71  IN varchar2 default CHR(0),
                     argument72  IN varchar2 default CHR(0),
                       argument73  IN varchar2 default CHR(0),
                     argument74  IN varchar2 default CHR(0),
                     argument75  IN varchar2 default CHR(0),
                     argument76  IN varchar2 default CHR(0),
                     argument77  IN varchar2 default CHR(0),
                     argument78  IN varchar2 default CHR(0),
                     argument79  IN varchar2 default CHR(0),
                     argument80  IN varchar2 default CHR(0),
                     argument81  IN varchar2 default CHR(0),
                     argument82  IN varchar2 default CHR(0),
                       argument83  IN varchar2 default CHR(0),
                     argument84  IN varchar2 default CHR(0),
                     argument85  IN varchar2 default CHR(0),
                     argument86  IN varchar2 default CHR(0),
                     argument87  IN varchar2 default CHR(0),
                     argument88  IN varchar2 default CHR(0),
                     argument89  IN varchar2 default CHR(0),
                     argument90  IN varchar2 default CHR(0),
                     argument91  IN varchar2 default CHR(0),
                     argument92  IN varchar2 default CHR(0),
                       argument93  IN varchar2 default CHR(0),
                     argument94  IN varchar2 default CHR(0),
                     argument95  IN varchar2 default CHR(0),
                     argument96  IN varchar2 default CHR(0),
                     argument97  IN varchar2 default CHR(0),
                     argument98  IN varchar2 default CHR(0),
                     argument99  IN varchar2 default CHR(0),
                     argument100  IN varchar2 default CHR(0))
                     return number;

  • After updating iTunes windows says problem exists and closes program

    I installed the new update 11.2 etc and now when I open iTunes a windows box pops upand says there is a problem and closes the
    program.  Now I can't even get to any of my music.  I am afraid to uninstall and re-install because I am not technically saavy.  I did
    go to the Programs listing and hit Repair and even after that it won't work.  What a mess.  I haven't been able to use the Burn Disc
    for quite a while now.  Should I just take my computer in for repair? PLEEEEEZE ANSWER.

    Hello, rachel a. 
    Thank you for visiting Apple Support Communities.
    Here are a couple troubleshooting articles that I would recommend going through.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    iTunes for Windows: Unable to install or open
    http://support.apple.com/kb/ts5376
    Cheers,
    Jason H.

  • Problem in Module Pool Program

    Hi All,
    I got one problem in Module pool program.Im using table control.when selected multiple coloms by table control option left top.
    when I want to de-select one by one,unable to de-select. Please suggest me.
    thank you,
    Anu.

    Thank You All.
    Solved my self.
    The coding as below.
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN SUB INCLUDING SY-REPID '110'.
      LOOP AT GT_ITAB INTO WA WITH CONTROL VCONTROL.
        MODULE SET.
        MODULE STATUS_0100.
      ENDLOOP.
    PROCESS AFTER INPUT.
       CALL SUBSCREEN SUB.
      LOOP AT GT_ITAB .
        CHAIN.
          FIELD WA-EBELN.
          FIELD WA-EMATN.
          FIELD WA-EBELP.
          FIELD WA-MATNR.
          FIELD WA-MARK.
          MODULE MODIFY ON CHAIN-REQUEST.
        ENDCHAIN.
      ENDLOOP.
        MODULE USER_COMMAND_0100.
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
        WHEN 'SAVE'.
          PERFORM SAVE_VARIANT.
          PERFORM VARIANT_EXISTS.
        WHEN 'SEL'.
          LOOP AT GT_ITAB INTO WA.
            WA-MARK = 'X'.
            MODIFY GT_ITAB FROM WA .
          ENDLOOP.
    endmodule.
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'ZTESTING'.
      SET TITLEBAR 'ZTEST'.
      SET PF-STATUS  'ZTESTING' EXCLUDING IT_EXTAB.
      MOVE:WA-EBELN TO EKKO-EBELN,
           WA-EBELP TO EKPO-EBELP,
           WA-MATNR TO WA-MATNR.
      MOVE:WA-EMATN TO WA-EMATN.
    MODIFY GT_ITAB FROM WA INDEX VCONTROL-CURRENT_LINE.
      VCONTROL-LINES = SY-DBCNT.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE SET OUTPUT.
      SET CURSOR FIELD CURSORFIELD OFFSET POS.
    ENDMODULE.                 " SET  OUTPUT
    Thank You,
    Anu.

  • Is it possible to have an Infinite canvas drawing program

    Hi
    Is it possible to have an Infinite canvas in a drawing program?
    The sort of Features that make sense would be
    Zoom In and out
    All other basic drawing tool capabilities

    That's not right, hereafter. So long as the canvas is virtualized it can be theoretically infinite. It only needs memory and disk space for the sections actually displayed.
    Major Solutions, there are low level facilities to enable what you describe, but you'd need to implement the details (in particular the drawing tools) yourself. As hereafter notes there are some practical issues depending on your definition of infinite.
    For very large canvases take a look at Direct2D and the VirtualSurfaceImageSource.
    --Rob

  • Problem with a compiled program

    Hello,
    I have a problem with a compiled program on labview 6i.
    This program used a serial port (COM1 or COM2).
    During the launching of the ".exe ", a fatal error occurs.
    Here this error:
    => APPLICATION caused an invalid page fault in
    => module LVRT.DLL at 0167:30164426.
    Can somebody help me?
    Regards
    Cedric

    Cedric,
    This problem was fixed in the LabVIEW 6.0.2 update. You can download this update (along with the updated runtime engine) from our website.
    Good luck with your application, and have a pleasant day.
    Sincerely,
    Darren N.
    NI Applications Engineer
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Problem with a Factorial Program

    I want to write a program that displays the factorial of a number, the problem is that my program doesn't work. Who can help me?? If I enter a number, nothing happens!
    import javax.swing.JOptionPane;
    public class Homework4_32
         public static void main( String args[] )
         String X;
         int x;
         int y;
    int result;
         X = JOptionPane.showInputDialog( "Enter a nonnegative integer" );
         x = Integer.parseInt( X );
         y = x-1;
         do
         result = x * y;
         } while ( x >= 1 );
         JOptionPane.showMessageDialog(
              null, " The result is " +result);
    }

    try
    int result = 1;
    x = Integer.parseInt(X);
    do
    result *= x--;
    } while ( x >= 1 );

Maybe you are looking for

  • Mbean for creation of MultiDataSource

    Hi, I need some help for MultiDataSource. I know how to create the DataSource. by using mbeanhome.createAdminMBean(beanname, beantype, DomainName); Can anyone tell me are MultiDataSource are created in the same way. if yes what is the Bean type and a

  • W520 Docking station usb ports

    Ok so I have a W520 and have it in it's proper docking station.  I was wondering if the USB ports on the BACK of the docking station are USB 3.0, or 2.0.  I'd prefer if it was 3.0 but theres no way to tell.  Hoping someone could help me out. Thanks!

  • Query can't be rewritten by a Materialized View

    Hi All, The structure of Materialized view looks like: select T1483342.MEASR_AMT as c4, T1482315.MTH_NAME as c8 from MMM T1483380, AN_VSBL_IND_LKP T1483226, AMM T1484452 , ND_ASDN_DIM T1483850, _FDIM                                    T1482018, R_DIM

  • Problem installing illustrator cc in a second language

    Hello I ve installed illustrator cc in italian, now like to install in english too. I ve done as described in your tutorial video. set english language in adobe cloud manager, downloaded and installed illustrator again, set english as language in win

  • Need help tuning package.

    Hi, I am trying to speed up a package I created which currently runs for more than an hour. What I have is a source table which has approximately 16M records. In the report I'm creating, I need to re-use this table 48 times to get the sum of a column