[iPhone] help with docs re: custom URL schemes

I have 2 apps and I want to launch one from the other with some data. I figure a custom URL scheme would do the trick.. but I can find no docs on how to do it!
I have found the api for application:handleOpenURL, but it does not say much more about it than "here your app can handle a url...)
And of course there is documentation for the Apple custom URLs...
Do I need to put anything in the plist.info file?
If anyone knows where the docs are for this, I would really appreciate it.
thank you
michael golden

Yes, you need to put several entries into info.plist. Search for "CFBundleURLTypes" in the iPhone OS Programming Guide.

Similar Messages

  • Custom url scheme not working (for first time) IOS applicaiton

    i have created one distribution application also register custom URL scheme. First time after I installed application, and try custom URL link, it does not work.
    However if I lunch the application manually it will prompt me below mentioned message
    Are you sure you want to open the application ... from the developer iphone distribution ... ?
    i will click on continue, and after that custom URL link works fine with my application.
    Can Custom url link launch the application directly on installation (without manually launch application and contiue)?
    is there any settings, so we can make the prompt message off. So it will not prompt message.
    also i had tried to create new application from another enterprise account, and deploy on other server; then it do not prompt that message, but unable to figure out the reason .
    Thanks

    Are you exactly following the guidance in the iOS App Programming Guide for Implementing Custom URL Schemes? Do you get the same message the first time, no matter whether app has been loaded or not? Are you really using iOS 4 per your profile?
    "If your app is not running when a URL request arrives, it is launched and moved to the foreground so that it can open the URL. The implementation of your application:didFinishLaunchingWithOptions: method should retrieve the URL from its options dictionary and determine whether the app can open it. If it can, return YES and let your application:openURL:sourceApplication:annotation: (or application:handleOpenURL:) method handle the actual opening of the URL.

  • Is It Possible to Create Custom URL Scheme to Launch a Specific Tab ?

    I know you can link to DPS and a specifict folio / artcile with a Custom URL Scheme, but does DPS support to use Custom URL scheme to launch a specific Tab ?
    To clarify I'm not looking at the option to start on a specifict tab when launch, DPS supports this already, but just wondering if another iOS app can invoke DPS launch to a specific tab ?

    I found http://helpx.adobe.com/digital-publishing-suite/help/hyperlink-overlays.html there is a section "Create goto links to custom icons" seems like you can specificy which tab to go to from an external app when invoke the DPS app ? (ex. library, store)
    oto://ApplicationViewState/library
    goto://ApplicationViewState/sections

  • Custom URL Scheme not working? (as supposed)

    Hey,
    I went into investigate about the "optional URL scheme" setting you can set up during building an app in the viewer builder.
    Quote from the Viewer Builder help:
    Optional URL Scheme
    Specify the custom URL scheme that launches the viewer app from Safari and other apps. […]For example, suppose you specify “com.sportspub.kayaking” as the URL scheme. If you embed a “com.sportspub.kayaking://” link on your webpage, clicking the link from the mobile browser opens the viewer app. […]
    The possibility sounds good, to link to the app from any web page you view on the iPad.
    But during testing this, I found out it's not that easy and/or not working as documented.
    Bob set the URL scheme for his app supposedly to
    com.dpstips.may5
    a link with
    <a href="com.dpstips.may5://">
    will not open Bob's app on the iPad ("invalid URL").
    I looked into the compiled app from the viewer builder and found out the actual URL scheme used is completly different, it is
    dps.7f80a0ffed3a4ff08734bc905aac4a29
    and the correct link would be
    <a href="dps.7f80a0ffed3a4ff08734bc905aac4a29://">
    that will open Bob's app (you can try it here if you are on an iPad).
    And if you know your interal folio and article names, you can even deep link into one article from a specific folio:
    <a href="dps.7f80a0ffed3a4ff08734bc905aac4a29://v1/folio/DPS%20Folios/01_Folio_TOC">
    you see these links in the landing page of the web viewer on the iPad.
    I collected all links and tests in this jsFiddle, that you can open on your iPad to test yourself: http://jsfiddle.net/YRUGj/15/
    Unfortunately, you cannot find out your real URL scheme without extracting your .ipa file and investigate the content's of the viewer, it is listed in the info.plist file.
    Is this supposed to work this way or is this currently a bug that might be fixed soon?
    —Johannes

    Felipe, I suspect you have some basic knowledge about nerdy stuff, follow
    the pink rabbit:
    (extract your developerviewer.ipa on a mac using extractor or sth.)
    1st http://download.nordsueddesign.de/skitch/viewer-20120527-163947.png
    (open the viewer bei right mouse click > Show Package Content)
    2nd http://download.nordsueddesign.de/skitch/viewer-20120527-163947.png
    (find your values in the info.plist file, try opening it with Textwrangler,
    some other text editor cannot keep it readable)
    —Johannes

  • Can iBooks Author handle custom URL schemes?

    Hi
    I have a native application that displays radiology images. I'd love to have iBooks be able to click on a link that had a custom URL scheme and launch my application. This way you could (for example) have a textbook for different procedures or findings and be able to display the type of study that would result from the procedure.
    When I enter URL with a custom URL scheme iBooks Author prepends a 'http:" to the URL. Is there any way around this?
    I've tried editing an exported iBooks file manually (e.g. in emacs) but the modified ibook doesn't seem to be imported.

    Yes.  I'd love to know the same thing for similar reasons.

  • Create a Homescreen Symbol with custom URL Scheme

    Hi People,
    I hope you can help me.
    As the subject said I want to create a Home-screen-Symbol with a URL Scheme. Meaning a Link that directs me to a Note in Evernote.
    If I Enter the URL in Safari it takes me there, that works perfect. Now I want to use the "Add to Home-screen" Function of Safari to create a Symbol that takes me to that Note also.
    But there is also my problem: Safari immediately opens the App and I can't use the Function and if I get back to safari the tab with the URL is already cleaned up.
    Does someone know a trick where I can create such a symbol or edit the URL of an existing Symbol?
    First of all: Jailbreaking is no Option here.

    Does it work without iWeb?
    As in : a webpage with code you typed yourself.
    If so, then display that page in an <iframe>. Or paste the code in a HTML snippet.
    My impression is, that iWeb only allow http:// URLs.
    And do you really want to install an app on someone's iPad just by clicking the link?
    Why not provide a link to the app in the App Store?

  • Help with Java Printing-Custom paper sizes

    Hi,
    I'm trying to print documents with custom paper sizes out of java.
    I can print fine when I don't try to set the MediaSize to a custom size or when I use already named constants like: "MediaSizeName.JIS_B4"
    The error message I get is this:
    java.lang.ClassCastException
         at javax.print.attribute.AttributeSetUtilities.verifyAttributeValue(Unknown Source)
         at javax.print.attribute.HashAttributeSet.add(Unknown Source)
         at hello.Printy.printDocument(Printy.java:103)
         at hello.Printy.main(Printy.java:135)
    The offending line(103) looks like this:
    pras.add(new MediaSize(1,10,MediaSize.INCH ));The function that its from looks like this:
    public  void printDocument()
    try
              System.out.println("input file name is");
         System.out.println(inputFileName);
    PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
    DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
    PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
    PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
    PrintService printPrintService = null;
    // didn't work pras.add(new MediaSize(1,10,MediaSize.INCH) );
    PrintService service = ServiceUI.printDialog(null, 200, 200,printService, defaultService, flavor, pras);
    if (service != null)
         System.out.println("There is a service aunty-may!!");
    DocPrintJob job = service.createPrintJob();
    FileInputStream fis = new FileInputStream(getInputFileName());
    DocAttributeSet das = new HashDocAttributeSet();
    //pras.add(new MediaSize((float)3.25, (float)4.75, Size2DSyntax.INCH ) );
    // - works
    //pras.add(MediaSizeName.JIS_B4);
    pras.add(new MediaSize(1,10,MediaSize.INCH ));
    //pras.add(new MediaSize(1,10,MediaSize.INCH) );
         System.out.println("Doc has been set to custom size");
    Doc doc = new SimpleDoc(fis, flavor, null);
    job.print(doc, pras);
         System.out.println("any doc for you?");
    catch (Exception e)
    e.printStackTrace();
    }Any help with this would be greatly appreciated. I'm new to java but I've programmed a bunch in c++.

    Hmm ... no real help, but I found this note in the API:
    MediaSize is not yet used to specify media. Its current role is as a mapping for named
    media (see MediaSizeName). Clients can use the mapping method
    MediaSize.getMediaSizeForName(MediaSizeName) to find the physical dimensions of
    the MediaSizeName instances enumerated in this API. This is useful for clients which
    need this information to format & paginate printing.

  • Cisco Mobile 8.1 for iPhone - Help with features please

    Hello all,
    We have just upgraded to 8.0.3 and have added the iPhone cop file so we can have Mobile up and running.
    So far we have managed to get 8.1 working fine on 3 iPhones successfully with the basics but have not managed the following:
    1) Corporate directory access. We are not integrated with AD and have read that iPhone app cannot pull the end user directory. Is there another way apart from integrating with LDAP as we have a lot of users in the end user directory that do not have profiles in AD and I presume they will all get disabled as soon as we integrate..
    2) GSM handoff - I have been going through the config to get this up and running and any tips would be very much appreciated.Do you need to add a directory number for the handoff number or is the config as simple as 2 boxes? (Call routing>Mobility configuration - Handoff number and Partition)
    3) Voicemail - Is it possible to have voicemail if we are not running connection. We have version 7 of standard unity...
    Your help would be greatly appreciated on any of the above...

    Hi Mike,
    In my opinion you have a routing problem. Please check if a VPN client knows the route to the other VPN client. Print route on a VPN laptop. Check gateway for the given IP range (default or static route).
    Then on your internal routing equipment you must have route for your VPN ip range configured.
    If I'm not wrong you cannot ask your VPN box to route traffic directly between 2 established tunnels. It must first go outside first tunnel and then revert back to VPN concentrator and enter second tunnel.
    Signaling differs from RTP because it goes through the SIP proxy and not p2p, so that's why it rings.

  • Invoking other apps with the custom URL schemes from AIR apps ?

    Hi ,
    I want to start(invoke) any non-air application from my Flex application build for ipad . Is there any way(example) for doing such a thing?
    I have defined schema in non air (native)ipad application.
    And I am trying to call  from flex  application as ,
    navigateToURL( new URLRequest("mBoard://"));
    Where mBoard:// is url for other app which is native app.
    Could you share an example of what he has done or refer me to them if it’s possible?
    Thanks and Regards,
    Madhu

    Yes, you need to put several entries into info.plist. Search for "CFBundleURLTypes" in the iPhone OS Programming Guide.

  • Need help with DOC type web service

    hi,
    I am trying to write a simple message style ( doc type ) web service but no success so far. I have tried to search for examples but no use. I already implemented some simple RPC style web services like calculator etc and able to use them. I am more interested in the DOC type ( which sends SOAP message and receives SOAP message back). Can Anybody give me an example for implementing this type of service ( very-simple say HellowWorld ) or point me to some website . I am not able to generate the response envelope. I can write the client program which will send a SOAP Envelope to this services with one parameter NAME and the services should return Hello Name but in a SOAP envelope form. I can create a SOAP message in this Client using SOAPConnection and MessageFactory etc. Your help will be really appreciated. There is very little stuff about webservices on the internet as well on this forum.
    Thanks
    Vinod

    Hello kwilding2,
    Thanks for the quick response and pointing to some useful websites. I downloaded the code from web service essentials BUT all the examples are using SOAP RPC calls. They create a call object and call one of the service methods and a response is returned. I am little confused about this stuff. I am looking for something which returns the response in a SOAP envelope for which i think i need to use JAXM API which I already have downloaded. I have created a client which composes a SOAP envelope using SOAPConnection and other MessageFactory classes etc and can send this SOAP envelope to a web service. In return I want the web service to give the SOAP envelope.
    I have gone thru xmethods.net and picked the following stock quote request and response:
    Sample Request envelope:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <symbol xsi:type="xsd:string">IBM</symbol>
    </ns1:getQuote>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Sample Response Envelope:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:getQuoteResponse xmlns:ns1="urn:xmethods-delayed-quotes" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:float">133.625</return>
    </ns1:getQuoteResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I also want the things in this order. This webservice at xmethods just returns the price for a stock, so how they say it returns this Response Envelope. Is this Envelope something implied. I am getting more confused.
    any help will be appreciated.
    Thanks
    Vinod

  • How Do I get Help with a Major Customer Service Issue?

    Hello,
    I am a Pro Care member and I took my Macbook Pro in to one on the local stores to ask them about a font issue that I was experiencing. One one the Genius guys came over and asked me a few questions and told me that this wasn't a big deal at all, that they just needed to reinstall my default fonts and that it should take maybe 45 minutes. This was at 4:30pm. Six hours later they came back to be to tell me that they had corrected the font issue but all of my user data and applications were lost! It was if I had a brand new Macbook Pro! This was a Friday evening. I was told to take my laptop to a company called Data Savers the next day to have this company try to restore my data/applications.
    I took my laptop to Data Savers on Saturday and they told me that they would need to keep it for a day. I went back to pick it up on Sunday and I was given an external drive that had "raw restored data" on it. When I had been speaking with the store manager about the situation and he wanted me to provide him with a list of software that was on the machine. So, when I got home from picking up my laptop from Data Savers I started it and all I got was an icon of a circle with a slash through it!! I called the guys at Data Savers and told them about this and they asked to bring the laptop back to them on Monday. I did. After running some diagnostics on the machine I was told that my hard drive was "toast!"
    Needless to say I was both upset and distraught! The store manager told me (in emails that I still have) that he understands how upset that I was about coming in for a font related issue and three days later being told that my laptop was no more that a big paper weight. He said (in these emails) that he would replace my laptop and he would try to get me the latest versions of the software that I had to make up for the business that I had lost in the last few days due to the fact that I didn't have have my machine.
    The store manager then called me back on a Tuesday and said that his superiors had told him that he cold not do what he said that he would do. Obviously, this increased my level of frustration. I was able to speak to this manager, think it may have been some sort of regional manager and after indicating that I had emails of the store manager acknowledging the facts of the matter and stating that he was very sorry for what happen, the regional manager said that she wanted me to send her copies of the emails. I told her that the store manager had copies of everything. She told me that she would get back to me. This was Wednesday afternoon. That same evening the store manager called me to say that "because I was lead to believe that Apple would replace my laptop, they would do so. I was told to be be at the store around noon on the following day (Thursday) and to bring my laptop. I was told that they would replace it.
    When I got to the store on Thursday, the manager came up to me and shook my hand and said that he was sorry for all the trouble and inconvenience. He went on to say that before he could replace my laptop that I would have to sign a document saying that I agree that they were not responsible for anything that had happened in the past six days!!
    The fact is, that isn't true and they know it. I have the email to prove it. I didn't sign the document. the next day because I could no longer afford to lose money and clients I went into another Apple store and purchased in brand new system!
    The fact is that I believe that Apples products are far superior to PC products. I was told by some to never buy from Apple again and tell everyone that I know about my experiences with this particular store. All I want is for Apple to do the right thing! Just replace my Macbook Pro like they said they were going to do. They don't have to provide any software updates, just do the right thing and replace my machine!!
    Can anyone tell me if they have had a similar experience and if so, how it was resolved? Who in the corporate office can I talk to about this to get it resolved? Are there and Apple insiders out there that can help me resolve this situation? I would like to avoid having to take legal action if at all possible.
    I look forward to any help that you can provide.
    SydCam

    Apple Computer Customer Relations:
    1-512-674-2500

  • How can I get some help with Verizon's customer service?

    I want to preface this by stating that this is the first time in the 10 years in which I've been a Verizon wireless customer, that I've had a problem that cannot be resolved to my satisfaction.  My issue started with a Verizon Wireless Stores in Bethlehem, PA.  I asked one of the sales clerks for some assistance (which I now regret).  My question to her was that I simply wanted to be able to connect my home laptop computer to the internet data on my mobile plan. Without even discussing the different options, I was "told" I needed to purchase a Mobile Hotspot Device (for $69.99, but just $20 after rebate!).  I told the clerk I didn't want to have to pay an additional bill every month and didn't want something that wasn't absolutely necessary.  She neglected to give me the more costly details, like the fact that it would require a 2 year contract on the device, and it would also cost me an additional $20 per month.  She knew I wasn't really sure what the most cost-effective option was, so I trusted her knowledge.  I even had my husband speak to her over the phone about the device, since he's more savvy about technology than I am.  The clerk spoke with him the entire time she completed my transaction, and when she rang the sale up, she did not have me sign anything.  She handed me the receipts, and told me I had 14 days to decide If I wanted to keep the device.  When I got home and tried to use it, it would not connect to my computer.  I took it to a local Verizon store on my lunch break one day and they looked into the transaction.  They told me it was never put on my account; it was charged to someone else's account in error.  I had to go back to the store where I originally purchased it.  I wasn't able to get back to the original store right away, but I made sure to get there by the 14th day.  It took two store managers to look at my account and figure out the error.  They fixed it, but no one apologized to me for the inconvenience; they simply told me they could activate the device for me, or if I didn't want it any more, they would take it back (minus the $35 restocking fee). I took issue with the restock fee, because the store made the error by not giving me the full information at time of purchase, and then not charging it to my account so that I could try it out for 14 days.  I was very upset that the manager refused to remove the restocking fee due to "policy" and that I "signed a contract" and I had to pay it.  I argued that she should make an exception in this case, because I was inconvenienced.  I told her if she valued my future business at her store, she would reconsider.  She refused to budge and told me that I didn't need to shop in her store any more.  I thought that was quite rude and insulting. So, I took all of my original receipts, along with the receipt that indicated that she refunded the $69.99 plus tax (minus the $35 restock fee).  I left the store quite upset, but figured there wasn't much else I could say to her. Meanwhile, it's days later and my bill still shows the entire amount of $74 for the mobile hot spot device still on there.  There is no credit for the return at all.  I called customer service on my lunch break yesterday, and was on the phone for 45 min with a "Kendra R" to no avail.  The entire call, she kept putting me on hold, and my bill was still not straightened out. When I asked to speak with a supervisor or manager, she said there was no one else available.  Later that afternoon, I got an automated call (that left a voice message) from Verizon Customer Service to do a survey on my customer service experience.  I did the survey and explained that my problem was not resolved and I would like a call back.  No one has called me back yet, and I am stuck with no resolution to my problem.  Now the Verizon store has the device back, and I still have the entire amount for it on my bill.  Can you help me please?

    Nope, it was a Verizon Wireless Store.  I went in there in the first place because I trusted the Company for their professionalism, but I've been let down badly.  I posted my story on here because I'm hoping to be able to get the attention of someone from Customer Service.  It seems like the only way you can actually speak with a live person who knows what they are doing, is when you stop paying your bill on time.  After you pay your bill, they transfer you to a poorly trained "rep" that has no authority to handle anything important. I'm actually a pretty patient person, but when it takes someone over 45 min mostly just to keep me on hold, and then tell me they can't help me, I'm not really impressed with their idea of customer service.

  • Help with creating a custom table cell editor?

    hi, i was reading up on various tutorials and trying to write codes that pops up a simple calendar when clicked on text of the Date class in a table, so far, i can't seem to get my classes working.. the following is some classes i've written for this task (note, there are alot of commented out lines, those are the modifications done to the tutorial classes in http://java.sun.com/docs/books/tutorial/)
    any help would be appreciated :D
    thanks in advance!
    What i have done so far:
    /** BASIC TABLE CLASS FOR DEMONSTRATION*/
    //import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    public class TableBasic extends JFrame
         public TableBasic()
              String[] columnNames = { "Date", "String", "Integer", "Boolean" };
              Object[][] data =
                   {  { new Date(), "A", new Integer(1), Boolean.TRUE },
                        {new Date(), "B", new Integer(2), Boolean.FALSE },
                        {new Date(), "C", new Integer(9), Boolean.TRUE },
                        {new Date(), "D", new Integer(4), Boolean.FALSE}
              JTable table = new JTable(data, columnNames)
                   //Returning the Class of each column will allow different
                   //renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
              table.setDefaultRenderer(Date.class, new CalendarRenderer(true));
              table.setDefaultEditor(Date.class, new CalendarEditor());
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane(table);
              getContentPane().add(scrollPane);
         public static void main(String[] args)
              TableBasic frame = new TableBasic();
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
              frame.pack();
              //frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    * CLASS BASED ON ColorRenderer.java at http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ColorRenderer.java
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.border.Border;
    import javax.swing.table.TableCellRenderer;
    //import java.awt.Color;
    import java.awt.Component;
    public class CalendarRenderer
         extends JLabel
         implements TableCellRenderer
         Border unselectedBorder = null;
         Border selectedBorder = null;
         boolean isBordered = true;
         public CalendarRenderer(boolean isBordered)
              this.isBordered = isBordered; setOpaque(true);
              //MUST do this for background to show up.
         public Component getTableCellRendererComponent(JTable table,
                                                                     Object color,
                                                                     boolean isSelected,
                                                                     boolean hasFocus,
                                                                     int row,
                                                                     int column)
              String newDate = (String)color;
              setText(newDate);
              if (isBordered)
                   if (isSelected)
                        if (selectedBorder == null)
                             selectedBorder = BorderFactory.createMatteBorder(2,5,2,5, table.getSelectionBackground());
                        setBorder(selectedBorder);
                   else
                        if (unselectedBorder == null)
                             unselectedBorder = BorderFactory.createMatteBorder(2,5,2,5, table.getBackground());
                        setBorder(unselectedBorder);
              //setToolTipText("RGB value: " + newColor.getRed() + ", " + newColor.getGreen() + ", " + newColor.getBlue());
              return this;
    * the editor based on ColorEditor.java at http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ColorEditor.java
    import javax.swing.AbstractCellEditor;
    import javax.swing.table.TableCellEditor;
    import javax.swing.JButton;
    import javax.swing.JColorChooser;
    import javax.swing.JDialog;
    import javax.swing.JTable;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class ColorEditor
         extends AbstractCellEditor
         implements TableCellEditor, ActionListener
         Color currentColor;
         JButton button;
         JColorChooser colorChooser;
         JDialog dialog;
         protected static final String EDIT = "edit";
         public ColorEditor()
              //Set up the editor (from the table's point of view),
              //which is a button.
              //This button brings up the color chooser dialog,
              //which is the editor from the user's point of view.
              button = new JButton();
              button.setActionCommand(EDIT);
              button.addActionListener(this);
              button.setBorderPainted(false);
              //Set up the dialog that the button brings up.
              colorChooser = new JColorChooser();
              dialog = JColorChooser.createDialog(button,
                   "Pick a Color",
                   true, //modal
                   colorChooser,
                   this, //OK button handler
                   null); //no CANCEL button handler
          * Handles events from the editor button and from
          * the dialog's OK button.
         public void actionPerformed(ActionEvent e)
              if (EDIT.equals(e.getActionCommand()))
                   //The user has clicked the cell, so
                   //bring up the dialog.
                   button.setBackground(currentColor);
                   colorChooser.setColor(currentColor);
                   dialog.setVisible(true); //Make the renderer reappear.
                   fireEditingStopped();
              else
                   //User pressed dialog's "OK" button.
                   currentColor = colorChooser.getColor();
         //Implement the one CellEditor method that AbstractCellEditor doesn't.
         public Object getCellEditorValue()
              return currentColor;
         //Implement the one method defined by TableCellEditor.
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
              currentColor = (Color)value; return button;
    /** THE SIMPLE CALENDAR WRITTEN TALIORED TO WORK WITH DIALOGS*/
    import javax.swing.*;
    import java.util.Calendar;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.SimpleDateFormat;
    //import java.beans.*; //property change stuff
    public class CalendarDialog
         extends JDialog
         //implements PropertyChangeListener
         private JButton[] btn = new JButton[49];
         private int month = Calendar.getInstance().get(Calendar.MONTH);
         private int year = Calendar.getInstance().get(Calendar.YEAR);
         private JLabel lbl = new JLabel("", JLabel.CENTER);
         private JOptionPane optionPane;
         private String curDate = null;
         private JTextArea output = new JTextArea(curDate, 1, 20);
         private String btnString1 = "Enter";
         private String btnString2 = "Cancel";
         public CalendarDialog()
              //super(aFrame, true);
              setContentPane(buildGUI());
              setDates();
         public JPanel buildGUI()
              JPanel panel = new JPanel();
              String[] header = { "Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" };
              JPanel midPanel = new JPanel(new GridLayout(7, 7));
              for (int x = 0; x < btn.length; x++)
                   final int selection = x;
                   btn[x] = new JButton();
                   btn[x].setFocusPainted(false);
                   if (x < 7)
                        JLabel lbl = new JLabel(header[x], JLabel.CENTER);
                        lbl.setFont(new Font("Lucida", Font.PLAIN, 10));
                        midPanel.add(lbl);
                   else
                        btn[x].addActionListener(new ActionListener()
                             public void actionPerformed(ActionEvent ae)
                                  displayDatePicked(btn[selection].getActionCommand());
                        midPanel.add(btn[x]);
              JPanel lowPanel = new JPanel(new GridLayout(1, 3));
              JButton prevBtn = new JButton("<< Previous");
              prevBtn.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        month--;
                        setDates();
              lowPanel.add(prevBtn);
              lowPanel.add(lbl);
              lowPanel.add(output);
              JButton nextBtn = new JButton("Next >>");
              nextBtn.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        month++;
                        setDates();
              lowPanel.add(nextBtn);
              JPanel outputPanel = new JPanel();
              Object[] options = { btnString1, btnString2 };
              optionPane =
                   new JOptionPane(
                        output,
                        JOptionPane.QUESTION_MESSAGE,
                        JOptionPane.YES_NO_OPTION,
                        null,
                        options,
                        options[0]);
              outputPanel.add(optionPane);
              panel.setLayout(new BorderLayout());
              panel.add(lowPanel, BorderLayout.NORTH);
              panel.add(midPanel, BorderLayout.CENTER);
              panel.add(outputPanel, BorderLayout.SOUTH);
              return panel;
         public void setDates()
              for (int x = 7; x < btn.length; x++)
                   btn[x].setText("");
              SimpleDateFormat sdf = new SimpleDateFormat("MMMM yyyy");
              Calendar cal = Calendar.getInstance();
              cal.set(year, month, 1);
              int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
              int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
              for (int x = 6 + dayOfWeek, day = 1; day <= daysInMonth; x++, day++)
                   btn[x].setText("" + day);
              lbl.setText(sdf.format(cal.getTime()));
         public void displayDatePicked(String day)
              if (day.equals("") == false)
                   SimpleDateFormat sdf = new SimpleDateFormat("EEEE d MMMM, yyyy");
                   Calendar cal = Calendar.getInstance();
                   cal.set(year, month, Integer.parseInt(day));
                   curDate = sdf.format(cal.getTime());
                   //JOptionPane.showMessageDialog(this, "You picked " + sdf.format(cal.getTime()));
                   output.setText(sdf.format(cal.getTime()));
         public String getDate()
              return curDate;
         public void setDate(String date)
              curDate = date;
    }

    well, i have indeed narrowed down my problem after some digging around.. one thing i discovered that i don't need CalendarRenderer.java.. and i found out i don't really know what does
    //Implement the one method defined by TableCellEditor.
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
              curDate = (String)value; return button;
         }do, as it seems to be the problem:
    java.lang.ClassCastException
         at CalendarEditor.getTableCellEditorComponent(CalendarEditor.java:78)
         at javax.swing.JTable.prepareEditor(JTable.java:3786)
         at javax.swing.JTable.editCellAt(JTable.java:2531)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.adjustFocusAndSelection(BasicTableUI.java:510)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mousePressed(BasicTableUI.java:494)
         at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
         at java.awt.Component.processMouseEvent(Component.java:5097)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3195)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    mmm.. does anyone know what i should modify for that to work?

  • Help with creating a custom component.

    Hi. I have created a really simple custom component called
    myComp. It is a simple Canvas 100 pixels x 100 pixels with an Image
    control component.
    <mx:Canvas>
    <mx:Image id="image1">
    </mx:Canvas>
    After instantiating the component in Main.mxml eg. var
    pic1:myComp = new myComp(); I am having a problem setting the
    source property of the Image component.
    "image1" is the id of mx:Image in the custom compoenent so I
    tried pic1.image1.source = "assets/ball.jpg" but I get a run time
    error "Error #1009: Cannot access a property or method of a null
    object reference".
    Don't really know what I am doing wrong.
    Any help please!

    In your custom component, try adding a bindable public var
    which contains the path to your image. Also, set the image.source
    to this var.
    In your main app, set the var within the <mx:> tags of
    the custom component. Since it is a public var, it will show up in
    the code hint. You can also now change the image var from the main
    app anytime you like using ActionScript code.

  • Help with calling a Get URL

    I am having a problem with calling a series of web pages
    within my movie. I have an index.fla that I publish to html. Within
    the index.html, I am calling multiple swf files to load content.
    Home.swf loads when the index page displays. Then the user clicks
    on any button and each button loads another swf replacing the main
    content with perhaps loading it's own swf files of content also.
    Everything is working fine. However, on one called swf file, called
    students.swf, I also have a menu swf file that is called when
    students loads. This menu swf file has text listed with
    actionscripting calling a data file that causes the text to expand
    and rollout and display a label of the url. When the user clicks on
    the list name I have a get url to the url of the label. Everything
    works fine in the swf files when I test the movies for the swf for
    the menu file and for the student file swf. However, when I publish
    and run the index page and start testing out the student swf that
    is called, the menu will not open up a new browser window with the
    link designated in the get url. I can't figure it out! It works
    fine in the swf files, but not when I test it out through the index
    controlling file. Please Help!!!

    if you're using as2, try adding
    this._lockroot=true;
    to the movieclip that contains getURL, the student file
    swf.

Maybe you are looking for