JavaFX 2.0 :: Why Splashscreen Of Application Doesn't Show

Jul 11, 2014

I built my application under Windows XP (x32), Eclipse Luna (x32), JDK 1.8 (x32 - beta version B116).
 
When i launch it, the splashscreen (preloader) appears !
 
I rebuilt my application under Windows 7 (x64), Eclipse Luna x64, JDK 1.8.0_20 (x64).
 
When i launch it, the splashscreen doesn't appear !!!
 
For information, The structure of my application :
 
app
     | libs
          | preloader.jar
 
myapplication.jar
 
runtime
 
The behavior of JDK 1.8.0_20 about the management of the preloading mecanism is it different of the behavior of JDK 1.8 (B116) ?

View Replies


ADVERTISEMENT

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

Image Doesn't Show In JFrame?

Dec 18, 2014

I'm trying to open an image within a JFrame but the image doesn't show. The directory path is correct. The JFrame opens perfectly but no image is showing.

JFrame frame = new JFrame("IMAGE");
frame.setSize(500,500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon image = new ImageIcon("images/main.jpg");
JLabel label = new JLabel("", image, JLabel.CENTER);
JPanel panel = new JPanel(new BorderLayout());
panel.add( label, BorderLayout.CENTER );
frame.setVisible(true);

View Replies View Related

Last JLabel Added To JPanel Doesn't Show Up

Nov 14, 2010

I am adding JLabels to my JPanel, and the last one always does not show up. For example if I add 3 JLabels, the 3rd will not show up. If i change it to add 4, the 4th will not show up, but the 3rd will now. Here is a snipit of what my code looks like:

setLayout(new BorderLayout());
for(int x=0; x<PEDALCOUNT; x++)
{
pedals[x].setBounds((x*PEDALWIDTH),0,PEDALWIDTH,PEDALHEIGHT );
add(pedals[x]);
}

A workaround that I DO NOT want to keep doing is to put an extra fake JLabel at the end of the for loop, that way everything I want to show up does, but the fake one does not.

View Replies View Related

Label Doesn't Show Up On Applet Until Another Tab Is Clicked

Jan 17, 2015

I'm working on an applet for my class. I decided to use AWT even though it's really old.

I'm having trouble with the labels on my program. They don't show up until I click another tab in the browser and then go back to it each time after I click on a button. I tried to use repaint() but it doesn't seem to work. What can I do?

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.color.*;
public class FinalTwo extends Applet implements ActionListener{
Button b1;
Button b2;

[Code]...

View Replies View Related

JavaFX 2.0 :: StackPane Doesn't Center Another AnchorPane

Dec 8, 2014

In the documentation of StackPane i read: "The stackpane will attempt to resize each child to fill its content area. If the child could not be sized to fill the stackpane (either because it was not resizable or its max size prevented it) then it will be aligned within the area using the alignment property, which defaults to Pos.CENTER."

But as I add another Pane (Anchor- or BorderPane) this added Pane is shows always in left upper corner of the StackPane. How could I force my StackPane to center another AnchorPane?

View Replies View Related

JavaFX 2.0 :: Styling Of Controls Doesn't Work programmatically

Dec 9, 2014

I have a stylesheet (mystylesheet.css) with following entry:
 
.flowpane{
    -fx-background-color: rgb(0,0,0);
}
 
In then start-method of my application I execute:
 
       StackPane root = new FlowPane();
        Scene scene = new Scene(root,primaryScreenBounds.getWidth(),primaryScreenBounds.getHeight());
        scene.getStylesheets().add(css.getFile());
        root.applyCss();

No FlowPane gets black. But if I do that in SceneBuilder and add the stylesheet to root than after loading Fxml-file the FlowPane gets black.

Another approach:

        StackPane root = new FlowPane();
        Scene scene = new Scene(root,primaryScreenBounds.getWidth(),primaryScreenBounds.getHeight());
        scene.getStylesheets().add(css.getFile());
        root.getStyleSheets().add(css.getFile());
        root.applyCss();

Nothing happens.

        StackPane root = new FlowPane();
        Scene scene = new Scene(root,primaryScreenBounds.getWidth(),primaryScreenBounds.getHeight());
        scene.getStylesheets().add(css.getFile());
        root.getStyleSheets().add(css.getFile());
        root.getStyleClass().add("flowpanel"); 
        root.applyCss();

Doesn't work too;
 
but root.setStyle("-fx-background-color: rgb(0,0,0) works. But I need to style my application by css-files.

View Replies View Related

JavaFX 2.0 :: Combobox - Visible Count Row Not Applied And Doesn't Change

Oct 15, 2014

I have noticed a strange behavior of Combobox element. The number of visible rows is not the same established by setVisibleRowCount() method. It happens when changing the items list dynamically. The following example reproduces it. I think it is Javafx 8 bug. I have tried unsuccessfully to trigger some event indirectly to refresh the combobox drop down.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class TestComboBox extends Application {
    private int count;

[Code] .....

View Replies View Related

JavaFX 2.0 :: Progress Indicator Doesn't Rotate Anymore (8u20)

Aug 28, 2014

Since the upgrade to JavaFX 8u20 my ProgressIndicator won't rotate anymore when using Caspian style. Is there any workaround for this?
 
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ProgressIndicator;
import javafx.stage.Stage;
public class TestApp2 extends Application {
    public static void main(String[] args) {
    
[Code] ....

View Replies View Related

JavaFX 2.0 :: Modifying Item In Observable List Doesn't Update ListView

Oct 3, 2014

I am using:

Java:..... 1.8.0_20JavaFX:... 8.0.20-b26 

I have this class:
 
public class Person {
    private SimpleStringProperty name;
    public SimpleStringProperty nameProperty(){
        if(this.name==null){
            this.name=new SimpleStringProperty();

[Code] .....

I have this:

lista = FXCollections.<Person>observableArrayList();
lista.addAll(new Person("uno"),new Person("due"),new Person("tre"));
myListView.setItems(lista);

The problem is if I add /remove an item all is fine, the listView refreshes correctly:

Person p = new Person(tfld_textAdd.getText());
lista.add(0, p);
 
But if I change a value on an item into the observable list it doesn't:

lista.get(0).setName("new value");
 
I also have a table linked in the same way and the table workd correctly after I updated my Java version...

View Replies View Related

JavaFX 2.0 :: Show SVG-Image In WebView

Dec 2, 2014

I would like to reopen the following discussion: Show SVG-Image in WebView (JavaFX 8)
 
In our IDE (Eclipse Luna) running with jdk1.8.0_25 we load a html page into the webengine. The html page contains <img> tags with '.png' and '.svg' as src. Everything looks fine.

But if we execute the programm with java -jar, the WebEngine doesn't display the svg-files. Instead it shows the 'File not find'-Icon. The .png files still work
 
The files are definitly included into the jar and will be displayed if we link to them via <a href="someSvg.svg"></a>
 
So why it doesn't work.

View Replies View Related

JavaFX 2.0 :: ImageView Image Created In Scene Builder 2.0 Doesn't Display In Running App

Sep 9, 2014

I'm using Scene Builder 2.0 and have added an ImageView to the parent AnchorPane.  I've added my PNG files for the app icon and the various buttons. I select the ImageView in Scene Builder and then crawl the filesystem to the project package folder and select the PNG for the Image.  The assigned image is displayed in the Imageview in Scene Builder in both design mode and Preview mode.
 
While everything else shows up properly when the app is executed, the image assigned to the ImageView does not display.
 
From the FXML file:

<ImageView fx:id="ivBRULogo" fitHeight="64.0" fitWidth="64.0" layoutX="14.0" layoutY="14.0" pickOnBounds="true" preserveRatio="true" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0">
         <image>
            <Image url="@BRU_PE_B_64.png" />
         </image>
      </ImageView>
 
What might be occurring between the compiled app and what Scene Builder generates?

View Replies View Related

Show System Tray Or Desktop Notification From Web Application Based On Java

Nov 23, 2014

The explanation is a bit lengthy because I just tried to explain everything in one shot.

Link to the question

java - Show a System Tray notification or Desktop notification from the web application

View Replies View Related

JavaFX 2.0 :: Sometimes Form (BorderPane) Does Not Show Correctly

Feb 11, 2015

We have a problem with a JavaFX application running on Java 7. Sometimes a form (BorderPane) does not show correctly – it seems to be transparent (i.e. content previously shown at the same place is still visible). Controls seem to be present and respond to events – e.g. we can close the form by blindly clicking the appropriate button. Once the issue happens it is persistent, i.e. next time we open the form, it behaves the same.
 
We have no reproducible scenario leading to the issue. It just happens here and there – we have not been able to identify any pattern yet.
 
Additional information:

The form (BorderPane) is loaded during application start-up but it is not shown initially,to show the form we remove previous contents from a StackPane and add the form instead,to hide the form we do the reverse. 

View Replies View Related

JavaFX 2.0 :: How To Not Show ListView ContextMenu When Right Clicking On Null

Jun 16, 2015

I only want the context menu to be showen if the user is clicking on an actual listview item, not if they click anywhere else in the listview. I know this is possible and I found answers to similar problems, but in the end they didn't provide enough infomation for me to solve my issue. I found this example on how to do it with a list view containing String objects, but what if my list view contains another object, in my case a wrapper class? I have a wrapper class to keep track of the key, but I only display the value variable in the listview, through calling the toString method. So the cells still contain a wrapper.

class Wrapper(int key, String value) {
..
}
public String getValue() { return value; }
public SimpleStringProperty getValueAsProperty() { return new SimpleStringProperty(value); }
public String toString() { return value; }

[Code]....

But line 05 gives me a NullPointerException, why? I do this after I've set the items of the list view by doing listView.setItems(..).

View Replies View Related

SplashScreen - Stack Overflow Error

Jun 14, 2014

I am getting a stack overflow error. I know there's something off about the code but I can't get it....

// The "SplashScreen" class.
import java.awt.*;
import javax.swing.*;
public class SplashScreen extends JWindow
{
ImageIcon book;
public SplashScreen ()

[Code] ......

View Replies View Related

JavaFX 2.0 :: Adding Tooltip On Cell Of TableView In Order To Show Some Information To User

May 21, 2014

I'm trying to add a tooltip on a cell of a TableView in order to show some information to the user.
 
This is the code:

colonnaColore.setCellFactory(param -> {
            TableCell<Appuntamento, Template> cell = new TableCell<Appuntamento, Template>() {
                @Override
                protected void updateItem(Template item, boolean empty) {
                    // calling super here is very important - don't

[Code] ....
 
In few words: there is a cell factory on the cell to show a colored box, then I added a tooltip to the cell. I need informations that are in the item added to the TableView that has type "Appuntamento". So I try to get my element with these code (that in others part of my code works); but here I get a Null Pointer Exception on cell.getTableView() and also on cell.getTableRow().
 
I'm probably using these methods in a way that was not expected.

View Replies View Related

JavaFX 2.0 :: How To Improve Application Startup

Aug 26, 2014

I have a UI that uses fx:include to include a handful of nodes in a StackPane.  So far I have less than 10 panes and I can already notice a delay of ~3 seconds (on an older machine) when the initial scene is built.  It's especially noticeable because I'm using a pre-loader with a progress bar.  The progress bar runs smoothly until the pre-loader calls start() on my application.  After that, the scene is built on the application thread, so the progress bar doesn't get any more updates.  It looks like the progress bar freezes until the main scene is built and shown.
 
I was hoping I could build the main scene on the JavaFX launcher thread, but that doesn't work.  I tried it and, not surprisingly, get an exception for not being on the application thread.  What are the options, if any, for making an application's start up feel a bit smoother?

View Replies View Related

JavaFX 2.0 :: Multithreading In Background In Application

Dec 25, 2014

I need to work with multiple threads in background in a JavaFX application. I have a screen with ten buttons and I need to 'bind' each thread with the button that started the thread. If the user pressed a button that had started a thread (in the main screen, MainController.java), I need to recover it to display the information that contains to display it on the controls of Details Screen ( a second screen, DetailController.java).

What Class do you recommend for this? Service?

[URL] ....

It is possible to name the threads with any of these classes?

View Replies View Related

JavaFX 2.0 :: How To Access Application From Controller

Sep 25, 2014

I do Java for decades, but am a FXML beginner. Currently I do FXMLLoader.load(fxmlFile) in Application.start(), which is working well. My Application instance is creating a background thread in Application.init() which feeds several custom application properties with incoming data taken from a remote model (wrapping a sensor hardware). Some of my windows shall later be able to access those properties. So the question is: How can I inject my Application instance into the FXMLLoader-created controller instances auto-bound to the FXML-created Scene instances?

View Replies View Related

JavaFX 2.0 :: FXML Application With Database

Jun 5, 2014

I'm new in JavaFX world. I'm going to write an application using FXML and this application will use embedded  database. Is there any tutorial or example showing how to connect FXML (using controller as I expect) with database. I'm using Hibernate with classic JAva - is it possible to work with Hibernate with JavaFX?

View Replies View Related

JavaFX :: Implementation Of Web Data Into Non-web Java Application

Aug 4, 2014

What would be the most effective method to display data grabbed from a web source that is queried every second, for example the most recent EUR/USD price?

I already have access to the data stream, and I've built a simple FXML in javaFX that contains a grid; I'm not sure how to approach putting the live ticking data into the grid so it continues to update as the price changes, for example.

View Replies View Related

JavaFX 2.0 :: Saving And Restoring UI Elements In Application

Oct 6, 2014

Is it possible to save dynamically created UI elements (e.g. tabs, buttons) and restoring them in a later session for the user?  The user should be able to customize the application UI and creating buttons as shortcuts for tools.

View Replies View Related

JavaFX 2.0 :: Launching Application In Separate Plugin

Sep 25, 2014

I have the following problem:
 
Let's say, there is a simple Java application. It could either be a Swing or JavaFX or a plain Console application.
 
Then there are kind of X plugin jars which can be also on the classpath.
 
The main application (e.g. main.jar) scans the classpath for classes, which implement an plugin interface. For each found implementation it invokes some method on the interface.
 
The interesting part now is, that upon calling the interface method, some plugins may want to popup a JavaFX window.
 
And the problem is, that I can't just call Platform.runLater there, because of "java.lang.IllegalStateException: Toolkit not initialized".
 
And if I somehow manage to call Application.launch() (when? where?) in the plugin then there's the danger, that the second plugin gets "IllegalStateException: Application launch must not be called more than once"

I also don't want to call launch() in the main application, since it is not necessarily an JavaFX application.
 
Do I maybe need to start separate JVM in the plugin? Could it still communicate with the original JVM then (main.jar)?

View Replies View Related

JavaFX 2.0 :: Application Icon - How To Setup / Configure For Alt-tab

Jul 12, 2014

Any documentation that deals with assigining an icon to your application? I have tried the:
 
"stage.getIcons().add(new Image(this.getClass().getResourceAsStream("myicon.png")));"
 
Code as suggested on the web. It looks like this changes the icon in the window decoration only, which doesn't actually show on my Ubuntu desktop with Unity. What I really want is a custom icon for when I alt-tab through open applications. Currently it shows the default grey question mark. How do I assign an icon to the application.

View Replies View Related

Does JavaFX Methods And Objects Works Into Java Application

Nov 22, 2014

I was doing a project in a usual Java Application, but now maybe I have to use some tools that are contained in javafx.scene.media.MediaPlayer so I wonder if can it all work? Will javafx methods and such works?

I have to use javafx.scene.media.MediaPlayer beacuse I have to create a very simple audio player (one jbutton and one jcombobox).

View Replies View Related







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