Making Clickable Executable

After I have created a program, how can I make it click-executable (meaning, I can click an desktop icon and it will run). Do I need to create a batch file(Windows)? How do I support Macintosh users?

Make it an executable Jar file using the Jar tool

Similar Messages

  • UWL workitems become non clickabl/executable

    Hi,
    We have a huge problem with UWL workitems that become non-clickable/executable overnight.
    This problem only applies to the Workitems that use the Webflow principles (BIT603, so using xHandlerLauncher in UWL config file)
    In the portal logging, we sometimes see the following errors/warnings when this problem occurs:
    warning 2009-05-20 12:48:28:840 com.sap.netweaver.bc.uwl.UWLException: Wed May 20 12:48:28 CEST 2009
    (Connector) Invalid argument or value or null used
    /uwl/ui com.sap.netweaver.bc.uwl.ui.creators.TableColumnCreator sap.com/tcwddispwda euax419-zep Server 1 2_33229
    Full Message Text
    com.sap.netweaver.bc.uwl.UWLException: Wed May 20 12:48:28 CEST 2009
    (Connector) Invalid argument or value or null used 
       warning 2009-05-20 12:48:28:840 No logical system id available for backend system <EUP-300>
    /uwl/service/connector/webflow com.sap.netweaver.bc.uwl.core.connect.webflow.XHandlerLauncher.getUrl() sap.com/tcwddispwda euax419-zep Server 1 2_33229
    Full Message Text
    No logical system id available for backend system <EUP-300>
    So it seems that the link is not shown due to the fact that a logical system could not be found for the given UWL system.
    Moreover, sometimes we have people logging on to the portal where the task is executable and for others not.  This might be caused by 2 virtual systems we have in our landscape where the connectivity/logical system is correctly defined or buffered for 1 virtual server but on the other it is not!
    Can someone please help us with this
    Many thanks
    Pascal Decock

    Hi Pascal Decock,
    try this,
    goto tcode>SBWP>settings>workflowsettings>Refresh organizational environment. hope it works.
    Regards
    Bhaskar

  • UWL workitems become non clickable/executable

    Hi,
    We have a huge problem with UWL workitems that become non-clickable/executable overnight.
    This problem only applies to the Workitems that use the Webflow principles (BIT603, so using xHandlerLauncher in UWL config file)
    In the portal logging, we sometimes see the following errors/warnings when this problem occurs:
    warning 2009-05-20 12:48:28:840 com.sap.netweaver.bc.uwl.UWLException: Wed May 20 12:48:28 CEST 2009
    (Connector) Invalid argument or value or null used
    /uwl/ui com.sap.netweaver.bc.uwl.ui.creators.TableColumnCreator sap.com/tcwddispwda euax419-zep Server 1 2_33229
    Full Message Text
    com.sap.netweaver.bc.uwl.UWLException: Wed May 20 12:48:28 CEST 2009
    (Connector) Invalid argument or value or null used
    warning 2009-05-20 12:48:28:840 No logical system id available for backend system <EUP-300>
    /uwl/service/connector/webflow com.sap.netweaver.bc.uwl.core.connect.webflow.XHandlerLauncher.getUrl() sap.com/tcwddispwda euax419-zep Server 1 2_33229
    Full Message Text
    No logical system id available for backend system <EUP-300>
    So it seems that the link is not shown due to the fact that a logical system could not be found for the given UWL system.
    Moreover, sometimes we have people logging on to the portal where the task is executable and for others not. This might be caused by 2 virtual systems we have in our landscape where the connectivity/logical system is correctly defined or buffered for 1 virtual server but on the other it is not!
    Can someone please help us with this
    Many thanks
    Pascal Decock

    Hi,
    Were you able to find the cause for this?
    Regards,
    MK

  • [b]Simple Deploy problem- making an Executable JAR File ...PLEASE HELP [/b]

    Hi all,
    I Trying to deploy a simple J2SE app by making an Executable JAR File, however I don'r understand how to add a valid value to the Main Class field.
    I followed the following description within Jdev, after creating a Deployment Profile:
    Deploying an Executable JAR File
    You can make your simple archive or J2EE Client Module into an executable JAR file that you can launch with the java command.
    To deploy an executable JAR file:
    1) Select and right-click the simple archive or client icon in the Navigator to display the context menu.
    2) Choose Properties.
    3) Click JAR Options in the tree.
    4) Select Include Manifest File (META-INF/MANIFEST.MF).
    5) In the Main Class field, enter the fully qualified name of the application class that is to be invoked.
    7) Click OK.
    8) Launch the executable JAR file from the command line:
    java -jar myapp.jar
    where myapp represents your JAR file name.
    Like I said it's in 5) I'm doing something worng
    My deploy-file (PlotPrint.deploy) looks the following:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <client-deployment xmlns="http://xmlns.oracle.com/jdeveloper/903/deploy/j2ee-client-jar" nselem="client-deployment" class="oracle.jdeveloper.deploy.jar.ClientProfile">
    <archiveOptions>
    <additionalManifests/>
    <compressed>false</compressed>
    <hasManifest>true</hasManifest>
    <mainClass>PlotPrintClient</mainClass>
    </archiveOptions>
    <archiveTargetPlatform/>
    <cdaSettings>
    <additionalArchives/>
    <afterFilters/>
    <beforeFilters/>
    <duringFilters/>
    <selectedArchives>
    <archives>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/classes12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/nls_charset12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdev/lib/jdev-rt.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/soap/lib/soap.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/javax-ssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/jssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/activation.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/mail.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/http_client.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/webservices/lib/wsdl.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlcomp.jar!/"/>
    </archives>
    <selectionMode>0</selectionMode>
    </selectedArchives>
    </cdaSettings>
    <defaultConnection class="java.lang.String"/>
    <deployClientMaxHeapSize/>
    <earURL path="deploy/PlotPrint.ear"/>
    <enterpriseAppName/>
    <jarURL path="deploy/PlotPrint.jar"/>
    <profileDeps/>
    <properties/>
    <selectedProjectFiles>
    <autoInclude>true</autoInclude>
    <deploySourceAs>0</deploySourceAs>
    <files class="[Ljava.net.URL;"/>
    <selectionFilters/>
    </selectedProjectFiles>
    </client-deployment>
    I using Oracle9i Jdev, but have also tried it un the new Jdev 10g version, but the same problem everytime:
    Error message: Could not find the main class: program will exit.
    Please help I really need this to work
    Message was edited by:
    MHCI
    Message was edited by:
    MHCI

    Yes that was the problem so I have changed the element mainClass to
    <mainClass>xxPlotPrint.MHCI.PlotPrintClient</mainClass>
    But now another probem has occured, since I get the following error when run the jar-file (When I run the app from within Jdev there are no warnings or errors).
    ----Batch-file-----
    @echo off
    java -jar PlotPrint.jar
    echo Test Plot and Print Batch-file!
    pause
    ---- out to cmd ----
    Exception in thread "Thread-0" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE35_worker.run(NNE35_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-2" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.OCEJobDB_worker.run(OCEJobDB_worker.java:41)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-1" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE27_worker.run(NNE27_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    It's the same problem in all three exceptions (the exactly the same code), however I was a bit to quick this is the line (the line before I process the xml doc :-)
    import org.w3c.dom.Element;
    responseData = new Vector();
    responseData = test_NNE35_SOAP.getXSDdoc();
    Element elements = ( (org.w3c.dom.Element)responseData.elementAt(0) ); (line 42)
    Please help I don't understad why I receive this exception, since I included the xmlparserv2.jar file, and don't even have a workaround :-(

  • Making clickable links in GUI?

    Hi,
    Well, I'm making an GUI application and I wanted to have a clickable link to my website, I thought using HTML would be a good bet, but it doesn't work, I was thinking of using util but I'm not exactly sure..

    Swing related questions should be posted in the Swing forum.
    JEditorPane provide some basic support for loading HTML pages. Read the API for more info.
    You can invoke IE as follows:
    **  Here is a pure Windows solution
    **  Run the code and you will be taken to a tutorial that may provide
    **  a more generic solution
    public class WindowsFileProtocolHandler
         public static void main(String[] args)
              throws Exception
              String[] cmd = new String[4];
              cmd[0] = "cmd.exe";
              cmd[1] = "/C";
              cmd[2] = "start";
              cmd[3] = "http://www.javaworld.com/javaworld/javatips/jw-javatip66.html";
    //          cmd[3] = "will.xls";
    //          cmd[3] = "mailto:";
    //          cmd[3] = "a.html";
    //          cmd[3] = "file:/c:/java/temp/a.html";
              Process process = Runtime.getRuntime().exec( cmd );
    }

  • Making an executable file

    Does anyone knows how can i create an executable file using java?
    i want to do an application that anyone who has windows can do double click in a file made with java and my application begins,
    thank you!

    .jar ara java executables but you can not double
    click them to initialize them, you need to go to a
    console a put: java name.jarDepends on how it your host platform is set up, on most windows, Linux & MacOS X computers with the JRE installed, JARs are double clickable.
    but what i need is a EXE file: name.exe and when you
    double click the application beginsYou can use webstart (does not create an exe, but does create an double clickable icon), or shell scripts, or you can just search the forum, it has been answered so many times before. It is asked more than once a day!

  • Making an executable

    How do you make an executable from a java program.
    I use kawa.
    Thanks!

    Dmb,
    Can you please explainf what is meant by :
    Adding a Main-Class attribute to a jar's manifest will
    make that jar double clickable.
    Thank youSure, create an ordinary text file, and put this in it:
    Manifest-Version: 1.0
    Main-Class: MyMainEntryClass
    That is, list the class that has the static main method you want to start with, including packages as necessary. com.foo.MyMain, etc
    Then when you jar up your class files, specify this as your manifest file.
    So assume you save the above file as foo.manifest, you would do
    jar cvfm foo.jar foo.manifest *.class

  • Problem running my program only after making an executable jar...

    Hi everyone,
    I am having trouble running my program after creating an executable jar. The program runs fine until
    it is supposed to open a specific JFrame. I get the following error message as soon as the frame tries
    to open:
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.apache.xerces.parsers.SAXParser.<init>(Lorg/apache/xerces/xni/parser/XMLParserConfigurat
    ion;
    Has anyone ever seen this before?
    The strange thing is, this does not happen when I build and run the project under Eclipse.
    Any help or tips would be appreciated!
    Chris

    Roosh wrote:
    The strange thing is, this does not happen when I build and run the project under Eclipse.
    Any help or tips would be appreciated!Make sure you are using the same version of Java as you use with Eclipse.

  • Making clickable buttons to open xml images in gallery

    I want to do an xml grid image gallery similar to http://www.republicofcode.com/tutorials/flash/as3gridgallery/
    However, instead of using thumbnails, I already have images on my site that I want to make clickable buttons to open the images in the gallery...how would I script these buttons?
    [link removed by moderator]

    If you want it to be similar to the one you link then use the images in the grid like in the one you linked.

  • Making java executable as a service in solaris10

    Hi all,
    I have written a set of class files and have put them in a jar file.
    now i would like to execute that jar file as a service in solris 10.
    can you please give all possible ways for this.
    i know how to make method script when using SMF facility..
    thanks in advance
    RaghuDeep Amilineni

    Does the OS know the notion of "service", or is it an imported term from Windows?
    http://en.wikipedia.org/wiki/Daemon_(computer_software)
    On the other hand:
    http://oreilly.com/pub/a/sysadmin/2006/04/13/using-solaris-smf.html
    Edited by: BIJ001 on 2008.12.15. 14:00

  • Error in making RT executable file

    Dear Sir,
    I had build a project in Labview 2011 version and now I have upgraded to labview 2013 version. I want to make an executable file and deploy onto RT Target but when I start building the exe file following message appears
    Detail Disable dialog.vi and Not found dialog .vi does not support the current target.
    Error 1003 occured at AB_Get_detailed_brokenVI_Message.vi and AB_Targetfile.lvclasspen_top_level_vis.vi
    Please suggest me some solution as soon as possible.

    Did you understand Gerd's reply?  RT (Real-Time) targets run a special "Real-Time" Operating System, specifically not Windows, and do not support the usual user interaction via the Front Panel.  You may have run across the term "Head-less System", which means a system, running a program, but without user interaction.
    When you build an application for Windows, you end up with an "executable" having the extension ".exe".  This is designed to be started by selecting the application and getting it to run, for example, by double-clicking it (the "default" action).  In contrast, building a stand-alone executable for an RT system gives you a file with the extension ".rtexe" -- such a file (to the best of my knowledge) can only be executed by being "marked" on the Target as the "Start-up application".  The idea is when you turn your Real-Time Target on, it automatically loads the (single) Executable that you built, and starts running it "head-lessly".
    Hope that clarifies things.
    BS

  • Making an Executable on JDeveloper

    hi all,
    I implement my project using Oracle Jdeveloper.
    and at the end it is finished :) But i have an critical problen right now
    I do not knoe how to create an executable file of my project using Jdeveloper.
    if you knoe please help me...

    I've developed Java Application mostly by XYLayout in JDeveloper 10g. I tried to convert it to exe by using Install Anywhere software(Trail Version). When i was tried to install that exe , it is showing the below error,
    java.lang.NoClassDefFoundError: oracle/jdeveloper/layout/XYLayout
         at mypackage.menu.<init>(menu.java:45)
         at mypackage.HOme.main(HOme.java:18)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.zerog.lax.LAX.launch(DashoA8113)
         at com.zerog.lax.LAX.main(DashoA8113)
    Kindly help anyone to solve this problem.... its very urgent.... plz....
    thanking you
    Kalai.

  • I have problems making an executable

    I have problems for generate the .exe on labview 5.1.
    I have a main program that makes calls for other five programs. All of them
    are in the same library (llb), so in the build aplication window I add a
    dynamic VI. When a press BUILD it star to build the aplication but after
    some seconds it display an error:
    "Error 1 ocurred at invoke node in distchg and save.VIs.vi dist build llb
    image.vi dist build app image.vi build aplication.vi"
    Do any one has an idea for solving this problem.
    Thank you all.
    Alejandro Zepeda

    Alejandro,
    you may want to try and do a 'mass compile' also.
    pat
    "Jim Kring" wrote:
    >>Alejandro,>>A dynamic vi is a vi called in the code using VI server calls.
    It is not>directly used as a subVI (call by reference doesn't count) or
    the top-level>vi or other dynamic VIs. If you are not using VI server you
    should add your>main vi by using the "add top-level VI" option. This should
    work. Also>remember to save everything before you compile. This will ensure
    that the>linking is correct for all of the subVIs. Good luck. I've been
    using LabVIEW>for many years and still get the error messages when trying
    to build an executable.> Something makes me think that it's really not our
    fault >>-Jim>>"alejandro zepeda" net.mx> wrote>I have
    problems for generate the .exe on labview 5.1.>>I have a main program>that
    makes calls for other five programs. All of them>are in the same library>(llb),
    so in the build aplication window I add a>dynamic VI. When a press>BUILD
    it star to build the aplication but after>some seconds it display an>error>"Error
    1 ocurred at invoke node in distchg and save.VIs.vi dist build>llb>image.vi
    dist build app image.vi build aplication.vi">>Do any one has>an idea for
    solving this problem.>>Thank you all.>>>Alejandro Zepeda>>

  • Making clickable links in a TextArea?

    Hi there,
    I made a TextArea where several URLs are being displayed in the form (http://www.url.com)...does anybody know if it is possible to make these hyperlinks? So the user can click on whichever one they want and view it in their primary browser?
    If someone can help me here, I'd reallly appreciate it. Would be great.
    Thanks in advance,
    -jtk

    I made a TextArea where several URLs are being
    displayed in the form (http://www.url.com)...does
    anybody know if it is possible to make these
    hyperlinks? So the user can click on whichever one
    they want and view it in their primary browser?instead of using a TextArea you could use a Jlist
    then add a mouse_clicked event and then call
    Runtime.getRuntime().exec("cmd /c start "+tempString);
    where tempString is your URL in the list
    chidychi

  • Making clickable hex grids

    I try to implement MouseListener by using
    public class HexBoard extends Frame implements MouseListenerbut the error message says I need to define the class as a abstract class. After trying that, i still get a error message in main says my class constructor is wrong. can anyone here help me please
    import java.awt.*;
    import java.awt.event.*;
    public class HexBoard extends Frame {
        public static int board_size = 7;
        public static int width = 980;
        public static int height = 600;
        private static int cellSize = width / (board_size + 20);
        public static int radius = (cellSize + cellSize / 4) / 2;
        public static int center_x = width / 2 - radius / 4;
        public static int center_y = (height - radius) / 2;
        public static double[][] grids;
        public HexBoard() {
            grid();
            this.setSize(980, 600);
            this.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
        public void init() {
            grid();
        //addMouseListener(this);
        private void drawNeck(Graphics g, double x, double y, double r, int n, boolean filled) {
            Polygon p = new Polygon();
            for (int i = 0; i < n; i++) {
                p.addPoint((int) (x + r * Math.cos(i * 2 * Math.PI / n)),
                        (int) (y + r * Math.sin(i * 2 * Math.PI / n)));
            if (filled == true) {
                g.fillPolygon(p);
            } else {
                g.drawPolygon(p);
    //Draws a n-Eck polygon with the given parameter
        public void drawNeck(Graphics g, double x, double y, double r, int n) {
            drawNeck(g, x, y, r, n, false);
    //Draws a filled n-Eck polygon with the given parameter
        public void fillNeck(Graphics g, double x, double y, double r, int n) {
            drawNeck(g, x, y, r, n, true);
        //Draws oval
        public void draw_oval(Graphics g, double x, double y) {
            x = x - radius * Math.sqrt(2) * 0.5;
            y = y - radius * Math.sqrt(2) * 0.5;
            int x_value = (int) x;
            int y_value = (int) y;
            double r = radius * 1.5;
            int rr = (int) r;
            g.drawOval(x_value, y_value, rr, rr);
        //Draws oval
        public void draw_filloval(Graphics g, double x, double y) {
            x = x - radius * Math.sqrt(2) * 0.5;
            y = y - radius * Math.sqrt(2) * 0.5;
            int x_value = (int) x;
            int y_value = (int) y;
            double r = radius * 1.5;
            int rr = (int) r;
            g.fillOval(x_value, y_value, rr, rr);
    //here the paint method which needs to be modificated
        public void paint(Graphics g) {
            for (int i = 0; i < board_size * board_size; i++) {
                //draw_oval(g, grids[0], grids[i][1]);
    //draw_filloval(g, grids[i][0], grids[i][1]);
    drawNeck(g, grids[i][0], grids[i][1], radius, 6);
    // find the center of hexagon grids
    public void grid() {
    int count = 0;
    grids = new double[board_size * board_size][2];
    grids[0][1] = center_y;
    if (board_size % 2 != 0) {
    grids[0][0] = center_x - radius * (board_size + num_odd(board_size) - 1);
    } else if (board_size % 2 == 0) {
    System.out.printf("even");
    grids[0][0] = center_x - radius * (board_size + num_even(board_size) - 1) + radius / 2;
    for (int i = 1; i < board_size * board_size; i++) {
    count = count + 1;
    if (count == board_size) {
    count = 0;
    grids[i][0] = grids[i - board_size][0] + radius + radius / 2;
    grids[i][1] = grids[i - board_size][1] - radius * Math.sqrt(3) * 0.5;
    } else {
    grids[i][0] = grids[i - 1][0] + radius + radius / 2;
    grids[i][1] = grids[i - 1][1] + radius * Math.sqrt(3) * 0.5;
    // finds the number of odd numbers smaller than a bigger odd number
    public static int num_odd(int size) {
    int[] temp = new int[board_size];
    int num_odd = 0;
    int count = 0;
    for (int i = 0; i < size; i++) {
    temp[i] = count;
    if (temp[i] % 2 != 0) {
    num_odd = num_odd + 1;
    count = count + 1;
    return num_odd;
    // finds the number of even numbers smaller than a bigger even number
    public static int num_even(int size) {
    int[] temp = new int[board_size];
    int num_even = 0;
    int count = 0;
    for (int i = 0; i < size; i++) {
    temp[i] = count;
    if (temp[i] % 2 == 0) {
    num_even = num_even + 1;
    count = count + 1;
    System.out.printf("dd " + num_even);
    return num_even;
    public void changeSize(int size) {
    board_size = size;
    repaint();
    public void mouseReleased(MouseEvent e) {
    public static void main(String args[]) {
    HexBoard hex = new HexBoard();
    hex.setSize(width, height);
    hex.setVisible(true);
    }Edited by: gamewell on Apr 22, 2008 12:16 PM
    Edited by: gamewell on Apr 22, 2008 12:17 PM
    Edited by: gamewell on Apr 22, 2008 12:18 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    well, i didn't build the tile marix in the end. Instead, I calculated Euclidean distance between the hex grids center and a mouse Cursor point using nearest neighebor algorithm.
        public int CursorToGrid (int x, int y) {
            int grid_index = -1;
            double temp = Integer.MAX_VALUE;
            double distance[] = new double [board_size*board_size];
            // find the nearst neighbor using Euclidean distance
            for (int i = 0; i < board_size * board_size; i++) {
                distance[i] = Math.sqrt(Math.pow(grids[0]-x,2)+Math.pow(grids[i][1]-y,2));
    System.out.println(distance[i]);
    if (distance[i] < temp) {
    temp = distance[i];
    grid_index = i;
    // check if a click outsite the hex map
    if ( distance[grid_index] > radius) {
    grid_index = 10000;
    System.out.println("the grid " + grid_index);
    return grid_index;
    works:D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • How do i install a free osx or operating system on my macbook pro 2008?

    Hey so the go is i have a macbook pro 2008 i love it too bits but for some reason my screen flickers all the time but ill just have to deal with it. Secondly i cant install any operating systems because i dont have a mac to download osx from or mount

  • Can't boot WinXPpro on K8N Neo3 gold

    Setting up new mobo and cpu, keeping all old peripheral hardware, including hard drive with XP Pro. Old board was ASUS A7S333 with SIS745 chipset, new board is K8N Neo3 gold (MS-7135 ATX) with nVIDIA nForce4-4X chipset and AMD K8 cpu.  The hard drive

  • Photoshop CS6 doesn't recognize my Fuji XT-1 HD Movie File

    Hi all, Can anyone give me a hand with this? I keep getting an error message telling me that PSCS6 doesn't recognize this  FFDB.DAT file. I'm super confused because I thought all movies were supposed to show up as .mov. Can anyone help? I'd like to g

  • Airport express not working with iPad 4

    I have a brand new ipad 4.  My macbook pro routes audio to my stereo system superbly.  I instructed tjhe iPad to use the same network (Living Room) and it seemed to recognize it.  Ther was a check mark next to the selected network in WI FI.  However

  • Customer Master Text Information !!!!

    Hi Folks, I have a quick question on the maintenance of the Text at Customer master records. The question in paint here is that; 1. Can we use bring the free text maintained at Customer master level in the different reports like SQVI, ABAP reports? 2