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


ADVERTISEMENT

Property Files That Used To Configure The Application Can Be Stored In Jar File?

Dec 22, 2013

I already used properties file without problems for localizing information. In that case the property file was stored as a resource in a package; and I used the Class ResourceBundle to manage the operations and the ClassLoader to access to the file.

Actually I need to use property files “To save the configuration of the application”.In this case I need also to update information stored inside the file.property, and I used the same procedure as before to manage it (ClassLoader to get data- also for writing).

I had problems in this case: that the data was never modified inside the properties file. I investigate, and now I think that the problem comes from writing in the property file that is located in the .jar file. For what I know, it is impossible to change resources putted in the .jar files.

I found a solution: to store the properties files out the jar files; and in this way all is good. But it would be more comfortable to store inside.

My question is : if a file property used to “save the configuration of the application “ have to be put out of jar, or is there another way ??

View Replies View Related

JavaFX 2.0 :: Setup CellFactory Of TreeView?

Jun 5, 2014

I create my own TreeCell class to customize the look of the tree items of a TreeView which is displaying java.nio.file.Path information.
 
To setup the CellFactory of the TreeView I used the following:

pathTV.setCellFactory( (TreeView<Path> tv) -> {
return new MyCustomTreeCell();
} );
 
This works... Now I tried to do some other things with my custom tree cell class so I created an instance of it
 
MyCustomTreeCell mctCell = new ...

Later I changed the code to setup the CellFactory
 
pathTV.setCellFactory( (TreeView<Path> tv) -> {
            return mctCell;
        } );

This doesn't work ... I did not see anything in my TreeView...
 
Here is the MyCustomTreeCell class:

public class MyCustomTreeCell extends TreeCell<java.nio.file.Path> {
private final ImageView icon;
public MyCustomTreeCell() {
super();
icon = new ImageView();

[Code] .....

View Replies View Related

JavaFX 2.0 :: Stage Icon In Windows 7 Taskbar Mouse Event

Jan 15, 2015

I develop a desktop soft use javafx8, and remove default border (e.g. title and close/min/max button), now use mouse left key click the taskbar icon is nothing,i want click the taskbar icon,if stage it's show then hidden, if stage it's hidden then show it,the problem is I can't capture any mouse click event,so i can't show or hidden my stage.

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

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

How To Setup Decimal Point For A Result

Apr 18, 2015

Right now it displays a number like this "$25.0" and I want it to display it like this "$25.00" and don't know how to do it.

View Replies View Related

How To Add JPanel With Background Image To Already Setup GUI

Apr 30, 2014

I am trying to set a picture in the background of my GUI. I had already made the GUI with the all the required buttons and labels. So I was trying to separately make a class which extends JPanel and add a picture to a panel by overriding the paintComponent() method, and then added it to a frame (I did not set the default layout of the frame, so it was the default...), and it worked very fine. Here is the code:

Java Code:

private BufferedImage image;
public ParentPanel() {
try {
image = ImageIO.read(getClass().getResource("/com/dev_nna/scheduler/UI/1405188.png"));
} catch (IOException ex) {
ex.printStackTrace();

[code]....

Then I needed to add this panel with background picture to the background frame of my already made frame with all the buttons on it.The layout of the parent frame of my GUI was BorderLayout(50, 50), panels (with buttons) were added to it n the north and south positions.

Then I tried to add a JPanel with the background image to the parent frame (of my GUI), (I wanted it to elapse the entire frame, and come under all the buttons and controls, which were only present in the north and south positions of the border layout), and then the panels holding the buttons to the north and south postions of this panel, everything disappeared.

If I don't do anything except adding this panel with the background image to the parent frame, it only takes up the place not taken up by the two panels on the frame (Border Layout)

how to add this panel to the parent frame of my GUI such that it elapses the entire parent frame's background, and the panels containing the buttons should sit on it.

IMPORTANT PARTS OF CODE:-
Java Code:
//TOP LEFT PANEL
JPanel topleftpanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
parentPanel_top.add(topleftpanel);
topleftpanel.setOpaque(false);

[code]....

View Replies View Related

How To Setup Sonar For C# Code Analysis

Jul 20, 2014

I am new to Java. I am from .net background.I am trying to setup Sonar server. In one of our training sessions on Sonar, the instructor did the anaysis of solution using pom.xml file and then calling mvn sonar:sonar. I am trying to replicate the entire setup locally.

1. I installed JRE 7. When I run , java -version, it shows,

java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

2. I download sonar 3.5 and extracted it to new folder

3. In that folder I installed sonar-runner 2.4

3. setup the path and sonar_runner environment variable

4. downloaded jtds-1.3.1 and placed the jar file in mssql folder of sonar

5. I create database sonar with username and password as sonar

6. changed sonar-runner.properties for sql server connection

7. changed sonar.properties for sql server connection

8. Ran Sonar.bat and found that it created tables in the sql server db. To me the command prompt seems like it is hanging as after creating table graphs, the last line is

"jvm 1 | 2014-07-20 13:03:34.967:INFO::Started SelectChannelConnector@0.0.0.0:

9000 "

Is it supposed to stay like this always or should i closed this command prompt by pressing CTRL+C?

9. Now when i run mvn-sonar:sonar, it says mvn is not recrognizes as internal or external command. A quick search on google showed that I need to install Apache maven something I belive. What is this or how do I solve this issue so that the command mvn sonar:sonar can work?

10. I would like to use c sharp ecosystem plugin. But when I browse to C# Plugin - SonarQube - Codehaus , I am confused as what to select? i.e. version 3.2, 3.1, 3.0

11. So if I do a system restart and everytime I have to use sonar, should i run sonar.bat and then do mvn sonar:sonar after modifying the pom.xml file?

View Replies View Related

How To Add Database To NetBeans Project When Making Setup

Aug 21, 2014

I have completed an assignment for my university in which I had to make a Java NetBeans project. My project is now completed but now I have to make a setup of my NetBeans project and give the university the setup file, only.

My question is, the software I made has a database attached to it, meaning the purpose of the software is to be used with the database. Values must be saved in the database, deleted from the database etc.. I have used MySQL database connections with the JDBC driver

I have used exe4j to make the .exe file and Setup Factory to make the exe file and setup file respectively. Once I make the setup and run the setup, the application works, ON MY COMPUTER. The computer which made the software. But once I take it to a computer in which MySQL was not installed, the setup installed, but the software did not work.

View Replies View Related

Setup Virtual Database In JUnit Tests

Mar 26, 2014

First I was using this way how to get connection and all was fine.

con = DriverManager.getConnection("jdbc:derby:memory:datab;create=true");

But now I have to change it to DataSource and how I find out derby had class ClientDataSource for this but for the hell I can't find out how to setup that virtual DB.

ClientDataSource ds = new ClientDataSource();
con = ds.getConnection();

View Replies View Related

Array Setup - Analyze By Adding Up Contents Of Each Column

Feb 16, 2015

I've setup an array that I would like to analyze by adding up the contents of each column, however, the out of bounds exception pops up when I try to execute the program. I know the book usually expresses this operation the other way around, where the row is the argument of the first for statement, but I've set my array up where I need to add each row before moving to the next column.

vowelCounter is a 5x3 array.

// Display the line which had the most number of vowels

public static int maxVowelSentence() {
int max = 0, sum = 0;
int sentence = 1;
for (int row = 0; row < vowelCounter.length; row++) {
max = vowelCounter[row][0];

[Code] ....

View Replies View Related

JDBC :: How To Add Database To NetBeans Project When Making Setup

Aug 21, 2014

I have completed an assignment for my university in which I had to make a Java NetBeans project. My project is now completed but now I have to make a setup of my NetBeans project and give the university the setup file, only.

My question is, the software I made has a database attached to it, meaning the purpose of the software is to be used with the database. Values must be saved in the database, deleted from the database etc.. I have used MySQL database connections with the JDBC driver

I have used exe4j to make the .exe file and Setup Factory to make the exe file and setup file respectively. Once I make the setup and run the setup, the application works, ON MY COMPUTER. The computer which made the software. But once I take it to a computer in which MySQL was not installed, the setup installed, but the software did not work.

View Replies View Related

Set Icon Of File Depending On What Is In It - Like PNG

Feb 15, 2014

So I'm in the middle of creating a model program with voxels. I want to be able to see how the model looks like when I'm in for example my documents (not inside the real program). I want it to show an image of the model, just like a png file shows its image. I've tried looking around, but I've only found threads about changing exe files icon.

Image example:

So, is this possible in Java or do I need to use c/c++ (with JNA) to make this possible?

Or is it not possible at all?

View Replies View Related

How To Resize Icon Of Button

Jan 30, 2015

So I have got a button and there is this property assigned to it:

button.setIcon(new ImageIcon("srcimage.jpg"));

The icon is not displayed in full, as it is larger than the button. What property can I use to resize the icon? I have tried few and it did not work.

View Replies View Related

Swing/AWT/SWT :: Setting Icon On JButton

Feb 23, 2014

Recently I have been working on an executable launcher. I tried to get the executable icons and set them on the JButtons. Still there are some problems. Here is a part of the code:

try {
button[i].setIcon(FileSystemView.getFileSystemView().getSystemIcon(new File(getConfig("path." + (i+1)))));
}
catch (NullPointerException ex) {
}

Here the getConfig() method is already defined to get a string in a "properties" file. However, the icons are very small and they don't fill the entire button.

How can the icon fill the entire button (for example, having a custom size of 48x48, or automatically filled the button)? The frame will not be resized.

Here is the whole code...

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.io.File.*;

[Code] ....

View Replies View Related

Swing/AWT/SWT :: How To Resize Image Icon

Aug 15, 2001

Any way to resize an ImageIcon when placing it on a Button so that I don't have to physically rezize the image file?? I am writing an Application, not an applet, so the getImage method won't work.

View Replies View Related

Java GUI Displaying Image Icon

Dec 2, 2014

how to display a jpg image on a through a Jlabel. I am sure it is a simple error but I am still new to GUI's. line 31 to 35 you can see the ImageIcon and file wrapped in the JLabel. I verified its in the correct location and file name, but usually fails (i thought) when it is not correct.

Java Code:

import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

[code]....

View Replies View Related







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