Showing posts with label Java FX. Show all posts
Showing posts with label Java FX. Show all posts

01 February, 2015

How to open sas7bdat file

I found Rocket Table application for this purpose. It doesn't require any SAS software, it's free and easy to use.
SAS Table Explorer allows you to open file in the .sas7bdat format and shows it as a table.

Main features of this application are:
  • Search over the whole dataset, or by specific columns
  • Highlight search results
  • Wildcard search
  • Truncate the analyzed dataset (to matched or selected rows)


Anyway this is the most compact tool for opening sas files.

07 January, 2015

How to close Java splash image after the application starts

There is a very easy way to get Splash screen in Java application.
With a "-splash:imagepath" command line parameter, or with "SplashScreen-Image: imagepath" manifest parameter.

But when an application is started, Java still shows this image (below the application layer, but it visible when you switching between the applications), until the application is finished. Strange behavior, but it is possible to close this kind of splash screen.

With these lines of code:
import java.awt.SplashScreen;
...
SplashScreen splashScreen = SplashScreen.getSplashScreen();
if (splashScreen != null) {
    splashScreen.close();
}

06 January, 2015

How to bind hotkeys in Java FX

It is possible to create global keyboard shortcuts using a code like this:
import static javafx.scene.input.KeyCombination.keyCombination;
...
private void initHotkeys() {
    ObservableMap accelerators = stage.getScene().getAccelerators();
    accelerators.put(keyCombination("Alt+S"), searchTextField::requestFocus);
    accelerators.put(keyCombination("Alt+C"), columnsTextField::requestFocus);
    accelerators.put(keyCombination("Alt+O"), openFileButton::fire);
    accelerators.put(keyCombination("Alt+E"), exportButton::fire);
    accelerators.put(keyCombination("Alt+T"), truncateButton::fire);
    accelerators.put(keyCombination("Alt+H"), () -> filterChoiceBox.setValue(MATCH_HIGHLIGHT));
    accelerators.put(keyCombination("Alt+F"), () -> filterChoiceBox.setValue(MATCH_FILTER));
    accelerators.put(keyCombination("Alt+U"), () -> filterChoiceBox.setValue(MATCH_FILTER_UNIQUE));
    accelerators.put(keyCombination("Alt+D"), () -> {
        //todo some debug action
    });
}