Embedding/Wrapping a Native GUI App in Java?

Hi, we have loads of C++ GUI applications... I'd like to be able to embed/wrap some of them inside our swing app's. I believe this is possible, but don't actually know the terminology to get started with this.
--Cheers :)                                                                                                                                                                                                                                                                                                                                                                                                                                                           

This is going to be tricky, but as a starting point you might want to check out Java AWT native interface.
http://java.sun.com/j2se/1.5.0/docs/guide/awt/1.3/AWT_Native_Interface.html

Similar Messages

  • All java GUI apps suddenly never repaint

    This isn't really a programming question, but I've had a hell of a time finding help resources elsewhere (Sun's got the balls to charge money for the support document that will most likely help me!). Does anyone know anything about what might cause all Java GUI apps to never repaint? I just installed the Java 1.5 update 4 JRE & JDK, I'm running Windows XP SP2, and I have dual monitors, although turning the second one off (via the control panel) doesn't seem to help.
    Neither my own software nor commercial software will work (even NetBeans). They all load an empty JFrame, or paint themselves once and never again. Console apps seem to work just fine, though. If anyone knows how to fix this, has any suggestions on what I should try, or can tell me where to look for a solution, I'd be very grateful.
    Thanks,
    Tim

    I appreciate the help, and maybe I'm not following you, but this is happening for ALL Java GUI apps, even NetBeans itself won't repaint. Not sure how I have control over NetBeans's UI thread?
    Thanks
    Tim

  • Modularizing large FX gui apps, esp. using fxml developed by Scene Builder

    StarterApp - One large java source file.
    Trying Out the JavaFX UI Controls (Using the JavaFX UI Controls)
    StageCoach is a simpler app, but with fxml, controller, and main code in separate files.
    Allows manipulation using Scene Builder.
    https://code.google.com/p/jfxtras/source/browse/ProJavaFX/Chapter03/StageCoach?repo=samples&r=322042d9ac293fcd9dd8f63e1664df45a0c4746f
    I was lead to these by the book, Pro JavaFX 8:
    http://www.apress.com/9781430265740
    Rich as it is, the StartApp is one big piece of code, with no modules such as an fxml file.
    By spreading out the code for StarterApp and StageCoach and studying it carefully
    I should be able to build a system as large as StarterApp, but as a three-file combo.
    StarterApp has nothing that deals with concurrency or persistence - those will be my jobs.
    I'm doing this because I'm building a large NLP app.
    It needs a GUI for future users.
    - Bob F

    Take a look at some app examples from the open-jfx repository
      https://wiki.openjdk.java.net/display/OpenJFX/Quick+Start
    For a smallish app, see the ConferenceScheduleApp:
       openjfx/8u-dev/rt: 3d138300d935 /apps/experiments/ConferenceScheduleApp/
    For a (much) larger app, see SceneBuilder:
       http://hg.openjdk.java.net/openjfx/8u-dev/rt/file/3d138300d935/apps/scenebuilder
       Ladstatt: Home made JavaFX SceneBuilder
    For a minimal framework which features FXML and dependency injection, see afterburner.fx:
       http://afterburner.adam-bien.com
    You can skip all of the stuff below if you don't like reading and just want to go code...
    In general for app code, use aggregation over inheritance in most places, though inheritance is useful sometimes.  Don't try to create your own controls by extending the Control class unless you are writing control libraries - that is complex and not well documented as well as largely unnecessary for app code.  Similarly PopupWindow isn't all that great or at least I have never found a need for it in app code - a basic Stage works fine for pretty much every case except perhaps very specialized things like context menus.  Java 8 has built-in dialogs and alerts in 8u40, so for standard dialogs or some reasonably customized dialogs, using those is better than creating your own.  If the standard controls aren't enough, try ControlsFX, it is (mainly) great and high quality.
    Let resizable layout managers do the layout work for you and use constraints in the layout managers and nodes rather than mucking around with fixed sized layouts or layout through binding.
    Don't try to implement a spreadsheet in a JavaFX TableView - just use the built-in controls for what they are good at and either develop a new control for specific functionality not provided by the built-in controls or just skip that feature if it would be too expensive to build it from scratch yourself (and it probably will be expensive - you just have to justify that against your project budget whether that is money or your own time).
    Make use of WebView to bring in web components (e.g. Google Docs or Google Maps).  Don't try and pass a lot of data back and forth between a WebView and your app.
    Don't do any style in code nor in FXML, put it all in a CSS style sheet.
    For medium sized apps - use FXML to design and mark-up your GUI, and use SceneBuilder to create and edit the FXML, don't hand code basic form style UIs - in the long run the FXML based app will be easier to maintain.
    For really small apps and learning tasks, write everything in code against the API so you understand that - use no FXML at all.
    With JavaFX you are writing user interfaces, follow basic user interface design heuristics for which there are some principles to keep in mind.
    Once you have a few FXML pages, passing parameters or sharing data between them is a question that most people run into as well as how to deal with navigation.  That navigation framework I linked is super basic and just meant for pretty simple applications.  A nicer framework which worked in general like a Browser navigation model would be useful - but I haven't seen a generic implementation of such a thing yet - I guess you could create one, but I definitely wouldn't start out trying to do that - instead focus on the basics of your application and get that implemented first.  If you end up needing a reasonably sophisticated navigation framework, eventually you will know it and can evaluate what to do then.
    You can do an awful lot with CSS and styling the built-in controls.  It really is very flexible.  Learn CSS and the JavaFX variant by reading general CSS tutorials (then forget everything HTML specific) and study in depth the JavaFX CSS reference guide and understand its extensions like looked up colors and derivation functions.  When you want to know how some inbuilt thing is styled, go to the modena.css source (which can be hideously obtuse and complicated).  Use ScenicView and SceneBuilder CSS analyzer to understand how CSS is applied to elements.  Don't style borders with boxes - use layered backgrounds, that is how every control modena.css works and how your app should also work.
    Deployment is a difficult topic - so sad and depressing.  For development, just build and run in your IDE.  For production, package the app as a self-contained application. Maybe one day there will be a better deployment model for JavaFX - but that is the best you can get for now.  Completely ignore webstart and web deployment models - any time spent investigating such technologies is completely wasted.
    Do not try to integrate JavaFX and Swing or SWT.  Just write pure JavaFX apps.
    For larger apps you intend to deploy to production, use Maven or Gradle as your build system (you can google the JavaFX plugins for each).  Do not spend any time with the stand-alone JavaFX packager or the JavaFX ant tasks and do not rely on your IDE to do your production builds.
    Get help to targeted questions on StackOverflow.
    Only code to Java 8+ and make use of functional programming techniques.
    Don't write multi-threaded apps unless you know what you are doing.  When you do write multi-threaded apps, use the JavaFX concurrency utilities.  Never modify the active scene graph from another thread, nor touch a property which might trigger an event which might modify the scene graph.  Do use the concurrency utilities if you have network I/O otherwise you will freeze your app while the network I/O occurs and that is a "bad thing".
    The Oracle JavaFX 8 documentation is good - read it and run a lot of the examples (except the ant based deployment ones and the Swing/SWT integration ones).
    Ensemble is great, play with it and study the code to see for the samples (which you can view within Ensemble).
    Binding is programming by side-effect, so be aware that when you change a property, it may trigger some potentially unrelated action through bindings or attached listeners.
    Programming JavaFX in any language other than Java is an experimental thing, so only do that if you like experimenting and are prepared to do so without a lot of support.
    Targeting embedded devices, iOS or Android for a JavaFX app is an experimental thing, so only do that if, yada, yada, yada.
    JavaFX is a mid-level UI system, not a full application stack - it abstracts away the basics like rendering, controls and animation but does not provide comprehensive OS hooks, navigation frameworks, model/view/presenter frameworks, full dependency injection, client/server messaging, data <-> controls serialization and deserialization, etc.  FXML is just a markup system with a binding capability to Java code.  JavaFX and FXML do not constitute a full application framework.  There is no widely-used full application framework for JavaFX.  Sure some people have tried to create one, but none of those solutions have achieved critical mass of usage and features - plus a one-size fits all application framework will never exist anyway - client applications (e.g. a game versus a line-of-business app) differ greatly and deserve completely different architectures.
    There are many things in the Java EE world which can be used in JavaFX (e.g., its dependency injection, its web socket or rest APIs and implementations, its server based systems to allow your app to access cloud based logic and storage, etc) - so feel free to use the bits you need, usually it's as simple as adding additional library dependencies to your maven or gradle project.  A typical medium sized JavaFX application will include multiple third party libraries (mostly non-UI libraries) to get its job done as this will be more convenient than coding everything against the JRE API - though there is an awful lot of out the box functionality you get from the JRE.
    JavaFX is more complicated to use than Delphi and in some respects doesn't supply as much functionality in terms of built-in stuff like data base backed tables (though it supplies a ton more functionality in style).  It is not easier to create a complete business app using JavaFX than it would be to create a similar thing in Microsoft Access in the 90's.  Such is progress.
    JavaFX is portable across desktop environments (OS X, Windows, Mac).  JavaFX apps have their own look and feel which is not like the native OS, but that is probably fine for a lot of apps.  AquaFX does an amazing job of making a JavaFX app looks like OS X apps (kudos to the creators of both AquaFX and the JavaFX built-in styling capabilities).
    Unlike some other portable frameworks like QT, you don't have to write C code, you can write Java code (which to me at least is a win).  Similarly unlike HTML/CSS/JavaScript you don't have to write untyped JavaScript or make use of some obscure code snippet you pulled off the web for your button control.  You don't have to use the web framework of the day which withered yesterday.  Instead you have the (benefit?) of hardly any framework at all for JavaFX.  You don't have to have your app live within a browser sandbox that another developer once described as the ghetto of application sandboxes.
    So, as compared to HTML - I think JavaFX is kinder to the developer, though end users don't really seem to care that much and are fairly accepting of HTML applications even when their functionality is often inferior to many more traditional GUI apps.  HTML is standardized, its full of standards, even the non-standard parts.  Everybody used to implement all the standards differently or make their own standards, however now the standards are so painstakingly, nitpickingly prescriptive that everybody implements pretty much the same thing - except when they don't.  JavaFX has no standard but its public API docs, it has just one implementation.  If you code against the API, your app is probably going to work forever - at least if you bundle the runtime with your app, cause if you don't you might end up like the poor guy in the previous question who can't figure out how to update his app specific CSS rules to get his app to look the same with a newer Java version.  JavaFX is a relatively niche technology and you don't have the legion of developers, tinkerers, industry investments and people just plain getting stuff done in any which way that you have with the whole HTML juggernaut.  The major thing that HTML provides that JavaFX does not is: Sharable, browsable deep links to stuff with search indexed content.  With HTML, Google will index it and you can link to and refer to other docs and other docs can link to yours.  It is the HT in HTML which makes the web so amazing and the F in FXML doesn't match it.  What is the F anyway?
    That's a huge wall'o'text.  Just some random thoughts and opinions.  All opinions are my own.  Your opinions may vary.  That's OK.  I don't think a discussion is needed.  If you would like any clarification or further advice you can ask in new questions.

  • Launch native air app(desktop) using URI scheme

    Have a air application for handling files. Is it possible to launch using URI.
    The same question has been asked on stack overflow without definite answer
    http://stackoverflow.com/questions/8956316/open-a-native-air-app-via-url

    It does have half an answer. SWFs can request loading AIR applications so they suggested embedding a SWF on the page which would be able to launch your AIR application. Your link would need to fire off some JavaScript to use the ExternalInterface with the SWF to relay your request inside the SWF. 
    If you really want it on Windows for example then you'll need to register your URI, the example should be self explainatory:
    http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

  • Python and PyObjC, developing native Cocoa apps rapidly!

    Python is all grown up it seems for developing native OS X applications. For those who want to check out how to rapidly put together native Cocoa apps in less than half the lines of code and none of the manual memory management of the C derivative languages, Apple now has some articles on the developer site to inspire and to help point the way.
    Although my personal preference is wxPython for making GUI's that will look like native Windows/OSX/Unix applications no matter what platform the python app is run on I still will give PyObjC a go.
    wxPython - http://www.wxpython.org/
    MacPython - http://wiki.python.org/moin/MacPython/
    Using PyObjC - http://developer.apple.com/cocoa/pyobjc.html
    Python/PyObjC Inspiration - http://developer.apple.com/business/macmarket/checkout.html
    Mac Mini (Home), Dell Laptop [removed Windows, installed Ubuntu Linux] (Work)   Mac OS X (10.4.10)   badvista.fsf.org

    Note: Fixed omission of link to checkout
    Quicktime Tour of the Python/PyObjC Application in action:
    http://www.checkoutapp.com/show/quicktours#

  • Settings for Native Mobile App

    I'm using RoboHelp 11 to generate a native mobile app for Android.
    In the Generate Native Mobile App dialog box, I've downloaded PhoneGap, Android SDK, JDK, and Apache Ant. I've then used paths that I think would work. Here's a screen shot:
    When I attempt to generate the file, I see an error (below).
    Can you please recommend the exact path? I've looked at your documentation(Adobe RoboHelp 11 * Generate a native mobile app) and Tom Aldous's YouTube video (How To Create Android App From Your Training and Technical Manuals - YouTube). Does it matter where I download the files? Is RoboHelp 11 just compatible with certain versions of these downloads?

    @Robert I am working with someone else who is having problems. I produced some instructions for Rh10 that got things working for myself and others. The difference between 10 and 11 is that 10 required some system variables to be set whereas 11 sets the necessary paths when generating the app. Thus it is likely your problems are related to the various installations. Given where you have located them, it is not possible for me to read them. I put each app (except Java) directly off the C drive.
    To the best of my knowledge, the only app that is version specific is PhoneGap which must be 2.9.0 and that is what you have.
    First try moving the apps and generating outside your profile. This is my setup from 10 but 11 is the same as far as this part is concerned.
    See where that gets you.
    @Rick Apps are great for Knowledge Bases. As far as OLH is concerned, there are some usability issues if people don't know how to switch between apps.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • GUI app by netbeans doesn't work outside IDE

    I have created a GUI app using netbeans. it runs fine inside the ide. then i copied the compiled class files to j2se's bin folder where java.exe and javac.exe are located and to run it, it said Exception in thread "main" java.lang.NoClassDefFoundError:
    I'm a c++ win32 vistuo studio user for long time. this java thing is really pissing me off. the app is no good if i can't run it outside the IDE. netbeans' site said i must include swing-layout-0.7.jar but without saying a word of HOW.
    HELP!

    If a user wanted to run a Swing application that was built using the GUI builder in NetBeans IDE, he/she would need to have the NetBeans Platform installed.Thats not true, to run a Swing app thats been developed in Netbeans and references classes that are part of the NetBeans API does not require the NetBeans platform to be installed on the target machine, you would have to include in ur App the jar files you are referencing from the NetBeans IDE.

  • GUI toolkit for Java ME/ CDC devices

    I have written in my blog about:
    GUI toolkit for Java ME/ CDC devices: http://ovenordstrom.blogspot.com/2006/08/gui-toolkit-for-java-me-cdc-devices.html
    and
    ERCP - Embedded Rich Client Platform, soon with the first release of eRCP:
    http://ovenordstrom.blogspot.com/2006/08/ercp-embedded-rich-client-platform.html
    That perhaps is interesting for Java ME/PP developers
    Regards,
    Ove

    Hi there!
    I guess you should take a look at GTK+/Gnome development today.
    Cheers,
    Inge-Lars

  • Question about Dreamweaver Native Mobile Apps with PhoneGap

    I am trying to determine the best way to build an app for my business.  It doesn't need to be anything fancy, but needs a clean UI that is easy to navigate and interfaces with an online database.  The PhoneGap intergration with Dreamweaver 5.5 seems really intriguing, but before I spend the $650 to upgrade my creative suite, I had some questions.
    Doing some research, I have found multiple references to apps created in this way running slowly.  Noticable lapses on button pushes, pages loading slowly, etc.  Is this an issue and if it is, is there any way to get around it? 
    Idealy, I would deploy my app to both Android and iOS devices, how smoothly does that run?  I have some basic knowledge of both Java and Objective-C, but using dreamweaver seems to be quite a timesaver.
    If anyone has any input or comments about using Dreamweaver to create native mobile apps I would love to get some feedback.  Thanks!

    PhoneGap builds mobile apps with HTML, CSS, and JavaScript. You cannot use a server-side language, such as PHP, with PhoneGap.
    Presumably, you want to connect with a MySQL database on a remote server. To do so, you would need to use Ajax to send and receive data from the MySQL database. You can use jQuery to send and receive data as JSON. PHP has JSON functions that decode and encode data as JSON strings.
    How difficult or easy you would find setting this up depends on your knowledge of jQuery and PHP. I don't know of any tutorials that show how to pull everything together for PhoneGap, but it shouldn't be too difficult to find tutorials for using jQuery Ajax to communicate with MySQL.

  • Native android apps - with DPS single edition?

    Can you build native android apps also with DPS single edition or only with enterprise edition?
    Thank you for you help!

    Thank you for your reply, Bob!
    I've forgotten to ask the most important thing: This also stays that way for DPS V30?
    Thank you!

  • How can I run a gui app from an su shell?

    Hello,
    I login to my mac as a non-admin account.  I then open a terminal and su to my admin account for anything requiring it.  I am trying to run a gui app from the terminal window, but get this error, and the app does not open:
    $ /usr/local/bin/wireshark
    2011-08-14 06:54:29.327 defaults[18406:903]
    The domain/default pair of (kCFPreferencesAnyApplication, AppleAquaColorVariant) does not exist
    2011-08-14 06:54:29.346 defaults[18407:903]
    The domain/default pair of (kCFPreferencesAnyApplication, AppleHighlightColor) does not exist
    ./sync_osx_look.sh: line 40: gtkrc: Permission denied
    (process:18396): Gdk-WARNING **: locale not supported by C library
    (wireshark-bin:18396): Gtk-WARNING **: Locale not supported by C library.
              Using the fallback 'C' locale.
    (wireshark-bin:18396): Gtk-WARNING **: cannot open display:
    I know I can "switch user" but this is cumbersome as it requires typing a password each time, and I need to have applications side-by-side for easy access and testing.  Any thoughts?
    Thanks.

    I use LaunchAsRoot to run GUI apps as the root user, while logged in to my admin account.
    Another way is to use Applescript.  Here's what I do to run Console as root:
    do shell script "/Applications/Utilities/Console.app/Contents/MacOS/Console > /dev/null 2>&1 &" with administrator privileges

  • Lost use of GUI apps in 8.1.7 on RedHat 6.2

    Well,
    After going through the install yesterday and just everything being peachy, I find that today when I startup any of the apps I was using yesterday, such as oemapp console for example, today I get:
    SIGSEGV recieved at befffa6c in /lib/libc.so.6.
    Why would my GUI apps work yesterday and not today? In any case, Everything is working fine from the command line so far as I can tell so no big deal.
    I am just curious if anyone had the same problems?
    -gc

    I 've got almost the same problem:
    My installation of Oracle 8.1.7 (RedHAt 6.2, glibc 2.1.3, jre 1.1.8) was ok, everything runs from the command line (sqlplus, sqlloader) but only ONE GUI application is allowed to run. After i close any GUI app, and i try to open another one, I get:
    "SIGSEGV received at befffac0 in /usr/X11R6/lib/libXt.so.6
    Processing terminated
    Writing stack trace to javacore8421.txt ... OK "
    I need to reboot the system in order to be able to run ONE GUI app again and this goes on forever...
    Really don't know what's wrong with it...

  • Not working on nokia 808 native flickr app

    hello,
    few days ago i was tried to uploud photo in flickr used native flickr app from gallery. Photo uplouding was not sussesful and now i try again, but problem is some. I was investigation that and found same interesting info about that, in flickr forum found, what they change samo apt permission, and developer must update apps, what it working corect. I want ask, thats app will be updateing in future (i mean flickr in gallery)?

    The Flickr API was changed June 7.  The problem is discussed on All About Symbian
    A solution is the updated FlickrUp 4.5.1, uploaded by the developer Abhishek to dropbox.
    https://www.dropbox.com/s/ywgapbobqony3gt/flickrup_selfsigned-4.1.5.sis
    Works fine on my 808.  See AAS for detail.

  • Problem: native Photos app crops my images

    I have a problem with the native Photos app (MobileSlideShow.app) does not display my images properly - "cropping" the top and bottom - when I view the image in portrait mode. Let me illustrate this with an example. Here is my original image, dimensions 1408x2048:
    When I view the image on my iPad Air (pixel resolution 2048x1536) in landscape mode, it looks like this (actual screen capture):
    The app sensibly adds black bars to either side, allowing me to see the whole image. However, when I rotate to portrait mode, it looks like this (actual screen capture):
    Notice how the top and bottom squares are chopped off. Rather than let me see the whole image by padding with black space on the sides, the photo app has decided it's better to zoom in and crop the top and bottom. Note that the image itself as saved is not actually cropped, just how the photo app displays it.
    I'm looking for an option or an alternative app that allows me to see the entire images uncropped.
    I am using an iPad Air 9.7, under IOS 7.1- but the same problem occurred on my old iPad 2 as well.

    I found a workaround for this problem. I couldn't figure out how to fix the native Photo app, but [url=https://itunes.apple.com/us/app/mypics-powerful-photo-viewer/id504793067]MyPics[/url], a free app, doesn't suffer from the same defect.

  • GMAIL on Native Mail App

    I set up my Google mail in native mail app as a Google mail account and everything worked for a couple weeks.  Now the mail app is only pulling mail from 2011 and older.  I set up my mailbox on a couple other collegues iphones and have the same issue.  I downloaded the Gmail app and checked Gmail through Safari on my phone and the account is fine.  The current email is in my inbox.  My desktop is the same.  The issue is just with the mail app on IOS 8 and it was working for 2 weeks with no issues.  I didnt make any changes.  HELP!

    Not seeing the problem on either my iPhone 6 or iPad Air. Have you tried deleting the account in Settings>Mail, Contacts, Calendar? It's a good first step in troubleshooting email issues. However, given that you've tried to set up the same account on other phones, it may not do any good. Are you using the default settings for Google when you set up the account?

Maybe you are looking for

  • Need to connect SQL Server 2008 and CR 2008 via OLE DB SQL Server Provider

    I am relatively new to Crystal but have done some minor design/layout work in the past. I just purchased CR 2008 and dowloaded a Eval Copy of SQL Server 2008 to build test reports that will then be uploaded to a hosted web app we use for use with liv

  • How to clear wifi hotspot history?

    [Nokia 5800]  Hi, I recently used a wifi hotspot whilst on holiday, which was unsecured, but once you started to web browse you where prompted for a username/password, which i had. Since coming back, i now have a problem where sometimes when i try to

  • Is the iPod touch 64gb suppose to store 14,000 songs

    Is the iPod touch 64gb suppose to store 14,000 songs

  • SEO for iweb..... any suggestions

    Having used iweb for a while now and hosting our site through mobileme, I am looking at optimising it and generating some search engine traffic. I have tried iweb Buddy with not much success and was hoping someone could help point me in the right dir

  • Connecting MAC and PC to Airport Express

    We have a MacBook and an HP PC-- Is the AE print server compatible with an HP C3100 printer (didn't see it on the iFelix list)? If so, will the PC be able to see it on the network? Thanks for your help--