import javax.swing.*;
import java.awt.*;

public class Main {

public static void main(String[] args) throws Exception {
    JFrame frame = new JFrame("HiDPI test");
    JPanel panel = new JPanel(new GridLayout(2, 0));
    panel.add(new JLabel("Some text"));
    panel.add(new JButton("A button"));
    frame.setContentPane(panel);

    frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    frame.setUndecorated(true);
    // frame.setBackground(new Color(0, 0, 0, .5f)); // this line disabled HiDPI
    // frame.setOpacity(.5f);
    frame.pack();
    frame.setVisible(true);
}

}