Code Monkey home page Code Monkey logo

Comments (9)

EasyG0ing1 avatar EasyG0ing1 commented on August 10, 2024

@Jeevasimba What do you mean when you say "tray closing system" ?

I use FXTrayIcon in Java Mac apps all the time and it works beautifully ... better than it does in Windows in my humble opinion.

from fxtrayicon.

pradeepsimba avatar pradeepsimba commented on August 10, 2024

will it work on linux ?

from fxtrayicon.

EasyG0ing1 avatar EasyG0ing1 commented on August 10, 2024

@Jeevasimba - if your desktop environment supports JavaFX in the system tray, then it will. I think there is an add-on you can get for Gnome that will support it, but I haven't played with it much in Linux.

from fxtrayicon.

EasyG0ing1 avatar EasyG0ing1 commented on August 10, 2024

@Jeevasimba This link might be of some interest to you...

from fxtrayicon.

pradeepsimba avatar pradeepsimba commented on August 10, 2024

I am using Style.UNDECORATED in my javafx application.

In button I set code like this

public void exit(ActionEvent event){
    System.exit(0);
}

If I click that button the tray also closes.

I want to set if I click then the app will go to tray.

How can I set like that with Style.UNDECORATED ?

from fxtrayicon.

EasyG0ing1 avatar EasyG0ing1 commented on August 10, 2024

@Jeevasimba - First of all, when you instantiate FXTrayIcon, you need to pass in the primaryStage that is created from your Main class

@Override public void start(Stage primaryStage) throws Exception {
    FXTrayIcon trayIcon = new FXTrayIcon.Builder(primaryStage).build();
}

Of course you can also include any of your custom build options in that sentence such as your chosen icon, and your menuItems etc.

When your menuItems call up other windows, they need to have their own Stage associated with their given Scene. Then, when you need to close that window, just call the .close() method for that Stage

myStage.close();

from fxtrayicon.

EasyG0ing1 avatar EasyG0ing1 commented on August 10, 2024

@Jeevasimba - You can look at this library that I wrote, that makes managing Java Scenes a little easier. With that library, you assign names to your scenes so that you can access them from anywhere in your application. The library lets you create and show a Scene in one line of code, which you can access from anywhere in your program in any class ... closing a Scene is done like this

SceneOne.close("MySceneId");

The library takes all of the minutiae out of managing scenes.

from fxtrayicon.

pradeepsimba avatar pradeepsimba commented on August 10, 2024

I set my image as icon.

my image quality is very high

but , in tray the image quality is very low and pixels broken.

I want to set my image as icon with high quality. How can I do this?

from fxtrayicon.

EasyG0ing1 avatar EasyG0ing1 commented on August 10, 2024

@Jeevasimba

You can use a high quality .png file as your image. Look at the images in the resources folder in the project for some examples. like this one for example. However, in Windows, your image size typically can't be greater than 17 x 17 pixels and usually it needs to be 16 x 16 pixels. On a Mac, you can set it to 22 x 22 pixels and it will look really nice on the mac ... here are some that I use on personal programs that I wrote that run on my mac:

Screen Shot 2022-05-13 at 10 19 54 AM

If you save that image to your hard drive, then open it and set your zoom to 100%, you'll have a better idea of what they actually look like.

from fxtrayicon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.