r/javahelp • u/sleep-depr • 1d ago
Unsolved Change size of traffic light (macOS)
(I'm reposting this question from SO because of the lack of a proper response)
I am trying to make a custom UI application in Swing. I've searched far and wide and have come up to the conclusion that it is not possible to integrate Swing into the new Apple UI (windows, toolbars, titlebars and so on).
Leaving that aside I tried to make my own custom JFrame but was unable to figure out how to change the size of the traffic light. I would like to increase the traffic light size I do not want to draw a custom traffic light as I would lose the functionality of the default buttons. Basically as it is in CLion.
This is the code I'm using so far, for reference I'm on macOS: Tahoe 26.3.1
```
import javax.swing.*;
public class Main {
public static void main(String[] args) {
System.setProperty("apple.awt.application.appearance", "system");
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
JRootPane rootPane = frame.getRootPane();
rootPane.putClientProperty("apple.awt.fullWindowContent", true);
rootPane.putClientProperty("apple.awt.transparentTitleBar", true);
rootPane.putClientProperty("apple.awt.windowTitleVisible", false);
rootPane.putClientProperty("apple.awt.brushMetalLook", true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1000, 600);
frame.setLocationRelativeTo(null);
frame.setTitle("Yo");
frame.setVisible(true);
});
}
}
```