Always return "Image Object" in Toolkit.getDefaultToolkit().getImage();

A : Image source = Toolkit.getDefaultToolkit().getImage("C:/aa.jpg");
B : Image source = Toolkit.getDefaultToolkit().getImage("");
generally, B may be null. but it is not null.
so I look at "javax.swing.ImageIcon" class :
<Part of ImageIcon source>
public ImageIcon(String filename, String description) {
     image = Toolkit.getDefaultToolkit().getImage(filename);
if (image == null) { //This code is invaild.
return; //never return.
     this.filename = filename;
this.description = description;
     loadImage(image);
Do you thinking it?
Bug?

getimage may not return null in the current implementation but they wanted maybe get sure that no nullpointerexception occures.
it's not a bug - it's a feature :-)

Similar Messages

  • How to use Toolkit.getDefaultToolkit().getImage in JPanel in Java Swing

    Hi Sir,
    I want to know how to use Toolkit.getDefaultToolkit.getImage()
    in JPanel (ie) the class that extends the JPanel.There is no problem to include the Toolkit.getDefaultToolkit.getImage()in JFrame.It is displaying it without any problem.But in JPanel it is showing a problem of cannot resolve symbol.Here i can't use JFrame instead of
    JPanel.So how to solve the problem.Pls.do send the code of how to do this.It is Urgent.
    Thanx,
    M.Ananthu

    you use Toolkit.getDefaultToolkit.getImage() in a JPanel exactly the same way you do in a JFrame.
    You are getting a compile message "cannot resolve symbol". You have made a programming error and since you have not included code there is no way to guess what you did wrong.

  • Image object getWidth() and getHeight() returning -1

    Hello all,
    I'm currently unit testing a pretty simple utility that calculates a new image position, given a handful of parameters (including image width and height).
    The problem I'm running into is this:
    The image width/height don't always load immediately. My only clue so far from searching the web is this:
    http://download-llnw.oracle.com/javase/6/docs/api/java/awt/Image.html#getWidth%28java.awt.image.ImageObserver%29
    which states Determines the width of the image. If the width is not yet known, this method returns -1 and the specified ImageObserver object is notified later. In my JUnit test harness, I have the following code to load my images, using Toolkit:
    public static final String TEST_IMG_1_PATH = "images/apple_logo.png";
    public static final String TEST_IMG_2_PATH = "images/dude.png";
    private Image testImage1, testImage2;
    @Before
    public void setUp() throws Exception {
         testImage1 = Toolkit.getDefaultToolkit().getImage(TEST_IMG_1_PATH);
         testImage2 = Toolkit.getDefaultToolkit().getImage(TEST_IMG_2_PATH);
         // check the image size to see if they are fully loaded:
         System.out.println(testImage1.getWidth(null));
         System.out.println(testImage1.getHeight(null));
         System.out.println(testImage2.getWidth(null));
         System.out.println(testImage2.getHeight(null));
    }Because the utility method I'm testing heavily depends on the image size, my tests intermittently fail. When I run this, I typically get -1 for all of the image dimension checks (see the above println()s).
    -1
    -1
    -1
    -1Even with these "-1" results, my test still passes... which means at some point before the test assert() statement executes, the images do become fully loaded.
    My question is: What can I do to make sure my image is loaded fully before I do anything with it? Is there any elegant way to handle this? Am I doing something wrong?
    Thanks for your time.
    -Thok

    [http://forums.sun.com/thread.jspa?threadID=5446922]
    db

  • Get an Image object

    hello :)
    My problem is that, i am trying to draw an image in a JPanel, but i cant get the object (Image) i want to use, cause i dont know if swing has any Image object creator like Applets getImage or Toolkit getImage.. and i want to do this without using Toolkit.getDefaultToolkit().geImage(URL)
    Tank u for your help.

    It is better to load images using .....getClass().getResource(....) i.e.
    ImageIcon i = new ImageIcon(getClass().getResource(url));
    With this approach the url can be CLASSPATH relative and the image can be in a jar (the same
    jar as the class loading it).
    Hope that helps you

  • Java.lang.NoClassDefFoundError Toolkit.getDefaultToolkit

    hi all
    i got this error in a servlet.
    i wrote it on my computer with no errors but, when i moved and executed it on a linux machine it doesn't work:
    java.lang.NoClassDefFoundError at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
    at counter.count.createCounter(count.java:245)
    the code is
    images=Toolkit.getDefaultToolkit().getImage(imageSrc);
    i think that the jdk version is the same on both the computers (1.4.0 or higher), and the code is the same!
    why have i this problem
    thanx
    sandro

    hi rajesh
    you don't know how i'm happy to see your answers!
    i'm so desperate with this problem!
    as you asked to me, this is the full stack trace that tomcat prints when i call my servlet:
    javax.servlet.ServletException: Servlet execution threw an exception
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:130)
         at java.awt.Toolkit$2.run(Toolkit.java:712)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
         at counter.count.createCounter(count.java:231)
         at counter.count.processRequest(count.java:176)
         at counter.count.doGet(count.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    i don't know if there is some environment variable set up in a different way from my system (w2k) to the real server system (linux), also because i installed the jdk (1.4.0 on windows) without setting anything
    if can help i'll post you soon the version of tomcat/jdk used by linux
    thanx a lot
    sandro

  • Toolkit.getDefaultToolkit() in Java service never returns on Windows

    I'm stumped by this problem. It appears to be specific to a single machine as I can reproduce it reliably there but not on other machines. I'm hoping someone has some thoughts on what could be going on.
    Here's the scenario:
    I have Tomcat 5 running as a service on a new installed Windows 2000 Server with up to date service packs and j2sdk1.4.2_06. The service is configure to run headless.
    I have a webapp that performs simple image transformations using AWT and Java2D. Any invocation of Toolkit.getDefaultToolkit() never returns. The thread just sits there consuming no CPU and does not throw an exception. I've narrowed it further to a call to new sun.awt.windows.WToolkit() in getToolKit(). sun.awt.windows.WToolkit is the value of the system property awt.toolkit.
    I can reproduce this exact behavior in a different scenario: the server is running sshd on cygwin. If I ssh to the server and run the following class, it also hangs at new sun.awt.windows.WToolkit().
    public class ToolkitTester
      public static void main(String[] args)
        System.out.println("awt.toolkit = " + System.getProperty("awt.toolkit"));
        System.out.print("Invoking: new sun.awt.windows.WToolkit()... ");
        new sun.awt.windows.WToolkit();
        System.out.println("done.");
    }Running this same class from a shell on the server works just fine.
    I have tried j2sdk1.4.2_03 and jdk1.5 with the same results. I've replicated this second scenario (logging in over ssh) on another Windows 2000 server and do not see this behavior.
    Any thoughts?
    Alon

    Okay. Here's the fix...
    The 'no video card' comment was actually pretty close. The issue appears to be with DirectDraw support. We found this by watching regmon as the testing code ran. Installing a new video driver may have addressed this but so does disabling using DirectDraw as described here:
    http://java.sun.com/products/java-media/2D/forDevelopers/java2dfaq.html#dither
    java -Dsun.java2d.noddraw=true
    Wow. Weird one.
    Alon

  • Always return GMT Time Zone in Bundle Image Deployment

    I have application that need to get window PC time zone, when use Bundle Image Deployment (include runtime jre), it always return GMT time zone no matter which time zone I set on my PC. After I replace runtime/jre in the image folder with complete jre, then it returns time zone correctly. Is it a bug in bundle deployment?
    javafx.runtime.version: 2.2.7-b01
    jdk1.7.0_17
    window 8 64bit
    Thanks.
    Eric

    I am experiencing similar type of issue.  I subscribed to a Calendar which has scheduled meeting from my time zone and different time zone.  When I subscribe in OS X, it shows flawlessly on local time. But when I do it in IOS 7,  it shows MST as-is in EST time zone and no matter we play around all the time zone setting in General tab or Mail/Calendar tab.  It's not helping.
    Appears to be a bug in IOS 7.  It needs to be reported to Apple.

  • Changing colors in an Image object

    I have an Image objects and want all the red pixels in it changed to blue during runtime.
    How can I do that?

    ImageIcon oldImage = new ImageIcon("C:\\duke\\t1.gif");
    ImageProducer producer = new FilteredImageSource(oldImage.getImage().getSource(),new MyFilter());
    ImageIcon newImage = new ImageIcon(Toolkit.getDefaultToolkit().createImage(producer));
    JLabel jl = new JLabel(newImage);
    // Image filter
    class MyFilter extends RGBImageFilter{
      public int filterRGB(int x, int y, int rgb) {
        int alpha = (rgb >> 24) & 0xff;
        int red = (rgb >> 16) & 0xff;
        int green = (rgb >> 8) & 0xff;
        int blue = rgb & 0xff + red;
        if (blue>255) blue=255;
        red=0;
        return alpha << 24 | red << 16 | green << 8 | blue << 0;
    }

  • Load jpg in image object

    Hi, i'm trying to create an image object from a jpg file:
    public static void main(String[] args)
    Image img;
    Toolkit t;
    t = Toolkit.getDefaultToolkit();
    img = t.getImage("C:\\Documents and Settings\\m.lipreri\\Desktop\\ciao.jpg");
    System.out.println("img: "+img.toString());
    Frame f = new Frame("Es1_Im");
    ImageFrame IM = new ImageFrame(f,img);
    IM.addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent e){
    System.exit(0);
    IM.setSize(500,400);
    IM.setVisible(true);
    class ImageFrame extends Frame{
    Frame f;
    Image im;
    //costruttore
    ImageFrame(Frame f,Image im){
    this.f = f;
    this.im = im;
    public void paint(Graphics g){
    g.drawImage(im,0,0,this);
    }but this code doesn't show me anithing in the applet, the image path is right, i've tried to past the path in my browser and i can see the image.
    thnx

    Images get loaded asynchronously, so the image
    probably isn't loaded completely when you try to
    display it. See java.awt.MediaTracker or use
    javax.swing.ImageIcon for loading.I could be wrong, but isn't that the ancient way of doing it? I haven't used MediaTracker in ages. Just use ImageIcon. It's the easist way I know to work with images.

  • KeyCode always returns 0.

    no matter what i tried to do the keyCode always returns 0 :( .
    import java.awt.*;
    import javax.swing.*;
    import java.applet.Applet;
    import java.applet.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import java.util.Random;
    public class Tic extends Applet implements KeyListener
         int currentLine=30;
         char typ = '1';
         public void init()
         addKeyListener(this);
          TextField tf = new TextField(20);
             add(tf);
             tf.addKeyListener(this);
          //String styp = typ.toString;
         //page.drawString(typ, 10, currentLine);
         public void keyPressed(KeyEvent e)
         repaint();
         public void keyReleased(KeyEvent e){}
         public void keyTyped(KeyEvent e)
              int keyCode;
              keyCode= e.getKeyCode();
         showStatus(" Recently typed characters are : "+ keyCode);
         public void paint(Graphics g)
         currentLine=currentLine+20;
             public void actionPerformed(ActionEvent e)
                 //ohboy2.loop();//sound
    }

    Sob sob
    it doesnt wannna move!!!!
    import java.awt.*;
    import javax.swing.*;
    import java.applet.Applet;
    import java.applet.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Random;
    public class Tic extends Applet implements KeyListener
         AudioClip cuckoo;
         int keyCode;
         int x = 20;
         int y = 20;
         Image pic = null;
         public void init()
         addKeyListener(this);
              pic = getImage(getDocumentBase(),"Bi.jpg");
              cuckoo = getAudioClip(getDocumentBase(), "cuckoo.wav");
              cuckoo.loop();
         public void keyPressed(KeyEvent e)
              keyCode= e.getKeyCode();
              showStatus(" Recently typed characters are : "+ keyCode);
              if (keyCode==37)
                            x=x+20;
         public void keyReleased(KeyEvent e)
              keyCode= e.getKeyCode();
              showStatus(" Recently typed characters are : "+ keyCode);
              if (keyCode==37)
                            x=x+20;
         public void keyTyped(KeyEvent e)
              keyCode= e.getKeyCode();
              showStatus(" Recently typed characters are : "+ keyCode);
              if (keyCode==37)
                            x=x+20;
          public void paint(Graphics g)
                  g.drawImage(pic,0,0,this);
                  g.drawLine( x,y, x+40,y+40 );
                  if (keyCode==37)
                            x=x+20;
    }

  • JFrame getLocation() always returns (0, 0)

    I am learning Java, and I am trying to port a silly program I made in VB.NET that bounces a green window around the screen. I think I have it all set up, except for the fact that I can't tell when the frame hits the edge of the screen (to bounce) because JFrame.getLocation() always returns (0, 0)! In addition, JFrame.setLocation(int, int) sets the location relative to the frame's current location. I'm baffled, and to new to understand why this is happening!
    Here's the code, made in Eclipse IDE. The commented out section is the bouncing code that doesn't work because of my getLocation() problem. The two class files are separated by the big star line.
    Right now I'm not concerned with efficiency or perfect coding, just this specific problem. However, feel free to straighten up the code (for example, I'm sure a while(true) block is not a good idea, but it works for now).
    import java.awt.Toolkit;
    public class Move {
         static Mover mover = new Mover();
         static int xDir = 5;
         static int yDir = 5;
         static int sleepTime = 100;
         public static void main(String[] args) {
              beginMove();
         private static void beginMove() {
              while(true) {
                   /*if(mover.getLocation().x <= 0) {
                        xDir = (-xDir);
                   if(mover.getLocation().y <= 0) {
                        yDir = (-yDir);
                   if(mover.getLocation().x >= Toolkit.getDefaultToolkit().getScreenSize().width) {
                        xDir = (-xDir);
                   if(mover.getLocation().y >= Toolkit.getDefaultToolkit().getScreenSize().height) {
                        yDir = (-yDir);
                   mover.move(xDir, yDir);
                   try {Thread.sleep(sleepTime);} catch (InterruptedException e) {}
    import java.awt.Color;
    import java.awt.Point;
    import javax.swing.JFrame;
    public class Mover extends JFrame {
         public JFrame mover = new JFrame();
         public Mover() {
              mover.setSize(100, 100);
              mover.setUndecorated(true);
              mover.getContentPane().setBackground(Color.green);
              mover.setLocation(100, 100);
              mover.setVisible(true);
         public void move(int xAmt, int yAmt) {
              mover.setLocation((mover.getLocation().x + xAmt), (mover.getLocation().y + yAmt));
    }

    Looks like I spoke to soon... After I changed the mover class as you did, this is thrown:
    Exception in thread "main" java.lang.StackOverflowError
         at java.awt.Component.setLocation(Unknown Source)
         at Mover.move(Mover.java:16)It prints the last two lines about 500 times (literally) then quits. Line 16 is setLocation(getX() + xAmt, getY() + yAmt); and the error goes away if this is removed.
    When I try to move the frame in the mover class (mover.setLocation(10, 10);), nothing happens.
    EDIT: It works when I use setBounds(). Why doesn't setLocation work???
    Edited by: crimsondynamo329 on Oct 20, 2009 2:19 PM

  • TableCombos[finalj].getSelectedIndex() always returns initial value

    Hello.
    I have a JPanel class with an array of JComboboxes. The combos are filled in from an SQL database at the JPanel launch, and the indexes are selected also based on a database. However, when I change the combo selection, the action fires, but getSelectedIndex() on the combo just changed returns the original selection number.
    I tried using the code below to try and catch the loss of the selection:
    this.tableCombos[finalj].addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed (ActionEvent e){
    System.out.println(table.getColumnAt(finalj)+" (combo["+finalj+"]) changed: " + tableCombos[finalj].getSelectedIndex() + " selected");
    The selection item visually changes, while the selectIndex returns as the original selection, not the new one. what could be causing this?
    TIA,
    - aenik

    You should use an ItemListener (see attached sample working code) instead of overriding the actionPerformed() method. The following is an excerpt from the JComboBox class's actionPerformed() method:
    This method is public as an implementation side effect. do not call or override.
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class ComboTest {
    public static void main(String args[]) {
      new ComboTestFrame();
    class ComboTestFrame extends JFrame {
    JComboBox jcb = new JComboBox(new Object[] {"Red","Green","Blue","Yellow"});
    ComboTestFrame() {
      super();
      /* Components should be added to the container's content pane */
      Container cp = getContentPane();
      cp.add(BorderLayout.NORTH,jcb);
      jcb.addItemListener(new ItemListener() {
       public void itemStateChanged(ItemEvent evt) {
        Object obj = evt.getSource();
        if (evt.getStateChange() == ItemEvent.SELECTED)
         System.out.println("Selected index: " + ((JComboBox) obj).getSelectedIndex());
      /* Add the window listener */
      addWindowListener(new WindowAdapter() {
       public void windowClosing(WindowEvent evt) {
        dispose(); System.exit(0);}});
      /* Size the frame */
      setSize(200,200);
      /* Center the frame */
      Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
      Rectangle frameDim = getBounds();
      setLocation((screenDim.width - frameDim.width) / 2,(screenDim.height - frameDim.height) / 2);
      /* Show the frame */
      setVisible(true);

  • Call thirty party java web service but always return null

    hi
    I call a java web service in my application visual studio 2008 c#, but always return NULL.
    I used Tool Fiddler to monitor the traffic between my client and the web service server, it showed the return is not Null.
    Here is my code, please see if anything I do wrong.
    namespace CanOfficer_THQ_vs_IHQ.TestWebReferenceAppointment {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="AppointmentServiceSoapBinding", Namespace="http://service.ips.salvationarmy.org/")]
    public partial class AppointmentService : Microsoft.Web.Services3.WebServicesClientProtocol {
    private System.Threading.SendOrPostCallback deleteAppOperationCompleted;
    private System.Threading.SendOrPostCallback importAppOperationCompleted;
    private System.Threading.SendOrPostCallback editAppOperationCompleted;
    private bool useDefaultCredentialsSetExplicitly;
    /// <remarks/>
    public AppointmentService() {
    this.Url = global::CanOfficer_THQ_vs_IHQ.Properties.Settings.Default.CanOfficer_THQ_vs_IHQ_TestWebReferenceAppointment_AppointmentService;
    if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
    this.UseDefaultCredentials = true;
    this.useDefaultCredentialsSetExplicitly = false;
    else {
    this.useDefaultCredentialsSetExplicitly = true;
    public new string Url {
    get {
    return base.Url;
    set {
    if ((((this.IsLocalFileSystemWebService(base.Url) == true)
    && (this.useDefaultCredentialsSetExplicitly == false))
    && (this.IsLocalFileSystemWebService(value) == false))) {
    base.UseDefaultCredentials = false;
    base.Url = value;
    public new bool UseDefaultCredentials {
    get {
    return base.UseDefaultCredentials;
    set {
    base.UseDefaultCredentials = value;
    this.useDefaultCredentialsSetExplicitly = true;
    /// <remarks/>
    public event deleteAppCompletedEventHandler deleteAppCompleted;
    /// <remarks/>
    public event importAppCompletedEventHandler importAppCompleted;
    /// <remarks/>
    public event editAppCompletedEventHandler editAppCompleted;
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    RequestNamespace="http://service.ips.salvationarmy.org/",
    ResponseNamespace="http://service.ips.salvationarmy.org/",
    Use=System.Web.Services.Description.SoapBindingUse.Encoded,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string deleteApp([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int id) {
    object[] results = this.Invoke("deleteApp", new object[] {
    id});
    return ((string)(results[0]));
    /// <remarks/>
    public void deleteAppAsync(int id) {
    this.deleteAppAsync(id, null);
    /// <remarks/>
    public void deleteAppAsync(int id, object userState) {
    if ((this.deleteAppOperationCompleted == null)) {
    this.deleteAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OndeleteAppOperationCompleted);
    this.InvokeAsync("deleteApp", new object[] {
    id}, this.deleteAppOperationCompleted, userState);
    private void OndeleteAppOperationCompleted(object arg) {
    if ((this.deleteAppCompleted != null)) {
    System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
    this.deleteAppCompleted(this, new deleteAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    RequestNamespace="http://service.ips.salvationarmy.org/",
    ResponseNamespace="http://service.ips.salvationarmy.org/",
    Use=System.Web.Services.Description.SoapBindingUse.Encoded,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string importApp(
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int person,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string name,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string territory,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string location,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] bool primary,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> start,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> end,
    [System.Xml.Serialization.XmlElementAttribute("categories", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string[] categories) {
    object[] results = this.Invoke("importApp", new object[] {
    person,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories});
    return ((string)(results[0]));
    /// <remarks/>
    public void importAppAsync(int person, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories) {
    this.importAppAsync(person, name, territory, location, primary, start, end, categories, null);
    /// <remarks/>
    public void importAppAsync(int person, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories, object userState) {
    if ((this.importAppOperationCompleted == null)) {
    this.importAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OnimportAppOperationCompleted);
    this.InvokeAsync("importApp", new object[] {
    person,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories}, this.importAppOperationCompleted, userState);
    private void OnimportAppOperationCompleted(object arg) {
    if ((this.importAppCompleted != null)) {
    System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
    this.importAppCompleted(this, new importAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    RequestNamespace="http://service.ips.salvationarmy.org/",
    ResponseNamespace="http://service.ips.salvationarmy.org/",
    Use=System.Web.Services.Description.SoapBindingUse.Encoded,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string editApp(
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int id,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string name,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string territory,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string location,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] bool primary,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> start,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> end,
    [System.Xml.Serialization.XmlElementAttribute("categories", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string[] categories) {
    object[] results = this.Invoke("editApp", new object[] {
    id,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories});
    return ((string)(results[0]));
    /// <remarks/>
    public void editAppAsync(int id, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories) {
    this.editAppAsync(id, name, territory, location, primary, start, end, categories, null);
    /// <remarks/>
    public void editAppAsync(int id, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories, object userState) {
    if ((this.editAppOperationCompleted == null)) {
    this.editAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OneditAppOperationCompleted);
    this.InvokeAsync("editApp", new object[] {
    id,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories}, this.editAppOperationCompleted, userState);
    private void OneditAppOperationCompleted(object arg) {
    if ((this.editAppCompleted != null)) {
    System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
    this.editAppCompleted(this, new editAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
    /// <remarks/>
    public new void CancelAsync(object userState) {
    base.CancelAsync(userState);
    private bool IsLocalFileSystemWebService(string url) {
    if (((url == null)
    || (url == string.Empty))) {
    return false;
    System.Uri wsUri = new System.Uri(url);
    if (((wsUri.Port >= 1024)
    && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
    return true;
    return false;
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    public delegate void deleteAppCompletedEventHandler(object sender, deleteAppCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class deleteAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    private object[] results;
    internal deleteAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
    base(exception, cancelled, userState) {
    this.results = results;
    /// <remarks/>
    public string Result {
    get {
    this.RaiseExceptionIfNecessary();
    return ((string)(this.results[0]));
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    public delegate void importAppCompletedEventHandler(object sender, importAppCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class importAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    private object[] results;
    internal importAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
    base(exception, cancelled, userState) {
    this.results = results;
    /// <remarks/>
    public string Result {
    get {
    this.RaiseExceptionIfNecessary();
    return ((string)(this.results[0]));
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    public delegate void editAppCompletedEventHandler(object sender, editAppCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class editAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    private object[] results;
    internal editAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
    base(exception, cancelled, userState) {
    this.results = results;
    /// <remarks/>
    public string Result {
    get {
    this.RaiseExceptionIfNecessary();
    return ((string)(this.results[0]));

    Hi;
    I used Fiddler to monitor the process, and it showed the request sent thru web service worked and returned a value, but in my .Net application the return captured as NULL. Could you please look into the code above and the result from Filddler and see if
    you can help.
    thank you.
    REQUEST:
    POST https://159.253.140.178/services/AppointmentService HTTP/1.1
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4252)
    Content-Type: text/xml; charset=utf-8
    SOAPAction: ""
    Host: 159.253.140.178
    Content-Length: 1589
    Expect: 100-continue
    Connection: Keep-Alive
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://service.ips.salvationarmy.org/" xmlns:types="http://service.ips.salvationarmy.org/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
    <soap:Header>
    <wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>
    [email protected]
    </wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
    tpi4IPSws!
    </wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:importApp>
    <person xsi:type="xsd:int">
    169275
    </person>
    <name xsi:type="xsd:string">
    Corps Officer (Cahul-Russia) Test12
    </name>
    <territory xsi:type="xsd:string">
    CAN
    </territory>
    <location xsi:type="xsd:string">
    TEST LOCATION 12
    </location>
    <primary xsi:type="xsd:boolean">
    true
    </primary>
    <start xsi:type="xsd:dateTime">
    2013-05-30T00:00:00
    </start>
    <end xsi:type="xsd:dateTime">
    2014-06-04T00:00:00
    </end>
    <categories href="#id1" />
    </tns:importApp>
    <soapenc:Array id="id1" soapenc:arrayType="xsd:string[1]">
    <Item>
    vpsCat1
    </Item>
    </soapenc:Array>
    </soap:Body>
    </soap:Envelope>
    RESPONSE:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 232
    Date: Fri, 05 Sep 2014 19:45:22 GMT
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <ns2:importAppResponse xmlns:ns2="http://service.ips.salvationarmy.org/">
    <return>
    OK_572463
    </return>
    </ns2:importAppResponse>
    </soap:Body>
    </soap:Envelope>

  • Toolkit.getDefaultToolkit().getScreenResolution()

    Hi I called Toolkit.getDefaultToolkit().getScreenResolution() to get my monitor screen resolution. It returns 96 dpi.
    But as i check my monitor hardware specs, I found it was different. My monitor is 15.1 inch MultiSync LCD1530v and the hardware specs is found at http://www.necmitsubishi.com/products/home/product.cfm?productid=145&cfid=2239759&cftoken=98264266
    It can can found that the resolution is 0.3 mm dot pitch, which turns out to be 1/0.03 * 2.54=84.8 dpi. I am a bit confused by this. Can someone help me in answering the following question?
    1. what is the link between 96dpi in Toolkit and 0.3mm in hardware specs? Can one derive one from another? Thanks!

    I have a 19 inch monitor and I too get 96 dpi. Is there something wrong with getScreenResolution()?
    import java.awt.*;
    public class TestMethods
    public TestMethods()
    public static void main(String[] args)
    TestMethods testMethods1 = new TestMethods();
    Toolkit toolkit= Toolkit.getDefaultToolkit();
    Dimension screenSize= toolkit.getScreenSize();
    int screenResolution= toolkit.getScreenResolution();
    System.out.println("Screen size: " +screenSize);
    System.out.println("Screen Resolution: " +screenResolution);
    ran it 3 times and got
    1600 X 1200
    96
    1280 X 1024
    96
    640 X 480
    96
    What's up with that?

  • Bc4j:RowScope on a Master Detail page always returns 0 rows for detail

    Hi,
    I have a problem with a Master Detail page that is called from another page. The Master Detail page has two View Objects, Budgets and Budget Versions. These are linked properly in BC4J and when I use these VOs together I can navigate through the Budgets (master) and the Budget Versions (details) are populated correctly.
    However, I want to navigate to this page from another page which lists all possible Budgets. I pass the key of the selected Budget to the Master Detail page and the correct Budget is displayed, BUT the Budget Versions are NOT displayed - I get 0 rows returned.
    The mechanism I use to pass the selected Budget ID to my Master Detail page is:
    <ctrl:property name="key">
    <ctrl:selection name="ViewTable" key="key"/>
    </ctrl:property>
    My BC4J Registry is set up as follows:
    <bc4j:registryDef>
    <bc4j:rootAppModuleDef name="BudgetModule"
    defFullName="BudgetPackage.BudgetPackageModule"
    configName="BudgetPackageModuleLocal"
    releaseMode="stateful">
    <bc4j:viewObjectDef name="ItiBudgetsView1">
    <bc4j:rowDef name="CurrentBudgetRow" usesCurrency="True">
    <bc4j:propertyKey name="key"/>
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ItiBudgetVersionsView2" rangeSize="15"/>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    I then use
    <bc4j:rowScope name="CurrentBudgetRow">
    to get the correct Budget row in my master VO. But this always returns 0 rows in my detail VO. If I comment out the rowScope element, I don't get the desired Budget row, but I do get the correct Budget Version rows displayed. Is the rowScope element on the Budget VO interfering with the Budget Version VO?
    Hope this is not too confusing!!
    Thanks,
    Steve

    Steve,
    I tried to create a comparable set of two pages and initially ran into the same problem. I just realized that my issue (which I hope is yours too) is that the rootAppModule name was different across my two pages. This led to each page having its own application module instance, so the currency was different on each page.
    By changing all of my pages to use the same application module name (in the registryDef, in the appModuleScope tags in the page, and in the findAppModule tags in the handlers), I resolved this problem.
    My event handler to go to the master/detail page from the master page, FYI, looks like this:
      <event name="details" >
       <bc4j:findRootAppModule name="MyApp" >
        <!-- establish the ViewObject scope -->
        <bc4j:findViewObject name="CustomersView1" >
         <!-- find the selected Row -->
         <bc4j:findRowByKey>
          <bc4j:keyBinding>
           <bc4j:selectionKey name="viewTable" key="key" />
          </bc4j:keyBinding>
         </bc4j:findRowByKey>
        </bc4j:findViewObject>
        <bc4j:executeQuery />
        <go name="OrdersByCustomer_View" redirect="true" />
       </bc4j:findRootAppModule>                     
      </event>Hope this helps.
    -brian
    UIX Team

Maybe you are looking for

  • How do I Install LabVIEW on Windows 8 without destroying my Start screen?

    I recently upgrdaded my computer and am running Windows 8 now.  I know lots of people will tell me that this was a terrible idea, but it is what it is.  I am actually liking the new start screen once I spent some time getting used to it.  It works we

  • Error in CSV upload

    Hi Gurus, while uploading data from csv file, at one field i am getting error, it is of type BETRG(CURR) and value in file is 500, but while i checked in debug 500 is added with # i.e., 500# '#' tabking automatically.. why it is taking #?? any help p

  • Images blur when exported to pdf(crystal 10)

    Post Author: DAVE G CA Forum: Exporting I have a vb executable that uses crystal's automation object(found in craxddrt.dll) to execute then export a crystal report to a .pdf file.  The problem that I am having is that if the exported reported loses g

  • Error transmitting the request byte stream

    I got error message when I try to store archive file via ixos LEA9.6.0. The message text is "Job started Step 001 started (program RSARCH_STORE_FILE, variant , user name SAWANG) The archive file 000733-001MM_ACCTIT is being processed Error transmitti

  • Links in Dreamweaver

    Hi, I've just finished making a website for fun, which looks great thanks to Flash and Dreamweaver! Anyway, I was thinking of using it as a desktop background (Windows XP active desktop web page), and linking things like my folders and files to my ta