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


ADVERTISEMENT

JavaFX 2.0 :: Reordering Barchart Elements

Mar 4, 2015

I am new to JavaFX. I would like to display a bar chart of items that are arranged according to their values.
 
I have the codes below that I call the function updateChart() after some user interaction. The list is sorted according to their values and on the 1st time the chart is populated, the order is displayed correctly.

However, when I pass in a new list with the same labels but with a different value, the bar chart is still displayed in the same order as the 1st time it is populated, even though I called clear().
 
@FXML
private BarChart<Number, String> certaintyFactorChart;
 //update chart based on cf values
public void updateChart(List<AbstractMap.SimpleEntry<String, Double>> cfValues){  
     certaintyFactorChart.getData().clear();

[Code] ....

View Replies View Related

Servlets :: Restoring Session Variable After Timeout

Oct 17, 2014

My application uses Struts and IBM Web application Server. I have a question regarding session management. I have a variable stored in session scope, i.e. the name of the client. it is a intranet application. Now whenever the user leaves the browser screen for a long time, the session times out and losses the name of the client.

How to restore the variable after the client comes back and starts using the browser and refreshes the screen and starts using the application. I want just the browser to remember the session variable i.e. "name" of the client.

View Replies View Related

Declare Array Of 50 Elements Of Type Double - Print Output 10 Elements Per Line

Feb 5, 2015

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class array
{
public static void main(String[] args)

[Code] ...

Is there a way to write this, where, alpha is one array.

Write a program that declares an array "alpha" of 50 elements of type "double". Initialize the array so that the first 25 elements are equal to the square of the index variable and the last 25 elements are equal to three times the index variable. Output the array so that 10 elements per line are printed.

If I have an array of 50 integers, can I break that to read in lines of 10?

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 :: 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 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

JavaFX 2.0 :: Creating Front-end Application That Uses Command Line Tools

Sep 8, 2014

I'm creating UI's that run on top of backend tools that can run from seconds to days and output GB's of generated data (imagine running tar on the Google servers).
 
I understand how to execute my backed tools using a runtime process and how to interact with them, and running a simple text as a command line Java app works as expected.  The issue occurs when I wrap the code in a JavaFX frount end UI try to update the UI elements in a reasonable manner.  If I simply use System.out.println() as in the command line version, I see the output from my task.  However, simply trying to put that same output into a TextArea using .appendText() doesn't update the TextArea until the background process completes.
 
I see all sorts of clippings relating to Task, CreateProcess, invokeLater, updateProgress, but none of them seem to solve their original posters' question (nor mine at this point).

View Replies View Related

Add Elements To 2D Array Without Losing Elements

Jan 12, 2015

I am trying to make a 2d array that keeps track of comparison counts. what I have so far works ok but writes over the previous elements with 0. can't seem to find where I am re-initializing the previous elements.

//this is one of my fill sort arrays

public void fillSelectionArray(int index, long countSum) {
//rand = new Random( );
//for ( int i = 0; i < listsize; i++) {
selectionList[ index -1] = countSum;
// }

[Code] ....

I know I am missing something just not sure what.

View Replies View Related

JSF :: Saving A Session Attribute?

Mar 13, 2014

How can I store in database an user Session attribute along with other informations provided in the same form?

<p:outputLabel value="user ID:" for="informer" />
<p:inputText id="informer" value="#{session.getAttribute('userID').toString()}"
title="informer" disabled="true" />

I've already tested with disabled="false", too, but only the Session attribute is saved as NULL, though it appears in the form field. The other fields are saved properly.

View Replies View Related

Saving Graphics 2D As Image

Jul 30, 2014

What I am trying to do is save the the content drawn to my screen as an image. The following code is my render method and although I know how to use it, I don't fully understand the classes and how they work with is making this difficult.

public void render() {
BufferStrategy bs = this.getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
return;

[code]....

View Replies View Related

Saving Variables In Applet?

Apr 13, 2014

Is there any way to save variables while I'm using applet as single runnable .jar file?

For example if I start app first time some variable has value of 100. While using app it changes to 200. After closing app it disapear and next run gives me 100 again instead of 200. Is there any way to save that 200?

View Replies View Related

JSF :: Saving 2 Times One Form

Feb 22, 2014

I'm trying to save to a table in a database that has only 2 fields, (id, nota) . I want to save the data several times just to click on "save" one look . The code that I have is this:

<h:form id="frmPerso" style="font-size: 13px;">
<h:outputText value="Id 1" />
<h:inputText value="#{vistaEjem.notas.id}" />
<h:outputText value="Nota 1 " />
<h:inputText value="#{vistaEjem.notas.nota}" />

[Code] ....

I was told to use a foreach or for the insertDatos, but not as used..

View Replies View Related

Saving Data To A File

Oct 1, 2014

I am learning FileIO and I am having an ArrayIndexOutOfBoundsException for the following code and I am unsure why...

import java.io.*;
public class ArrayWriter {
public static void main(String[] args) {
PrintWriter fout = null;
int[] data = new int[10];
for(int i = 0; i<data.length; i++) {
data[i] = (int)(Math.random() * 101);

[Code] ....

View Replies View Related

Saving Data Using Java

Sep 18, 2014

So I'm still learning how to save data using Java. I know that saving data is extremely important when it comes to creating video games.

What I have here is this simple program.

Java Code:

import java.util.*;
import java.io.*;
import java.lang.*;
public class Character
{
private Formatter x;
private int roomNum;
private boolean[] visited = new boolean[10];

[Code]...

I'm trying to make sure that after I exit the program, joe starts in room 4, not room 1, and that he has visited rooms 1, 2, 3, 4, and 10. I have the save data created, but how do I save an array of boolean values?

View Replies View Related

Saving Code States

Mar 3, 2015

recently I was playing a lot in Eclipse, testing util classes, randomisation etc. But always when I wanted to keep something for future reference, I had to either comment it out or start a whole new class, copy all the code and change just that little thing I was testing.I was wondering if it's possible to actually save just the 'current state' of the code. The idea came back from my days when I was working with 3ds max and I saved the scene periodically so I could revert back anytime I messed up something.

I was looking into Object Serialisation and JUnit testing for this purpose, but that's just too complicated. Is there a way in Java (Eclipse) to accomplish such thing?

View Replies View Related

Saving Data To TXT File

Oct 27, 2014

I was able to create the txt file. How to get it to output my code. I know it's an object and it is a way to save data.
 
package multiplicationFile;
import java.util.Scanner;
import java.io.*;
public class Multiplication {
public static void main(String args[]) throws IOException {
PrintWriter outF = new PrintWriter("multiplications.txt");

[Code] ....

View Replies View Related

Saving Input As Variable For Later Use

Jun 16, 2015

I need to know how to save input as a variable for later use. Here is the code so far:
 
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class TextGUI extends JFrame{
     public TextGUI(){
          super("Text Test");
          setLayout(new FlowLayout());

[Code] ....

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

Saving Data To A File That Has Been Entered

Jan 21, 2014

I am trying to save the data a person enters to a file. See code below. It is compiling however the file created only shows largest =89, i want the file to show all the data a person enters.

import java.util.*;
import java.io.*;
public class LargerOfThree3{
public static void main(String args[]){
Scanner in = new Scanner(System.in);

[Code] ...

View Replies View Related







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