JavaFX 2.0 :: FX Preloader In Standalone App

Jun 30, 2014

At the end I just copy and paste the code from section 9.3.4 (the long startup task example) and it still won't work. After starting the application I only see some black screen flickering at the upper left screen and then the main app shows up.
 
What I have done:
 
Using Netbeans 8.0 under Linux(Fedora20 64bit), JDK 1.8u5 ...
 
Here are the two classes - the main app :
 
import javafx.application.Application;
import javafx.application.Platform;
import javafx.application.Preloader.ProgressNotification;

[Code]....
 
On my machine I see only a little black flickering on the left upper screen and then immediately the app is shown...
 
The only way I can get this to run is to set the custom preloader property in the Netbeans-project properties. If you use a maven based project in Netbeans you did not got this option ...

View Replies


ADVERTISEMENT

JavaFX 2.0 :: Native Packaging And Preloader

Aug 27, 2014

When reading RT-38432 I see that Danno mentions the possibility to use:
 
com.sun.javafx.application.LauncherImpl.launchApplication(YourMainClass.class, Preloader.class, args);
 
I've never used the javafx-packager and have always used the above instead.  However, I assumed I was missing out on some optimization related to example 9-5 and example 9-6 of Deploying JavaFX Applications: Preloaders | JavaFX 2 Tutorials and Documentation.  I always assumed the supported packaging:
 
1) Loads only the JARs / resources needed to launch the Preloader.
2) Launches the Preloader.
3) Loads all other application JARs / resources.
4) Launches the application.
 
Now I'm thinking that's only the case for Web Start deployments.  For standalone deployments is it the same as a normal Java application where all of the application JARs are included as part of the classpath?

View Replies View Related

JavaFX 2.0 :: Preloader Not Shown Into Native Package

Jul 28, 2014

After some attempts I seen that my preloader is not shown using native package (Windows and Mac).
 
Running the jar that is run from the file.exe instead I can see the splash screen.
 
This is the relevant part of my build.xml

<fx:application id="fxApplication" name="app" version="3.0" mainClass="it.app.Main" preloaderclass="it.app.preloader.SplashScreenUi" toolkit="fx" />
 
As said, running the jar file instead of exe file the splash screen is displayed.
 
I printed some logs into splash screen class: when I run the app from the jar this logs are printed, instead when I run the app from .exe file these logs are not present.

View Replies View Related

JavaFX 2.0 :: Replacing SplashScreen With Preloader Stage - Flickering?

Aug 29, 2014

I'm trying to set up a splash screen where a native splash screen is shown initially and then replaced with the stage from my preloader.  This is fairly simple to do.  I use the below code to get everything lined up properly. 

private void alignStage(Stage stage) {
    SplashScreen splashScreen = SplashScreen.getSplashScreen();
    if (splashScreen != null) {
        // Align the stage based on the current splash location
        Rectangle bounds = splashScreen.getBounds();
        stage.setX(bounds.getX());
        stage.setY(bounds.getY());

[Code] ....
 
The problem I'm having is that my Stage isn't actually shown by the time the commented event gets fired.  The API for onShown says:
 
Called just after the Window is shown.

My guess is the window has transitioned to being shown, but there's a slight delay until it gets rendered on screen.  If that's a decent assumption, is there a reliable way I can make sure my preloader stage is visible on screen before I hide the native splash?
 
The best option I can think of so far is to delay hiding the native splash until the preloader gets the BEFORE_START notification.  This works (no flicker), but, since both splash screens are actually visible for a while, using a transparent splash doesn't work very well (which actually isn't too big of a deal).

View Replies View Related

Standalone Taking So Much Time Than Web Application

Oct 29, 2014

I am working on a web-application where i have a functionality which generates reports based on the data from DB. for small amount of data its working nice if the data is huge its taking more time. to avoid this problem i developed a standalone batch where i generated the jar file for the sources in web-application and made a call to the appropriate methods.

But my problem is if web-application takes 10 secs to generate the report but in the case of standalone its taking nearly 3-5 mins to generate the same report. i didn't do much of the changes in code just using the same code as web-application

I am using tomcat 6 application server to run the web-application for standalone using batch commands.....

View Replies View Related

How To Call EAR File From Standalone Java Code

Apr 14, 2014

I have a EAR file which has a java class file and EAR file is deployed in weblogic.I have to call the java class of EAR file from a standalone java code which is present inside a JAR.While making the call to EAR i have to pass a parameter from JAR to one of the methods of class file which is present in EAR.

View Replies View Related

Servlets :: Java Standalone Program To JSP Communication

Aug 4, 2014

The following programs exist:

1. I have a java application which accepts bio potential data every second or two and stores it in the database. This is a socket server which accepts this data from multiple clients and spawns a new thread for processing it to store in the db.

2. I have a jsp page on tomcat server which reads historic client data from database (stored by application 1) and displays it on the page.

The socket server program in 1.) above is not running inside of tomcat server.The new requirement now is : Display all of the human data coming in live on the jsp page.Now the problem: I will now need to pass the live data from socket server (which is stand alone) to the jsp which is running on a tomcat server.

Possible solutions:

APPROACH 1: Run the socket server in the tomcat instead of stand alone and store the frequently incoming data in a java object so the jsp can access this object every second and display it on a graph.

PROBLEM : The stand alone java application does not need to be included in a tomcat server except for the fact that the jsp needs access to the live data. Also, I have read that this is not the best way.

APPROACH 2: Expose the stand alone java application as a web service and communicate with the jsp using REST architecture.

PROBLEM : The complication of using this method is that it will not have the flexibility offered by websockets or server sent events (SSE) of auto updating the latest data. The jsp will have to keep polling for new data every one second which is also not a very good option.

View Replies View Related

EJB / EE :: Invoking From Standalone Java Client In JBoss7?

Apr 24, 2014

ejb. Using Eclipse and Jboss server. I've deployed an EJB and now want to invoke it using a standalone java program. I know that Eclipse and JBoss do some job to bind JNDI names. I just want to know that how to lookup EJB by which JNDI binding out of 6 options available (shown in deployment console) there.

Here I'm dropping all my java code and server/console logs...

LibrarySessionBeanRemote
package com.bhavesh.ejb;
import java.util.List;
import javax.ejb.Remote;

{Code]....

View Replies View Related

Servlets :: How To Convert Webapp Into Desktop / Standalone Application

Nov 20, 2014

I have a web app using spring MVC + hibernate on the server side and jquery, ajax, javascript on the client side.

What I wish to do is to convert it into an exe file to make it standalone app.

Is there a software out there that can accomplish it? I don't want to recreate it from the scratch and I only know how to do web apps.

View Replies View Related

Swing/AWT/SWT :: Image Redraws Faster Inside Eclipse Than Standalone

Jan 31, 2014

I don't know if this is appropriate to Swing/AWT, or even if this is a Java issue, but I had quite a shock recently. I have been working on a kind of drawing program in which the user can select tiny control rectangles and drag them around, causing the shape of a polygon to change. (They are not implemented as Java Polygons or Shapes because some are one-dimensional). I have gotten it into pretty good shape, so I exported it from Eclipse, my development platform, into a standalone Java application. In the standalone application, each time I drag the mouse, the redrawing shows nasty flickering, as if it's running too slowly. While I was developing the application inside Eclipse, it ran perfectly, with no flickering whatsoever.

What gives? I'd expect that the in-Eclipse runs would be slower, because they're burdened with extra debugging baggage, while the exported standalone version should run faster. But the reverse is the case.

View Replies View Related

Swing/AWT/SWT :: Embedded Browser In A Standalone Java App Running On Windows

Aug 24, 2014

I have an embedded browser in a standalone java app running on windows. The browser calls up web pages over the internet with no problem.

import org.eclipse.swt.browser.Browser;
final Browser browser = new Browser(group01, SWT.NONE);
browser.setBounds(0, 0, 1000, 400);
browser.setVisible(true);
browser.pack();
browser.setUrl(texturl.getText());

I have a C executable which captures and documents network traffic. I communicate with it by entering http://27.0.0.1:6500 into any browser (it works with them all). It responds with a simple html form (three buttons, a tick box, a label, and one text box).However I cannot get it to work with the embedded SWT browser.

View Replies View Related

Embed Existing JAVA Applet To New Standalone Swing Application

Oct 9, 2014

I want to embed an existing JAVA applet in to my swing application which is a standalone application. The applet is used in some other application which is not developed by me or my company. The application is open source application (So I have the source code). The entire existing application is basically one of the parts of my new application.

View Replies View Related

EJB / EE :: Convert Standalone Java Thread Application Into Web Application In Tomcat

Nov 17, 2014

convert or move standalone java thread application into Tomcat server container for accessing its JNDI services? Also is it possible to schedule this thread application in Tomcat server? is it possible to keep this app in tomcat as web application and schedule in window's scheduler.

View Replies View Related

JavaFX 2.0 :: Stage Always On Top

Aug 14, 2014

I am developing JavaFX application. I have requirement like that javafx application should be always on top. I could not find an option to make it always on top.

View Replies View Related

Difference Between JavaFX And Swing?

Jan 28, 2014

I know that oracle has released a statement saying that JavaFX will eventually replace Swing. What is the advantage of JavaFX? The new format, using "stage" instead of JFrame, seemed weird. Why is this change necessary? What benefit do we reap from JavaFX that Swing does not have?

View Replies View Related

How To Convert Java App To JavaFX App

Oct 24, 2014

I am using netbeans scenebuilder and I am a little confused on how I would convert my state capitals java code to a javaFX app.

public class StateCapitals {
Scanner in;
public static void main(String[] args) {
readData();
}
public static void readData() { // Location of file to read
File file = new File("statecapitals.txt");

[code]....

View Replies View Related

JavaFX Will Not Display Image

Oct 21, 2014

I've been on this for a while and for some reason I just can't seem to get this to work. I know my code is solid, but it won't display my image. I've tried swithcing the image to different directories and also using different image sizes and types. I even used Orcale's guide to display your image, but still no go! All I get is a blank canvas? There are no errors. I'm also running NetbeansIDE 8 that supports JavaFX and I made sure the project is a JavaFX Application project.

All I get is a blank new window, but no images.

Here's my code:

package javafxapplication3;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.image.Image;

[code]....

The homework called for me to display it three times - the first one regular, second resized, and the last one rotated. I even deleted the extra images in hope at least one appears.

View Replies View Related

JavaFX Get Coordinates From Path?

May 8, 2014

I'm working on a project right now in JavaFX, and got stuck. I am drawing a path consisting of CubicCurveTo's and I wonder if there's any way to get the X and Y coordinates from certain parts of that path.

Imagine following a curve (path) with a pencil slowly, and every second you take note the X and Y coordinate. I mean I'm not interested in the control points or start and end points, but the points "in between", preferably at a certain interval.

I've searched for many things online, but have trouble knowing exactly which words to search for. "Paths" often bring up file paths, traversing, coordinates etc. all fail to give me any good results.

I tried to be as specific I could, and I don't think my current code is of any interest in this matter.

(The point of it all is that the path should simulate the path a person walks, and I will store the coordinates in a database for every second).

View Replies View Related

New Object JavaFX With Scenebuilder

May 28, 2014

When i press a button, i want to create a new object in my window(that i have created using scenbuilder, so i have a FXML file and a Controller class). In the window where i have a create button, there are also some textfields where you are supposed to enter name and date.

What i want to do is take the input from the TextField and store is temporally in a String variable, Its this strings i want to take the data from when i create a new object on my View. When i try to do something with the TextFields i get multiple errors that i dont understand at all.

I know my code may be very un-structured the absolute right way, i know, but i dont have time reconstructing and trying to understanding new patterns .The object is the circle and the vertical line.

TimelineMainView Controller
public class TimelineController{
StageClass sc = new StageClass();
NewTimelineController nt = new NewTimelineController();

[code]....

View Replies View Related

JavaFX 2.0 :: Navigating Between Views

Jan 24, 2015

I'm quite new to JavaFX, and currently struggling with navigation between views. I'll post the code and the stacktrace.
 
public class MainApp extends Application {
    private Stage primaryStage;
    private AnchorPane overviewPage;
    @Override
    public void start(Stage primaryStage) {
        this.primaryStage = primaryStage;

[Code] .....
 
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source)
    at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)

[Code] ......

View Replies View Related

JavaFX 2.0 :: Using CSS Sub-structure On Own Nodes

May 26, 2014

I have noticed that you can style JavaFX controls using their sub-structure.

E.g. to style the label in a table column header to be left justified I can do this :
 
.table-view .column-header-background .label {    -fx-alignment: center-left ;  } 
 
How can I style my own nodes/controls doing this? Basically it amounts to asking how the selectors like ".column-header-background" are associated with sub-structures of my Java control/node objects. So suppose I have something like
 
.fancy-node .fred .label { ... }
 
How does JavaFX associate fancy-node and fred with something in my implementation of a Node/Control?

View Replies View Related

JavaFX 2.0 :: How To Get Actually Typed $ From KeyPressed

Jan 13, 2015

ToString()-Representation of KeyEvents. I was expecting '$' as text value, because Shift was pressed.
 
Unfortunately, KeyTyped is not fired in this case, so I am not able to get the information from this event.
 
How can I get the actually typed '$' from KeyPressed?
 
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_PRESSED, consumed = false, character =  , text = , code = SHIFT, shiftDown]
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_PRESSED, consumed = false, character =  , text = 4, code = DIGIT4, shiftDown]
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_RELEASED, consumed = false, character =  , text = , code = SHIFT]
KeyEvent [source = BorderPane[id=cnt_borderPane], target = Button@1a3fc21a[styleClass=button]'', eventType = KEY_RELEASED, consumed = false, character =  , text = 4, code = DIGIT4]

View Replies View Related

JavaFX 2.0 :: How To Get Text From TextFlow

Sep 5, 2014

I would like to extract text (String) from a TextFlow control.

View Replies View Related

JavaFX 2.0 :: Is It Possible To Create Dynamic GUI?

Jul 7, 2014

I'd like the GUI to be drawn based on definition file. Is it possible to "generate" fxml (like PHP does html) so I could do this:
 
for (...) {
     command_to_generate (<button ....>);
}
 
?

Or is using legaxy javaFX code the only way to achieve it?

View Replies View Related

JavaFX 2.0 :: How To Save Image As JPG

Apr 10, 2015

My JavaFX code like this:

WritableImage image = scene.snapshot(null);             
File outputFile = new File("C:PSBJavaFXApplication1src est0.jpg");
ImageIO.write(SwingFXUtils.fromFXImage(image, null), "jpg", outputFile); 
 
When open this jpg, its background is in orange color. For png type, it works great.

View Replies View Related

JavaFX 2.0 :: BufferedImage To Mat - OpenCV

Mar 16, 2015

I am new to JavaFX and OpenCV. The Problem is, that JavaFX can't handle Mat objects. First I load an image as a BufferedImage. Then i have to convert this to Mat. Do my image Processing with OpenCV and again convert the result image to a BufferedImage to display in on my UI. Here are the methods for converting Buff to Mat and Mat to Buff I found on the internet:
 
public static Mat img2Mat(BufferedImage image)
    {
  byte[] data = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
  Mat mat = new Mat(image.getHeight(), image.getWidth(), CvType.CV_8UC3);
  mat.put(0, 0, data);
  return mat;

[Code] ....
 
Next I do some OpenCV stuff:
 
public static BufferedImage hello(BufferedImage img) {  
  Mat source  = img2Mat(img); //Convert Buff to Mat
  BufferedImage outImg = null;
       try{
          System.loadLibrary( Core.NATIVE_LIBRARY_NAME );

[Code] ....
 
Finally I call the hello method in my controller:
 
void menuItemTestFired(ActionEvent event) {  
    try {
              result = ImageProc.hallo(bImage);//bImage is an image I've loaded before.
              imageView.setImage(SwingFXUtils.toFXImage(result, null));

[Code] .....
 
Unfortunately I get a lot of errors. Here are the first one:
 
Caused by: java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat(III)J
  at org.opencv.core.Mat.n_Mat(Native Method)
  at org.opencv.core.Mat.<init>(Mat.java:471)
 
[Code] ....
 
Can't figure out why this doesn't work. -.-

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved