Set Java Swing Dock Icon on Mac [duplicate] - java

This question already has answers here:
Setting the default application icon image in Java swing on OS X
(6 answers)
How do you change the Dock Icon of a Java program?
(6 answers)
Change Java application icon?
(4 answers)
How can I change the default icon of a java application on a mac using netbeans?
(5 answers)
How do I set the icon for my application's Mac OS X app bundle?
(3 answers)
Closed 1 year ago.
I'm new to the Java Swing Package and I am trying to build a basic application. I want to change the dock icon on MacOS from the basic Java logo to my own and I tried using the code below but nothing changes. And this is the dock icons. I'm using MacOS 12.0.1 and Java SE 17.
var image = new ImageIcon("Content.png");
frame.setIconImage(image.getImage());
Can anyone help?

Related

How to automate testing <canvas> with Java [duplicate]

This question already has answers here:
How to perform Mouse Wheel scrolling over HTML5 Canvas in Selenium?
(2 answers)
How to click the center of the canvas in Java Selenium Driver?
(1 answer)
How to find the coordinates of the buttons on a canvas, and click on them after using Java and Selenium?
(2 answers)
Closed yesterday.
I'm doing UI automation with Selenide. I can't locate elements inside with regular way by xpath or css selector.
enter image description here
I'd like to find predictable and stable solution to make automation of on Java

get running desktop apps with java? [duplicate]

This question already has answers here:
Windows running application list using Java
(4 answers)
Is there a Java library to access the native Windows API?
(6 answers)
Closed 4 years ago.
I´m trying to get the running programs with graphic interfaz that I have running and iterate over them to give them focus. Is there a way to do this with java (or any other language)?
Searching the web I only find things for Android. Any help is appreciated
Example: I have my calculator open, and my app made with javafx. My app shows me a list with all the programs running in my computer, in this example, it shows me that the calculator is open. There is a button next to each item of the list, and if I click on them, I can give the calculator focus and start using it.
You could use ps on the Linux and tasklist on the Windows. Java allows you the command line access.

Prevents screen snapshot [duplicate]

This question already has answers here:
How to prevent Screen Capture in Android
(16 answers)
Closed 4 years ago.
I have an Android banking app that prevents from taking a snapshot of the screen how do I do that in my own app.
Does anyone know how this is achieved?
It can be achieved by adding a simple code in the activity
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}
Just add FLAG_SECURE flag in the activity. It Works for all Android versions higher than HONEYCOMB ie API 11 or higher.
Window flag: treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.
Thsi prevents screenrecording and screenshots

How to remove Java(TM) Se Binary from Task Manager and Show Swing Application Icon [duplicate]

This question already has answers here:
How do I change the default application icon in Java?
(10 answers)
Closed 4 years ago.
My Frame
Please have a look at Image, I have to remove Java(TM) Se binary and show only Icon of My Desktop Application in task manager.
Application icon I've already changed but in task manager it is showing Like Image.
To perform that, you can use launch4j to create a seperate launcher with custom process name.

android - setup and install Custom Font in Android without root [duplicate]

This question already has answers here:
android - install font to android platform without root
(2 answers)
Closed 4 years ago.
I developed an Android application which is a custom keyboard with a custom font.
I developed the keyboard successfully but I'm stuck for changing the font. How can I install and setup a custom font in my Android device ?
I need to setup the font with my keyboard in the same application.
I used the iFont application to install the font on the device without root access.
I searched if I could find code do the same function than the iFont application.
How can I install a font programmatically?
there is no way.it is possible only on Rooted devices and some special devices (like "Samsung").
android - install font to android platform without root

Categories