From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5f5005f2e54d1fc9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Steffen Huber Newsgroups: comp.lang.ada Subject: Re: jgnat - Date: Wed, 17 Mar 2010 00:01:42 +0100 Organization: LambdaComm System Message-ID: <80agumFaotU1@mid.individual.net> References: Reply-To: steffen@huber-net.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net g0ToKHcWyI43kcennn5MuQWxrUaNKYXH6sJeCqSBt3y6qEfNQ= Cancel-Lock: sha1:r8JvWsg69YaxqJasfvhGpmeob4c= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:9617 Date: 2010-03-17T00:01:42+01:00 List-Id: RasikaSrinivasan@gmail.com write: > All > > Looking for ideas. I am experimenting with Jgnat - ada targeting the > jre. The goal is to experiment with GUI using Java Swing/Awt from Ada. > Also will be trying to access some libraries developed in java. I downloaded GNAT GPL 2009 a few days ago and started to experiment a bit. Basically, it is (nearly) a nightmare. Don't try to use GPS for anything. It is (IMHO) an unstable pile of crap with a horrible UI. Don't try to make Eclipse work with GNATbench and jvm-gnat and expect easy integration into other Eclipse Java stuff. I think it is a real shame that no completely integrated package is available for this certainly interesting technology. It is no wonder that most people just use another language. > Looking for some ideas on how to organize such a project: > > - First for the entire JRE - I am not sure if I will need bindings to > the entire library - probably only the high level interfaces. Should I > plan on generating bindings for all of JRE and genering an ali for > them? Just follow the docs. Create the ads files for the whole Java runtime. When you compile your first Ada program using Swing, it is likely that you encounter a compile error somehwere in java.net.xxx because of a duplicate symbol (at least when you use the Java 1.6.0_1x runtime), but this is easily fixed. Here is a complete example which just opens a Swing JFrame from Ada: with java; use java; with javax.swing; use javax.swing; with javax.swing.JFrame; use javax.swing.JFrame; with java.lang; use java.lang; with java.lang.String; use java.lang.String; procedure SimpleFrame is frame : JFrame.Ref := null; begin frame := JFrame.New_JFrame; frame.setTitle(+"Hello World - a Swing Frame from Ada!"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack; frame.setSize(320,200); frame.setVisible(true); end SimpleFrame; Steffen -- Steffen Huber hubersn Software - http://www.hubersn-software.com/