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.

Similar Messages

  • Builiding animations using FXML or the Scene Builder in javaFX

    please i wanna know if its possible building user interfaces with dynamic nodes or animations using FXML or the Scenebuilder in JavaFX
    Elikem.

    HI,
    Currently SceneBuilder is still a baby v.1.x You can only create nodes and make some graphical , layout, stylesheets changes on them. The animation can't be done from the FXML so Scenebuilders dont have these concepts. You will need to have hard code for this. But I still think SceneBuilder is far more Flexible,fast and easy to build javafx application.
    Thanks
    Narayan

  • Fxml  ComboBox created in scene builder how to fetch data from database

    Hi Sir, How r u? Hope to be fine. Sir, I have a problem that i want to fetch data in fxml comboBox created in Scene Builder?
    I have used this code in JavaFx 2.0 for comboBox and textField the code is
    ComboBox studentRegId = new ComboBox();
    try{
    stm = db.con.createStatement();
    rs = stm.executeQuery("select * from students order by s_reg_id asc");
    while(rs.next()){               
    for(int i=1; i<=1; i++)
    studentRegId.getItems().add(rs.getString("s_reg_id"));
    }catch(SQLException sqlException){         
    final TextField sRegId = new TextField();
    final String regId[] = new String[1000];
    try{
    stm = db.con.createStatement();
    rs = stm.executeQuery("select * from students order by s_reg_id asc");
    int a = 0;
    while(rs.next()) {
    regId[a] = rs.getString("s_reg_id");
    a++; }
    }catch(SQLException sqlException){         
    studentRegId.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>(){
    public void changed(ObservableValue ov,Number value, Number new_value){                           
    sRegId.setText(regId[new_value.intValue()]);
    Now, the problem is that I want to use this code in Scene Builder fxml ComboBox .
    Please Help Me!
    I shall be very grate full to you for this kindness.
    Regards

    Hi,
    Ok, so you create your FXML :
    Add a controller property to your root control. (See Code tab in SceneBuilder or direcly in FXML : fx:controller tag)
    Add a fx:id to your controls (your combobox) (First property in SceneBuilder or directly in FXML : fx:id)
    Example :
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.collections.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.paint.*?>
    <HBox prefHeight="-1.0" prefWidth="-1.0" xmlns:fx="http://javafx.com/fxml" fx:controller="org.lgringo.comboexample.Controler">
      <children>
        <TextField fx:id="text" prefWidth="100.0" />
        <ComboBox fx:id="combo" prefWidth="200.0">
          <items>
            <FXCollections fx:factory="observableArrayList">
              <String fx:value="Item 1" />
              <String fx:value="Item 2" />
              <String fx:value="Item 3" />
            </FXCollections>
          </items>
        </ComboBox>
      </children>
    </HBox>Then, you create your Controler class using @FXML annotation (name of control should be the name of fx:id properties)
    You can do some initialisation in the inherit method "initialize"
    Example :
    package org.lgringo.comboexample;
    import javafx.fxml.FXML;
    import javafx.scene.control.ComboBox;
    import javafx.scene.control.TextField;
    public class Controler {
         @FXML
         // fx:id="combo"
         private ComboBox<String> combo; // Value injected by FXMLLoader
         @FXML
         // fx:id="text"
         private TextField text; // Value injected by FXMLLoader
         @FXML // This method is called by the FXMLLoader when initialization is complete
        void initialize() {
            assert combo != null : "fx:id=\"combo\" was not injected: check your FXML file 'ComboboxExample.fxml'.";
            assert text != null : "fx:id=\"text\" was not injected: check your FXML file 'ComboboxExample.fxml'.";
            // Initialize your logic here: all @FXML variables will have been injected
            combo.getItems().clear();
            combo.getItems().addAll("John Lennon","Mick Jagger","David Bowie");
            combo.getItems().add("Others...");
            text.setText("List : ");
    }Then you use the FXMLLoader class to load your FXML and Controler.
    Example :
    package org.lgringo.comboexample;
    import javafx.application.Application;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.Parent;
    import javafx.scene.Scene;
    import javafx.stage.Stage;
    public class App extends Application {
          * @param args
         public static void main(String[] args) {
              App.launch(args);
         @Override
         public void start(Stage primaryStage) throws Exception {
              Parent root = FXMLLoader.load(getClass().getResource("ComboboxExample.fxml"));
              primaryStage.setTitle("Combo Example");
              primaryStage.setScene(new Scene(root, 300, 275));
              primaryStage.show();
    }More info : http://docs.oracle.com/javafx/2/get_started/fxml_tutorial.htm

  • How do i add/use FileChooser on or with scene builder

    Hello... i am still new to javafx nd my english is not very, please bare with me... i was trying to implement a simple application that manages personal contacts. i started using scene builder to help with user interface.. i was planning on adding File Chooser for profile picture uploads but i just cant find it anywhere on scene builder
    How can be able to use the fileChooser?

    Scene Builder is just a layout creation tool, it doesn't write any code for you. 
    To use a FileChooser you need to write code. 
    This is because a file chooser is associated with the dynamic behaviour of a program, not the program's layout.
    There is sample code in the Oracle file chooser tutorial:
    http://docs.oracle.com/javafx/2/ui_controls/file-chooser.htm
    1. In Scene Builder create a button with text "Open File".
    2. Select your button. 
    3. In the code pane provide a name for the onAction event handler. 
    4. Have Scene Builder generate a code skeleton and save it to a file. 
    5. Open the code skeleton and place the following code in the generated on action method stub;
    FileChooser fileChooser = new FileChooser();
    fileChooser.setTitle("Open File");
    File file = fileChooser.showOpenDialog(null); // you could pass a stage reference here if you wanted.
    if (file != null) // do something interesting with the file.
    6. Compile and run your application.
    7. Click on your Open File button.
    8. A FileChooser will open.
    9. Choose a File.
    10. Your program will do something interesting with the file.

  • 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...

  • Can't use bitmap font in GUI apps

    I like the look of bitmap fonts and I used to be able to use them in GUI apps such as GTK apps.
    For the last few months whenever I try to start GUI app with a bitmap font selected the application crashes. Always with the same error message about cairo-scaled-font.
    For example, here is my terminal output when I try to start dwb using the bitmap font Lemon as my default font:
    dwb: cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion '!scaled_font->cache_frozen' failed.
    This problem is not limited to just dwb but any GUI app when I try to use any bitmap font.
    I've tried googling the problem and the only advice I could find was to run fc-cache -fv, which didn't fix the issue.
    Any help would be appreciated.

    I normally use BSPWM as my window manager, and I have just discovered that If I try to start dwb in Gnome it actually works!
    This isn't really a solution for me because I spend most of my time in BSPWM, but it's interesting.

  • JavaFX Visual GUI Builder - not using FXML - only based on pure Java

    The decision to provide a pure Java based JavaFX API activates the pure Java people who where FXML resistent in the past.
    JavaFX is the future ... the last few month when I check the new possibilities I came slowly but surely to this opinion...
    The Scene Build is still based on FXML. So ... for the pure Java developer there is no advantage to use it ... only to see what components are available in the JavaFX standard I see no advantage for me to use it. I won't create JavaFX clients based on FXML.
    What's the future plan...is there a Project in the World who want to provide a Visual GUI Builder who produce pure Java based JavaFX Code like Eclipse Window Builder do it for Swing or SWT or JBuilder for Swing many years ago.
    That's the main reason that JavaFX get successful in the future. A software architect who has to decide using JavaFX as the new Company Standard...will never do it without stomachache.
    Do I miss some news?
    Is there are NetBeans Version who can do it or a plugin I don't now?
    Edited by: 984992 on 30.01.2013 14:24
    Edited by: 984992 on 30.01.2013 14:30

    I don't think you are getting it, or just making a big deal about it.
    Currently SceneBuilder is connected to Netbeans using the FXML. It's not hard at all, nor is there a big issue. In the next few years Scenebuilder will be in Netbeans integrated, so it will be just like the swing gui builder. FX is still new, from a scripting lang, to a super powerful lang. FXML uses so little code.... Also you can do things either with, or without FXML, FXML IS NOT NEEDED IN FX AT ALL, only limited on Scene Builder.
    This is the FXML I am using for a dice game I am creating. Not much at all.
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.collections.*?>
    <?import javafx.scene.chart.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.image.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.paint.*?>
    <BorderPane fx:id="border" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="785.0" prefWidth="1518.0" xmlns:fx="http://javafx.com/fxml" fx:controller="ZonkController">
    <left>
    <AnchorPane minHeight="86.0" minWidth="62.0" prefHeight="390.0" prefWidth="768.0">
    <children>
    <Button fx:id="button" layoutX="126.0" layoutY="90.0" onAction="#handleButtonAction" text="Click Me!" />
    <Pane fx:id="pane" layoutX="737.0" prefHeight="390.0" prefWidth="211.0" />
    </children>
    </AnchorPane>
    </left>
    <right>
    <AnchorPane prefHeight="386.0" prefWidth="460.0">
    <children>
    <BarChart fx:id="barChart" layoutX="7.0" layoutY="-10.0" prefWidth="460.0">
    <xAxis>
    <CategoryAxis fx:id="names" side="BOTTOM" />
    </xAxis>
    <yAxis>
    <NumberAxis fx:id="scores" side="LEFT" />
    </yAxis>
    </BarChart>
    </children>
    </AnchorPane>
    </right>
    <top>
    <ImageView fx:id="iv" fitHeight="394.24998969072755" fitWidth="525.6666641235352" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="TOP_CENTER" />
    </top>
    </BorderPane>
    It is all codecompleted like a class normally would, so there is nothing to worry about :)
    .CSS isn't hard either.

  • One of my sons has an ipad mini and the other a larger ipad.  The one using the mini needs a larger ipad for school, so they need to switch.  They want to do so without losing their individual app progress.  Can I simply switch the SIM cards?

    One of my sons has an ipad mini and the other a larger ipad.  The one using the mini needs a larger ipad for school, so they need to switch.  They want to do so without losing their individual app progress.  Can I simply switch the SIM cards?

    SIM card has nothing to do with your Apple ID or apps.
    IOS devices do not store anything on the SIM card.
    BAckup everything on the iPads.
    REstore tbe ipad from the backup of the other iPad.
    REpeat for the other one.

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • I currently have 1,177 photos on my iphone (4s) but it takes up 4.9 GB of space. Why is it so large? I do not use photostream - this is simply within my "Camera Roll". Other than deleting the photos, can someone tell me another solution?

    I currently have 1,177 photos on my iphone (4s) but it takes up 4.9 GB of space. Why is it so large? I do not use photostream - this is simply within my "Camera Roll". Other than deleting the photos, can someone tell me another solution?
    My friend has over 2,000 photos on her iphone and it only used 1.7 GB of space and I know I had at one point over 3,000 photos on my phone and still had space left for more.
    Any tips are greatly appreciated!
    Thanks,
    Melissa.

    When you open your camera app, does it say "HDR on" at the top?
    HDR photos are better quality but take up much more space.
    Also, go to Settings>photos and camera.  Scroll down to "keep normal photo".  Is it on?  This feature saves a normal copy and an HDR copy of every photo you take.
    I bet your friend has this feature turned off along with the HDR as well.

  • 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

  • Can't start GUI apps as Root.

    If i am logged as root i can't start GUI apps like:
    Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified
    kate: cannot connect to X server :0.0
    should i post xorg.conf?

    Kknd wrote:
    Fork wrote:That starts the aplication. But i wanted to fix the problem, not get around it. Is it possible?
    It's not really a problem, but you can copy your .Xauthority to give the same rights.
    It is not a problem, and in fact, using kdesu is probably the safest way to do it. Starting apps as root in X is risky.

  • Notebook hangs if there's an app actively using external USB disk

    ...right before going into sleep mode.
    I have this notebook and an external USB SATA drive hooked up to it. When I put the laptop into sleep mode, then resume its work, after a while I'll get a blank screen that essentially looks a lot like tty1, all black background and gray symbols all over the screen. Essentially, the message I get is the following:
    Dec 7 11:29:18 localhost kernel: [67351.155834] ESI: f6447e80 EDI: f46b05f0 EBP: f15a7e58 ESP: f15a7e40
    Dec 7 11:29:18 localhost kernel: [67351.155834] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    Dec 7 11:29:18 localhost kernel: [67351.155834] Process transmission-gt (pid: 2302, ti=f15a6000 task=f1255a40 task.ti=f15a6000)
    Dec 7 11:29:18 localhost kernel: [67351.155834] Stack:
    Dec 7 11:29:18 localhost kernel: [67351.155834] f15a7eac f46b05e0 f6447e80 f1255a40 f6447e80 f46b05f0 f15a7e6c c10d4f48
    Dec 7 11:29:18 localhost kernel: [67351.155834] 00000010 f6447e80 f46b05e0 f15a7e84 c113be2c 00000000 efa3b930 ef1f4400
    Dec 7 11:29:18 localhost kernel: [67351.155834] 00000000 f15a7e90 c113befa f1141600 f15a7eb4 f8046f1e f1141600 f804b3e4
    Dec 7 11:29:18 localhost kernel: [67351.155834] Call Trace:
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c10d4f48>] account_page_dirtied+0x68/0x90
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c113be2c>] __set_page_dirty+0x3c/0xb0
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c113befa>] mark_buffer_dirty+0x5a/0x90
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<f8046f1e>] ext2_sync_super+0x6e/0xd0 [ext2]
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<f8046fd1>] ext2_sync_fs+0x51/0x60 [ext2]
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c1157640>] ? dquot_get_dqblk+0x180/0x180
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c113a4ca>] __sync_filesystem+0x5a/0x80
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c113a539>] sync_filesystem+0x29/0x50
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c111656e>] generic_shutdown_super+0x2e/0xe0
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c1116649>] kill_block_super+0x29/0x70
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c111693d>] deactivate_locked_super+0x3d/0x60
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c11171f7>] deactivate_super+0x47/0x60
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c112ecd7>] mntput_no_expire+0x87/0xd0
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c112ed38>] mntput+0x18/0x30
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c1116154>] fput+0x134/0x1e0
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c1112d14>] filp_close+0x54/0x80
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c1112db4>] sys_close+0x74/0xc0
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c134c11f>] sysenter_do_call+0x12/0x28
    Dec 7 11:29:18 localhost kernel: [67351.155834] [<c1340000>] ? setup_local_APIC+0x2c9/0x3b8
    Dec 7 11:29:18 localhost kernel: [67351.155834] Code: eb ce 8d 76 00 8d bc 27 00 00 00 00 55 89 e5 83 ec 18 89 5d f4 89 c3 89 e0 25 00 e0 ff ff 89 75 f8 89 7d fc 83 40 14 01 8b 43 14
    Dec 7 11:29:18 localhost [67351.155834] 8b 30 89 f7 c1 ff 1f 01 d6 89 45 f0 8b 45 08 11 cf 89 c2 c1
    Dec 7 11:29:18 localhost kernel: [67351.155834] EIP: [<c11cf02f>] __percpu_counter_add+0x1f/0xe0 SS:ESP 0068:f15a7e40
    Dec 7 11:29:18 localhost kernel: [67351.155834] CR2: 00000000342da000
    Dec 7 11:29:18 localhost kernel: [67351.155834] ---[ end trace a7afafe94ef537f4 ]---
    Dec 7 11:29:18 localhost kernel: [67351.182781] note: transmission-gt[2302] exited with preempt_count 2
    By playing around I learned that if I kill transmission and any app that actively uses the USB disk prior to the sleep mode, and then start them after resume is finished and the disk is mounted (I use GNOME 3 in fallback mode, so it automounts the disk) everything works fine.
    Now, I could ignore those messages but it gets worse. Mostly laptop will hang at a random point in time after printing that wall of text on tty1. It might take hours, or even days before this happens. Sometimes I'll find transmission in a freezed state and I may survive a couple of sleep and resume cycles but I almost never will go as far as 4 days and more in a row. The laptop will hang eventually. And the only way to avoid this is to kill off apps that use external USB drive prior to going into sleep mode.
    Any ideas what's going on and how to fix this?
    % uname -a
    Linux host 2.6.39-ARCH #1 SMP PREEMPT Tue Jun 7 05:49:02 UTC 2011 i686 Intel(R) Core(TM) Duo CPU T2250 @ 1.73GHz GenuineIntel GNU/Linux

    karol wrote:https://bbs.archlinux.org/viewtopic.php?id=131527
    Thanks, however, my problem isn't speed, it's stability of the system.

  • How to add security to App built using InDesign?

    We are using DPS (Single Edition) to build an App that will contain some sensitive information, and we will need to protect this somehow by restricting this content so that only current employees may use it - meaning it should be inaccessible to people outside the company, as well as to former employees who have since left.
    What is the best way to restrict access? Adding password protection seems like the most obvious answer, but is this doable within InDesign? Alternatively, is there another solution, and should it be done within InDesign, or by limiting access somehow with DPS?
    Thanks!

    Ah ha! thanks, but got all the way to the bottom of the blog, quite excited by the info; only to find I need an enterprise adobe account. Why Why Why, as per the other comments, there is a huge demand for clients that only need limited distribution ie hundreds, not ten's of thousands as per large publications.
    Enterprise Dev account for Apple is cheap, DPS enterprise is well, a lot of money.
    There is an opporunity here for Adobe, The Pro-License needs to evolve for non magazine customers, I create Apps for a very large Automotive company, they love my low cost "brochure Apps" they would love to do more but to distribute to retailers, so we are only talking many hundreds. This number seems to be very common - Hundreds.
    DPS Enterprise is geared up and costed up at major magazine publishers, correct?
    I dont need all the publishers subscription stuff, and web folio's and limited articles etc etc.
    But Enterprise limited distribution, and analytics, and yes, even Gold support, is what I would pay for.
    As mentioned on other threads, my clients and myself have decided that we will just make do with SE Apps, so wave good bye to the Pro Licence.
    I doubt I'm alone here, no infact, I know I'm not alone, just hope there will be enough of us to make financially work for Adobe.
    Just  a thought, maybe hopefully, you guys are ahead of me here, and working on something :-))
    Cheers
    Alistair

  • Can all ipod apps be used on the ipad?

    Can all ipod apps be used on the ipad?

    Any apps in the app store that are 'universal', as in works on both large and small screens have a + by the download button.
    Many Touch apps (also iPhone apps) do work on the iPad, but they're tiny, taking up the middle of the screen. You can make them fit the screen, but their appearance varies. Some are high enough resolution that they look okay, others are blurry.

Maybe you are looking for

  • Do you have to upgrade to Windows 8.1 or is this a squeeze chute with no option?

    I have finally got my computer to operate without any problems and all my programs work fine, the last time I upgraded to Windows 8.1 I had all kind of issues. So my question is; do you have to upgrade to Windows 8.1 or is this a squeeze chute with n

  • Replace function on ejb ql

    Is there a replace function on EJB QL?! I looked for, but I didn't find.... I've got a table with a field 'field' that have some values like 'a.b.c', and I want to create a query that return this register if the user inform 'abc', like: select * from

  • Wrongly printing the delivery

    Hello Sap Gurus, My issue is for one day the delivery was printed and distribution took the pick list. Then sales team added a note to the sales order through VA02 and saved it but the delivery had not been deleted and did not require any changes. Th

  • BADI COM_PARTNER_BADI

    Hello experts    I am trying to implement the BADI COM_PARTNER_BADI for determining Sold-to Parties from different Partner functions in a preceding document. But I notice that if I implement this, it only works when the Contact Person, Employee Respo

  • Font size increase on printing

    I have increased the font size on the email screen. I wish that to be the font size when I print the message. Please tell me how to do this? Jack