One program for pc and mac with different imports

I am trying to port my Java program from the PC to the MAC. I would like to have one program that works on both, the PC and the MAC. So I am using the
if (System.getProperty("mrj.version") == null) //PC
else //MAC
condition to see if I am on the PC or MAC for making sure that the About menu is at the Help menu on top of the application window (PC) or at the Program menu on top of the screen (MAC) and the Control key (PC) or Command key (MAC) is used.
However, the Mac also uses additional imports, such as
import com.apple.laf.*;
import com.apple.mrj.*;
import com.apple.eawt.*;
I cannot make an if statement before the imports. How can I make sure that the imports are only used on the MAC?
Thanks for your time!

>
..my program has a GUI...>Cool. OK - if you have not tried applications launched by JWS (Java Web Start) it is usually handy to get a feel for how they work for the end user. The biggest difference is between sandboxed applications, and ones that request extended permissions in the form of either j2ee-application-client-permissions or all-permissions. The first removes the warning banner from the bottom of windows, and adds a few other allowable actions, while the latter is, as it implies - all permissions.
Examples of all-permissions/sandboxed can be seen in this [demo of the JNLP fileservice|http://pscode.org/jws/api.html#fs].
>
.. It is a computer graphics program, and it has a Tools palette where you can specify what and how you want to draw or select or move, and it has a Measurements palette, where you can use numbers for your drawing.>Does it offer to export the resulting graphics (e.g. save them to disk)? Does the program load graphic objects from disk? The reason I pointed to a demo of the differences between sand boxed and trusted apps., is because if the app. wants to 'access the local disks' it will either need to request all-permissions or as demonstrated in the example, use the [JNLP API|http://java.sun.com/javase/6/docs/jre/api/javaws/jnlp/index.html] (a group of classes only available to apps. launched by webstart) to do common things like access disks or printer, or take control of downloads...
If you click the [Launch File Service (sandboxed) demo|http://pscode.org/jws/filetest-sandbox.jnlp] link, you can see what the experience would be like for the end user if the app. were converted to use the JNLP API for file I/O and was delivered entirely sandboxed.
Of course, if your app. could work entirely sand boxed, like an applet - no code signing or extra permissions would be necessary, but that is uncommon for a desktop application.
>
So could you please give me some explanation or reference how to do launching it using webstart, and putting the mac specific resources into a resource section flagged for the Mac? >Launching an app. via webstart is not entirely 'simple', especially if you are new to it. OTOH it is well worth the effort - for the sake of the end user.
The very basics of webstart is that you create a JNLP file to launch the app., I guess it is similar to the Mac .plist (or whatever they are) that you are discussing in another thread. Java JNLP files are a form of XML. Here is an example of what one might look like for an app. that provides different resources to different OS.
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0"
      codebase="http://ananya.com/lib"
      href="ananyacurves.jnlp">
  <information>
    <title>Ananya Curves</title>
    <vendor>Ananya Systems</vendor>
    <description>Ananya Curves - Computer Graphics</description>
    <offline-allowed/>
    <shortcut online="false">
      <desktop/>
      <menu submenu="AnanyaSystems"/>
    </shortcut>
  </information>
  <security>
       <all-permissions />
  </security>
    <resources>
      <j2se version="1.6+" />
      <jar href="AnanyaCurves.jar" main='true' />
    </resources>
    <!-- This is it! Supply the mac specific classes ONLY to Macintosh OS. -->
    <resources os='Mac'>
      <jar href="mac-specific.jar" />
    </resources>
  <application-desc />
</jnlp>
>
..Well, I am a complete beginner at this.>It can be a steep learning curve to first use JWS successfully, but it is well worth it.
There is a good [overview of webstart|http://java.sun.com/developer/technicalArticles/Programming/jnlp/], but I also find it handy to keep the documentation on the [JNLP file syntax|http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html] nearby.
Unfortunately many IDEs (and people) are not that competent at writing JNLP files, so I provide a JNLP XSD and [YAX-V|http://pscode.org/xml/xmltools.html#yaxv] to validate them.

Similar Messages

  • What is the best All in One program for picture and video editing?

    Hello i am new to photoshop and would like to really make some fantastic photos and video for my family and friends. I want to add effects to video and Edit photos to the 10th degree. Can someone please recommend an Adobe program. Should i get CS4 extended should i get master suite? Also where can i watch Video Tutorials that start from the basic and lead to the complex. Thanks in advance

    What is the best All in One program for picture and video editing?
    There is no such thing. If there were, nobody would bother writing different applications. If you are primarily focused on still image editing and video, Adobe Production Premium is the way to go. You can find any number of tutorials just by searching Google and many good ones are linked from the Adobe help systems as well.
    Mylenium

  • Does apple have program for kids and adults with learning disabilities

    My daughter has learning disabilities and we were wondering if Apple has program that supports adults with disabilities. We thought that the gps function and Siri would be a wonder tool to help her if she gets lost.  We want to teach her independence and so that means letting her do things on her own. We want to get her an Iphone but have to wait untill our contract comes due. Any suggestions on who to contact at Apple?

    I don't believe that Apple makes any specific programs for "people with disabilities". That is term covers such a broad range of issues! People who are blind have different needs than people with autism or people with spinal cord damage. Apple does include various accessibility options as part of the iOS.
    However, just because Apple doesn't create such apps doesn't mean they don't exist. I would start be looking around the App Store (which you can do by downloading iTunes to your computer). There will no doubt be general purpose apps that can be useful as well as apps designed for specific needs. Also, contact a support group for whatever specific disabilities your daughter has. They may have a forum or blog where useful apps are discussed. Do an Internet search for apps and her specific issues.
    Best of luck.

  • Used a different adobe sign in for Trial and bought with different adobe email address.  we received and email but we can't   get the serial number. how do we get it?

    how do we retrieve serial number bought on a different email address than the adobe email that was used for the trial version?

    Hello Karen,
    in this case you should search for Adobe's staff members by writing a personal message. They can often help better than we, we the users like you. Please have a look in the forum to persons with this icon under their avatar:
    Hans-Günter
    P.S.
    Very often Preran works as the "good spirit".

  • Thunderball on one computer for private and studio, two different addresses

    Hello and goodevening,
    I am a artist. Have private emails for which I use Thunderbird.
    I have also a small studio, and I would like to use Thunderbird also for my studio. But not on the same page as my private emails.
    I prefer to open a new Thunderbird ( I do not know how to epress myself in this, because i am not a computerman) with a account for my studio.
    Is that possible?
    Hope you can provide me with a solution.
    Kind regards
    Nicholas

    You can create a new profile and set-up your studio account in it.
    https://support.mozilla.org/en-US/kb/using-multiple-profiles
    Then always start Thunderbird with the -profilemanager option, and pick the desired profile. You can modify your existing desktop shortcut for Thunderbird accordingly.

  • Win and Mac with one CC account

    Is ist possible to use one CC account for Win and Mac? I have now PS CS5 installed on my Win PC and would to like it run on my Mac. Is it possible?
    Thank you

    Hello, with CC, there is no problem, you will be able to install in both plaforms if you want: http://www.adobe.com/products/creativecloud/faq.html
    Fro CS5, it was a different serial number.

  • Can I access both platforms, window and mac with one cloud account

    can I access both platforms, window and mac with one cloud account

    Yes.
    One Cloud membership = 2 software activations: Win/Win or Mac/Mac or Win/Mac.
    http://www.adobe.com/au/products/creativecloud/faq.html
    "Are there any unique benefits that come with my paid membership?
    Yes, as a member of Creative Cloud, you get many benefits that you do not get when you purchase a traditional shrinkwrapped product:
    Access to both the Mac OS and Windows® versions of the desktop applications and the ability to install them on your primary computer and one backup computer. So, if you have a Mac at home and a PC at work, you can install your applications on both as long as they are not running at the same time. See the product license agreements page for more information."

  • I am unable to download iPhoto version 9.5 and iMovie version10.0, with my apple ID due to remark, this update is for an app downloaded with different Apple ID,Sign in with that Apple ID and try again,but I don't have other ID

    I am unable to download iPhoto version 9.5 and iMovie version10.0, with my apple ID due to remark, this update is for an app downloaded with different Apple ID,Sign in with that Apple ID and try again,but I don't have other ID.
    <Email Edited by Host>

    The Early 2011 MacBook Pro shipped with Snow Leopard, so these are not the Mac App Store versions of iLife, they are the boxed software versions.
    If they are in an iWork '09 folder take them out and let them loose in the Apps folder. Then reindex your HDD.
    Spotlight: How to re-index folders or volumes -
    http://support.apple.com/kb/ht2409

  • My account names for iCloud and iTunes is different, is this why my Iphone4 is not syncing with my iMac?

    My account names for iCloud and iTunes is different, is this why my Iphone4 is not syncing with my iMac?

    No, perfectly normal to have a separate iTunes account for music/app purchases to the one you use for iCloud syncing of contacts, notes, etc.

  • HT201328 I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first or set one up for her and then unlock the phone.

    I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first ( I now have a new iphone on this account) or set one up for her and then unlock the phone. I am worried about upsetting the new phone.

    I would complete unlocking as is and then
    restore as new once you know the iPhone is unlocked
    Be aware Orange will process the request at their speed
    one of the reasons they usually reside at bottom of User Sat surveys
    will likely take weeks
    This may also help
    http://support.apple.com/kb/HT5014

  • I have a mixer which i was using with my pc and now i bought a new macbook and it have only one jack for headphones and to use mixers i need jack for microphone too so what should i do

    i have a mixer which i was using with my pc and now i bought a new macbook and it have only one jack for headphones and to use mixers i need jack for microphone too so what should i do

    You need to get headset splitter adapter.
    http://www.startech.com/Cables/Audio-Video/Audio-Cables/35mm-4-Position-to-2x-3- Position-35mm-Headset-Splitter-Adapter-Male-to-Female~MUYHSMFF

  • Aperture keeps crashing. "Check with developer to make sure aperture works with version of mac os x you might need to reinstall the application ..be sure to install any updated for aplication and mac os x"

    "Check with developer to make sure aperture works with version of mac os x you might need to reinstall the application ..be sure to install any updated for aplication and mac os x"
    I updated aperture and os x. Latest versions. I also reinstalled aperture. Still getting the same.  please help

    Process:    
    Aperture [448]
    Path:       
    /Applications/Aperture.app/Contents/MacOS/Aperture
    Identifier: 
    com.apple.Aperture
    Version:    
    3.2.2 (3.2.2)
    Build Info: 
    Aperture-201096000000000~2
    App Item ID:
    408981426
    App External ID: 5333832
    Code Type:  
    X86-64 (Native)
    Parent Process:  launchd [125]
    Date/Time:  
    2012-02-24 23:05:55.982 +0000
    OS Version: 
    Mac OS X 10.7.3 (11D50b)
    Report Version:  9
    Interval Since Last Report:     
    18654 sec
    Crashes Since Last Report:      
    20
    Per-App Crashes Since Last Report:   20
    Anonymous UUID:                 
    244A3A5D-F483-4E17-AFD2-B35CB6B4EBD4
    Crashed Thread:  0
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Application Specific Information:
    dyld: launch, loading dependent libraries
    Dyld Error Message:
      Library not loaded: /Library/Frameworks/PluginManager.framework/Versions/B/PluginManager
      Referenced from: /Applications/Aperture.app/Contents/MacOS/Aperture
      Reason: no suitable image found.  Did find:
    /Library/Frameworks/PluginManager.framework/Versions/B/PluginManager: no matching architecture in universal wrapper
    I havnt installed anything for last 10-15 days.
    Aperture library located on hd.
    12 ram  870GB free space

  • On my dashboard I have an icon with this @ on top.  One is for facebook and one is for Pinterest.  Can I rename them?

    On my dashboard, I have two icons with this @ on top.  One is for facebook and one is for Pinterest.  I would like to rename them or put the FB symbol something so they are easier to identify.  Is this possible?

    Tap the rectangle over the 2 lines and make sure it no longer shows up in red. At this point, you should have only the month view, no daily appointments below. Now press on a specific day, and this will either:
    1. Take you into the daily view with the hourly breakdown. If this is the case, tap the three horizontal lines at the top to get the list.
    2. Take you directly to the list view

  • I recently left my computer at a hospital by mistake.  I have find my phone app and then noticed that app also works for ipad and mac.  Does it work with Snow Leopard?

    I recently left my computer at a hospital by mistake.  I have find my phone app and then noticed that app also works for ipad and mac.  Does it work with Snow Leopard?

    No.
    The iCloud services require 10.7.5, or higher.

  • Best program for monitoring and blocking internet use on my kids mobile devices, iPads, iPhones from my MAC

    Whats the best program for monitoring and blocking internet sites and usage for my kids on their mobile devices ipads, iphones and ipods, all from my desktop mac?

    Can't be done from your Mac remotely.
    But you can enable parental controls directly on iOS devices.
    iOS: Understanding Restrictions (parental controls)

Maybe you are looking for